/* Mobile Optimization for The Auto Refinery - 2025 */
/* Comprehensive mobile-first responsive design */

/* ===== VIEWPORT AND CORE MOBILE SETUP ===== */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TOUCH INTERACTIONS ===== */
/* Improve touch targets */
a, button, .button, .nav-cta {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .hover-effects,
    .service-card:hover,
    .testimonial-card:hover,
    .location-card:hover {
        transform: none !important;
        box-shadow: inherit !important;
    }
}

/* ===== MOBILE TYPOGRAPHY ===== */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    h3 {
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.8rem !important;
    }
    
    h4 {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.6rem !important;
    }
    
    p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }
    
    .section-title {
        font-size: 2rem !important;
        text-align: center !important;
        margin-bottom: 2rem !important;
    }
    
    .section-subtitle {
        font-size: 1.1rem !important;
        text-align: center !important;
        margin-bottom: 1.5rem !important;
    }
}

/* ===== MOBILE NAVIGATION ===== */
/* Hide mobile menu elements on desktop */
.mobile-menu-overlay {
    display: none !important;
}

.mobile-menu-btn {
    display: none !important;
}

@media screen and (max-width: 768px) {
    #navbar {
        padding: 0.5rem 0 !important;
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 10000 !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(10px) !important;
    }
    
    #navbar .container {
        padding: 0 1rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    #navbar .logo {
        font-size: 1rem !important;
    }
    
    #navbar .nav-logo {
        width: 32px !important;
        height: 32px !important;
    }
    
    .nav-menu {
        display: none !important; /* Hide full nav on mobile */
    }
    
    /* Hide mobile hamburger menu button - not needed */
    .mobile-menu-btn {
        display: none !important;
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.95) !important;
        z-index: 9999 !important;
        display: none !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .mobile-menu-overlay.active {
        display: flex !important;
    }
    
    .mobile-menu-overlay .nav-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
    }
    
    .mobile-menu-overlay .nav-list li a {
        color: white !important;
        font-size: 1.5rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        padding: 1rem 2rem !important;
        border-radius: 8px !important;
        transition: background 0.3s ease !important;
    }
    
    .mobile-menu-overlay .nav-list li a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .mobile-menu-overlay .nav-cta {
        background: #0066ff !important;
        color: white !important;
        padding: 1rem 2rem !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
        margin-top: 1rem !important;
    }
    
    /* Add padding to body to account for fixed nav */
    body {
        padding-top: 60px !important;
    }
}

