@media (max-width: 768px) {

    /* === MOBILE OPTIMIZATIONS === */
    /* All styles below are mobile.only and do NOT affect desktop */

    /* --- RESET & GLOBAL OPTIMIZATIONS --- */
    body {
        overflow-x: hidden;
        width: 100%;
        -webkit-font-smoothing: antialiased;
        font-size: 16px;
    }

    /* Default section padding for mobile */
    section {
        padding: 40px 16px !important;
        /* Increased for better separation */
    }

    .services-hero {
        padding: 120px 16px 40px !important;
    }

    /* Adjust typography for readability - Reduced sizes for compact feel */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .services-hero h1 {
        font-family: 'Lato', sans-serif !important;
        font-size: 0.65rem !important;
        line-height: 1.2 !important;
        letter-spacing: 4px !important;
        text-transform: uppercase !important;
        color: #000 !important;
        margin-bottom: 10px !important;
    }

    h2 {
        font-size: 1.4rem !important;
        line-height: 1.35;
        margin-bottom: 10px;
        letter-spacing: 0.05em !important;
        /* Match desktop luxury feel */
        text-transform: uppercase !important;
    }

    h3 {
        font-size: 1.1rem !important;
        margin-bottom: 8px;
    }

    p {
        font-size: 0.95rem !important;
        line-height: 1.6;
        margin-bottom: 12px;
    }

    /* Increase touch targets for all interactive elements */
    button,
    .btn,
    .contact-cta-btn,
    input,
    select,
    textarea {
        min-height: 44px;
    }

    button,
    .btn,
    .contact-cta-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 16px !important;
        border-radius: 6px !important;
        font-weight: 600;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        padding: 10px 12px !important;
    }

    p a {
        display: inline;
        min-height: auto;
        padding: 0;
        transition: none;
    }

    /* EXTREME FORCE: Show cyan section dividers for mobile */
    .section-divider {
        display: block !important;
        visibility: visible !important;
        height: 1px !important;
        width: 100% !important;
        background-color: #00CED1 !important;
        /* Cyan background for maximum visibility */
        border: none !important;
        margin: 0 !important;
        /* Removed margin to eliminate empty space */
        opacity: 0.8 !important;
        clear: both !important;
        position: relative !important;
        z-index: 10 !important;
    }

    /* Thinner cyan divider only between contact and footer on mobile */
    .contact-footer-divider {
        height: 1px !important;
    }

    /* Remove border from footer-nav to prevent double lines */
    .footer-nav {
        border-top: none !important;
        padding: 40px 16px !important;
    }

    /* Reduce hero section logo size for mobile only */
    body .brand-logo-fixed,
    html body .brand-logo-fixed {
        top: 15px !important;
        left: 15px !important;
        z-index: 2004; /* Below menu toggle but above header */
    }

    body .brand-logo-fixed .logo,
    html body .brand-logo-fixed .logo {
        height: 28px !important;
        /* Shorter as requested */
        width: auto !important;
    }

    /* --- NAVIGATION: DRAWER MENU --- */
    .navbar {
        height: 60px !important;
        background: transparent !important; /* Removed 'white box' as requested */
        backdrop-filter: none !important;
        border-bottom: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important; /* Push toggle to the right */
        padding: 0 10px !important;
        pointer-events: none; /* Let clicks pass through */
    }

    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        position: relative; /* Sit inside the flex navbar */
        z-index: 2005; 
        background: transparent !important;
        border: none !important;
        width: 48px !important; /* Standard touch target 44-48px */
        height: 48px !important;
        cursor: pointer !important;
        pointer-events: auto !important; /* Catch the clicks! */
        margin-right: 5px;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 24px !important;
        /* Slightly wider for visibility */
        height: 2px;
        background-color: #D4AF37;
        transform-origin: center;
        transition: transform 0.2s ease, opacity 0.2s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        /* Shadow for visibility against light backgrounds */
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .navbar nav {
        display: none;
    }

    .mobile-menu.brand-right {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #0F0F0F;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        padding: 20px;
        z-index: 2001;
        display: none !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .mobile-menu.active {
        display: flex !important;
        opacity: 1;
        pointer-events: auto;
    }

    /* Fix breadcrumb overlapping */
    .breadcrumb {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        text-align: left !important;
        margin-bottom: 15px !important;
        gap: 5px !important;
    }

    .breadcrumb a, .breadcrumb span {
        font-size: 0.75rem !important;
    }

}

@media (max-width: 768px) {
    /* --- SERVICES LIGHTBOX (CRITICAL FIX) --- */
    .service-lightbox button,
    .gallery-lightbox button,
    .lightbox-nav {
        width: 48px !important;
        height: 48px !important;
        background: rgba(0, 0, 0, 0.6) !important;
        border-radius: 50%;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute !important;
        z-index: 10010 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .service-lightbox .lightbox-prev,
    .gallery-lightbox .lightbox-prev {
        left: 10px !important;
        right: auto !important;
    }

    .service-lightbox .lightbox-next,
    .gallery-lightbox .lightbox-next {
        right: 10px !important;
        left: auto !important;
    }

    .service-lightbox .lightbox-close,
    .gallery-lightbox .lightbox-close {
        top: 20px !important;
        right: 20px !important;
        transform: none !important;
        background: transparent !important;
        border: none !important;
        width: auto !important;
        height: auto !important;
    }
}

@media (max-width: 768px) {
    /* --- FOOTER (2-COLUMN GRID) --- */
    .footer-nav {
        padding: 30px 16px !important;
    }

    .footer-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 30px 15px !important;
        text-align: left !important;
        width: 100% !important;
    }

    .footer-brand {
        grid-column: span 2 !important;
        text-align: center !important;
        margin-bottom: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .footer-brand .logo {
        height: 30px !important;
        width: auto !important;
        margin: 0 auto 15px auto !important;
        display: block !important;
    }

    .footer-links:nth-of-type(2),
    .footer-links:nth-of-type(3) {
        grid-column: span 1 !important;
    }

    .footer-links:nth-of-type(4) {
        grid-column: span 2 !important;
        width: 100% !important;
    }

    .contact-item {
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .contact-icon {
        margin-top: 0 !important;
        /* Balanced for mobile alignment */
        flex-shrink: 0 !important;
    }

    .footer-social {
        display: flex;
        justify-content: center;
        margin-top: 20px !important;
        padding-top: 20px;
        border-top: none !important;
        /* Removed grey line between email and social icons */
        width: 100%;
    }

}

@media (max-width: 768px) {
    /* --- PERFORMANCE OPTIMIZATIONS --- */

    /* Reduce heavy animations on mobile to prevent jitter */
    .hero-bg-layer img {
        filter: blur(15px) brightness(0.3) !important;
        animation: none !important;
    }

    .hero-main-layer img {
        animation: none !important;
    }

    /* Reduce motion for better performance */
    @media (prefers-reduced-motion: reduce) {

        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* HERO SLIDE TEXT MOBILE-ONLY */
    .hero-content {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
        position: absolute !important;
        inset: 0 !important;
        height: 100% !important;
        width: 100% !important;
        z-index: 100 !important;
        pointer-events: none !important;
        background: transparent !important;
    }

    .hero-text {
        max-width: 90% !important;
        padding: 0 20px 80px !important;
        /* Use padding for positioning inside absolute container */
        text-align: left !important;
        position: relative !important;
        display: block !important;
        opacity: 0 !important;
        /* Start invisible for script logic */
        visibility: visible !important;
        z-index: 110 !important;
        pointer-events: auto !important;
        transform: none !important;
        transition: opacity 1.5s ease-in-out !important;
        /* Standard transition */
    }

    .hero-text.visible {
        opacity: 1 !important;
    }

    .hero-text.hidden {
        opacity: 0 !important;
    }

    .hero-title {
        font-size: 1.4rem !important;
        /* Larger for mobile visibility */
        line-height: 1.2 !important;
        font-weight: 700 !important;
        margin: 0 !important;
        text-align: left !important;
        width: 100% !important;
        color: #ffffff !important;
        display: block !important;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
    }

    .hero-title span {
        display: block !important;
        text-align: left !important;
        width: 100% !important;
    }

    .gold-segment {
        margin-bottom: 2px !important;
    }

    .cyan-segment {
        color: var(--brand-cyan) !important;
    }

    .hero-subtitle {
        display: none !important;
    }

    /* Mastery page - strength section images after headline (step 9) */
    .strengths-section,
    .strengths-container {
        display: flex !important;
        flex-direction: column !important;
    }

    .strengths-images {
        order: 1 !important;
        margin-top: 20px !important;
    }

    .strengths-content {
        order: 0 !important;
    }

}

@media (max-width: 768px) {
    /* --- SECTION TITLE STANDARDIZATION --- */

    .section-title,
    .section h2 {
        font-size: 1.6rem !important;
        line-height: 1.2 !important;
        letter-spacing: -0.01em !important;
        text-transform: none !important;
        text-rendering: optimizeLegibility !important;
        font-kerning: normal !important;
    }

    /* --- WHATSAPP BUTTON MOBILE --- */

    .whatsapp {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 16px !important;
    }

    .whatsapp img {
        width: 100% !important;
        height: 100% !important;
        padding: 10px !important;
    }

    /* --- LIGHTBOX MOBILE OPTIMIZATION --- */

    #serviceLightbox,
    .service-lightbox {
        padding: 60px 16px !important;
    }

    .lightbox-image {
        max-height: 60vh !important;
        border-radius: 8px !important;
    }

    .lightbox-caption {
        font-size: 0.85rem !important;
        padding: 16px !important;
        bottom: 80px !important;
    }

    /* --- UTILITY CLASSES FOR MOBILE --- */

    .mobile-hidden {
        display: none !important;
    }

    .mobile-visible {
        display: block !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-full-width {
        width: 100% !important;
        max-width: 100% !important;
    }

}

@media (max-width: 768px) {
    /* --- SAFE AREA INSETS (iPhone X+) --- */

    @supports (padding: max(0px)) {

        .navbar,
        .mobile-menu {
            padding-left: max(20px, env(safe-area-inset-left)) !important;
            padding-right: max(20px, env(safe-area-inset-right)) !important;
        }

        .footer-nav {
            padding-bottom: max(30px, env(safe-area-inset-bottom)) !important;
        }

        .whatsapp {
            bottom: max(20px, env(safe-area-inset-bottom)) !important;
        }
    }

    /* --- LANDSCAPE ORIENTATION OPTIMIZATIONS --- */

    @media (max-width: 768px) and (orientation: landscape) {
        .hero {
            height: 100vh !important;
            min-height: 300px !important;
        }

        .hero-content {
            padding-bottom: 60px !important;
        }

        .mobile-menu {
            justify-content: flex-start !important;
            padding-top: 80px !important;
        }

        .mobile-menu a {
            font-size: 1.1rem !important;
            padding: 8px 0 !important;
        }

        .video-section.video-showcase {
            height: 70vh !important;
        }

        .service-images img {
            width: 180px !important;
            height: 120px !important;
        }
    }

    /* --- TOUCH DEVICE OPTIMIZATIONS --- */

    @media (hover: none) and (pointer: coarse) {

        /* Remove hover effects on touch devices */
        .service-card:hover,
        .reference-item:hover,
        .client-item:hover {
            transform: none !important;
        }

        /* Ensure tap highlights are visible */
        a,
        button {
            -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
        }

        /* Larger touch targets for form elements */
        input,
        textarea,
        select,
        button {
            min-height: 48px;
        }
    }

    /* --- DARK MODE SUPPORT (if needed in future) --- */

    @media (prefers-color-scheme: dark) {
        /* Mobile dark mode adjustments would go here */
        /* Currently site uses light theme primarily */
    }
}