/* ===== MOBILE HERO SECTION ===== */
@media screen and (max-width: 768px) {
    .hero-section,
    .location-hero {
        padding: 3rem 0 2rem 0 !important;
        min-height: 60vh !important;
        text-align: center !important;
    }
    
    .hero-section .container,
    .location-hero .container {
        padding: 0 1rem !important;
    }
    
    .hero-title,
    .location-title {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-subtitle,
    .location-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .trust-badges,
    .location-highlights {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
        margin: 2rem 0 !important;
    }
    
    .trust-badge,
    .highlight-item {
        padding: 1rem 0.5rem !important;
        font-size: 0.9rem !important;
        text-align: center !important;
    }
    
    .trust-badge i,
    .highlight-item i {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }
    
    .cta-button,
    .hero-cta .button {
        width: 100% !important;
        margin: 0.5rem 0 !important;
        padding: 1rem !important;
        font-size: 1.1rem !important;
    }
}

/* ===== MOBILE SERVICES SECTION ===== */
@media screen and (max-width: 768px) {
    .services-section {
        padding: 3rem 0 !important;
    }
    
    .services-section .container {
        padding: 0 1rem !important;
    }
    
    .services-grid,
    .services-grid-five {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        max-width: 100% !important;
    }
    
    .service-card {
        width: 100% !important;
        margin: 0 !important;
        padding: 2rem 1.5rem !important;
        min-height: auto !important;
    }
    
    .service-card .service-icon {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .service-card h3 {
        font-size: 1.4rem !important;
        margin-bottom: 1rem !important;
    }
    
    .service-card .service-price {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        margin-bottom: 1rem !important;
    }
    
    .service-card p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
    
    /* Premium card special handling */
    .premium-card {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
        border: 2px solid #0066ff !important;
        position: relative !important;
    }
    
    .premium-badge-ribbon {
        position: absolute !important;
        top: -10px !important;
        right: 20px !important;
        background: #0066ff !important;
        color: white !important;
        padding: 0.5rem 1rem !important;
        border-radius: 4px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
    }
}

/* ===== MOBILE GALLERY SECTION ===== */
@media screen and (max-width: 768px) {
    .instagram-gallery-section,
    .gallery-section {
        padding: 3rem 0 !important;
    }
    
    .gallery-grid,
    .instagram-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        margin: 2rem 0 !important;
    }
    
    .gallery-item,
    .instagram-post {
        aspect-ratio: 1 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }
    
    .gallery-item img,
    .instagram-post img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .gallery-header {
        text-align: center !important;
        margin-bottom: 2rem !important;
    }
    
    .instagram-badge {
        margin-top: 1rem !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* ===== MOBILE TESTIMONIALS SECTION ===== */
@media screen and (max-width: 768px) {
    .testimonials-section {
        padding: 3rem 0 !important;
    }
    
    .testimonials-slider {
        min-height: 400px !important;
        margin: 2rem 0 !important;
    }
    
    .testimonial-card {
        padding: 2rem 1.5rem !important;
        margin: 0 0.5rem !important;
        min-height: 350px !important;
        max-height: 350px !important;
    }
    
    .testimonial-header {
        flex-direction: column !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
    }
    
    .reviewer-info {
        flex-direction: column !important;
        align-items: center !important;
        margin-bottom: 1rem !important;
    }
    
    .reviewer-avatar {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 0.5rem !important;
    }
    
    .testimonial-content p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        text-align: center !important;
    }
    
    .testimonial-nav {
        width: calc(100% + 40px) !important;
        left: -20px !important;
    }
    
    .prev-testimonial,
    .next-testimonial {
        width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
    }
    
    .testimonial-indicators {
        margin-top: 2rem !important;
        gap: 0.5rem !important;
    }
    
    .indicator {
        width: 12px !important;
        height: 12px !important;
    }
}

/* ===== MOBILE ABOUT SECTION ===== */
@media screen and (max-width: 768px) {
    .about-section {
        padding: 3rem 0 !important;
    }
    
    .about-flex {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .about-img-wrap {
        display: none !important;
    }
    
    .about-content {
        width: 100% !important;
        padding: 0 1rem !important;
        text-align: center !important;
    }
    
    .about-features {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        margin: 2rem 0 !important;
    }
    
    .feature-item {
        padding: 1.5rem !important;
        text-align: center !important;
    }
    
    .feature-icon {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }
}

/* ===== MOBILE FAQ SECTION ===== */
@media screen and (max-width: 768px) {
    .faq-preview-section,
    .faq-section {
        padding: 3rem 0 !important;
    }
    
    .faq-item {
        margin-bottom: 1rem !important;
    }
    
    .faq-question {
        padding: 1rem !important;
        font-size: 1rem !important;
    }
    
    .faq-question h4 {
        font-size: 1rem !important;
        padding-right: 2rem !important;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem 1rem !important;
    }
    
    .faq-answer p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
}

/* ===== MOBILE CONTACT SECTION ===== */
@media screen and (max-width: 768px) {
    .contact-section {
        padding: 3rem 0 !important;
    }
    
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .contact-card {
        padding: 2rem 1.5rem !important;
        text-align: center !important;
    }
    
    .contact-icon {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .social-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .social-link {
        width: 100% !important;
        padding: 1rem !important;
        justify-content: center !important;
    }
    
    .hours-list li {
        padding: 0.8rem 0 !important;
        font-size: 0.95rem !important;
    }
}

/* ===== MOBILE FOOTER ===== */
@media screen and (max-width: 768px) {
    .footer-section {
        padding: 2rem 0 1rem 0 !important;
    }
    
    .footer-inner {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.5rem !important;
    }
    
    .footer-logo-img {
        width: 24px !important;
        height: 24px !important;
    }
    
    .footer-brand {
        font-size: 0.9rem !important;
    }
    
    .footer-copyright {
        font-size: 0.8rem !important;
        margin-top: 0.5rem !important;
    }
    
    .footer-divider {
        display: none !important;
    }
}

/* ===== MOBILE FORMS AND INPUTS ===== */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
        border: 2px solid #ddd !important;
        margin-bottom: 1rem !important;
    }
    
    input:focus,
    textarea:focus,
    select:focus {
        border-color: #0066ff !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1) !important;
    }
}

/* ===== MOBILE UTILITIES ===== */
@media screen and (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-no-padding {
        padding: 0 !important;
    }
    
    .mobile-small-padding {
        padding: 0.5rem !important;
    }
    
    .mobile-medium-padding {
        padding: 1rem !important;
    }
    
    .mobile-large-padding {
        padding: 2rem !important;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media screen and (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    /* Reduce shadow complexity */
    .service-card,
    .testimonial-card,
    .contact-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
}

/* ===== VERY SMALL MOBILE DEVICES ===== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 0.5rem !important;
    }
    
    h1, .hero-title, .location-title {
        font-size: 1.8rem !important;
    }
    
    h2, .section-title {
        font-size: 1.6rem !important;
    }
    
    .trust-badges,
    .location-highlights {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .gallery-grid,
    .instagram-grid {
        grid-template-columns: 1fr !important;
    }
    
    .service-card {
        padding: 1.5rem 1rem !important;
    }
    
    .testimonial-card {
        padding: 1.5rem 1rem !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section,
    .location-hero {
        min-height: 90vh !important;
        padding: 2rem 0 !important;
    }
    
    .trust-badges,
    .location-highlights {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }
}
