/* ==========================================================
   VISUAL GO — PREMIUM MOBILE HEADER SYSTEM
   Mobile-first, two-level, app-grade navigation
   ========================================================== */

/* ── Top Bar Mobile Overrides ──────────────────────────── */
@media (max-width: 1024px) {

    /* Hide legacy desktop top bar elements */
    .top-bar .top-right-menu {
        display: none;
    }

    /* Slim down the top bar and reformat for mobile */
    .top-bar {
        padding: 0;
        background: #01161a;
    }

    .top-bar .container {
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.25rem;
        gap: 0.75rem;
    }

    .top-info {
        height: 32px;
        gap: 0.5rem;
        align-items: center;
    }

    /* Phone number link */
    .top-info a {
        font-size: 0.56rem;
        font-weight: 600;
        color: #52A300;
        letter-spacing: -0.01em;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

    /* Separator and label */
    .top-info span {
        display: none;
    }

    /* Top bar CTA pill */
    .top-bar-cta-mobile {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.2rem 0.6rem;
        background: #52A300;
        color: #fff;
        font-size: 0.5rem;
        font-weight: 700;
        border-radius: 99px;
        text-decoration: none;
        letter-spacing: -0.01em;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background 0.2s ease, transform 0.15s ease;
    }
    .top-bar-cta-mobile:hover {
        background: #478c00;
        transform: scale(1.03);
    }

    /* ── Main Header ───────────────────────────────────── */
    header {
        position: sticky;
        top: 0;
        z-index: 2000;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    }

    /* Make the top-bar part of the sticky header */
    .top-bar {
        position: relative;
        z-index: 2001;
    }

    .header-main {
        padding: 0.5rem 0;
    }

    .header-main .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.25rem;
    }

    /* Logo - controlled size */
    .logo img {
        height: 52px;
        width: auto;
    }

    /* Hide desktop nav elements */
    .nav-links,
    .nav-cta {
        display: none !important;
    }

    /* ── Hamburger Button ──────────────────────────────── */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end; /* Asymmetric right-alignment */
        gap: 6px;
        width: 32px;
        height: 32px;
        background: transparent !important;
        border: none !important;
        cursor: pointer;
        padding: 0;
        transition: transform 0.3s ease;
        position: relative;
        z-index: 2100;
        flex-shrink: 0;
    }

    .mobile-menu-btn span {
        display: block;
        height: 2px;
        background: #111827;
        border-radius: 0;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        transform-origin: center right;
    }

    /* Variable widths for premium asymmetric look */
    .mobile-menu-btn span:nth-child(1) { width: 24px; }
    .mobile-menu-btn span:nth-child(2) { width: 16px; }
    .mobile-menu-btn span:nth-child(3) { width: 24px; }

    /* Premium X Animation */
    .mobile-menu-btn.is-open span:nth-child(1) {
        width: 24px;
        transform: translateY(8px) rotate(-45deg);
    }
    .mobile-menu-btn.is-open span:nth-child(2) {
        opacity: 0;
        width: 0;
    }
    .mobile-menu-btn.is-open span:nth-child(3) {
        width: 24px;
        transform: translateY(-8px) rotate(45deg);
    }

    /* ── Scroll Animation System (Liquid Flow) ──────────────────────── */
    .header {
        transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
        background: #fff;
    }

    .header-main {
        transition: padding 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    }

    .top-bar {
        transition: height 0.6s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease;
        overflow: hidden;
    }

    /* Shrink the entire container - Forced Slim Height */
    .header.is-scrolled .header-main {
        height: 42px !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
    }

    .header.is-scrolled .top-bar {
        height: 0 !important;
        opacity: 0 !important;
        pointer-events: none;
    }

    .logo img, .header-badge-mobile, .mobile-menu-btn {
        transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1) !important;
    }

    .header.is-scrolled .logo img {
        height: 26px !important; /* Exactly 50% of 52px */
    }

    .header.is-scrolled .header-badge-mobile {
        height: 39px !important; /* Exactly 50% of 78px */
    }

    .header.is-scrolled .mobile-menu-btn {
        transform: scale(0.6) !important; /* Compact and clean */
        margin-right: -4px;
    }

    /* ── Overlay ───────────────────────────────────────── */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(1, 22, 26, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 2050;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .mobile-nav-overlay.is-open {
        opacity: 1;
        pointer-events: all;
    }

    /* ── Mobile Nav Drawer ─────────────────────────────── */
    .mobile-nav-drawer {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px; /* Refined right-side sidebar */
        height: 100%;
        height: 100dvh;
        background: #fff;
        z-index: 2100;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
        box-shadow: -15px 0 50px rgba(1,22,26,0.2);
        overflow: hidden;
        border-radius: 0;
        border: none;
    }
    
    .mobile-nav-drawer.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
    }

    /* Drawer Header */
    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.85rem 1.5rem; /* Compressed */
        border-bottom: none;
        background: #fff;
        flex-shrink: 0;
    }

    .drawer-logo img {
        height: 48px;
        width: auto;
    }

    .drawer-close {
        width: 30px; /* Reduced from 36px */
        height: 30px; /* Reduced from 36px */
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid #e5e7eb;
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
        color: #64748b;
        font-size: 1rem; /* Smaller font */
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .drawer-close:hover {
        border-color: #52A300;
        color: #52A300;
        background: #f0f7f0;
    }

    /* Drawer Contact Strip */
    .drawer-contact-strip {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.5rem 1.5rem; /* Compressed */
        background: #f8fafc;
        border-bottom: none;
        flex-shrink: 0;
    }

    .drawer-contact-strip svg {
        color: #52A300;
        flex-shrink: 0;
    }

    .drawer-contact-strip a {
        font-size: 0.825rem;
        font-weight: 600;
        color: #111827;
        text-decoration: none;
    }

    .drawer-contact-strip span {
        font-size: 0.75rem;
        color: #94a3b8;
        margin-left: auto;
    }

    /* Drawer Scrollable Nav */
    .drawer-nav {
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
    }

    /* Top-level nav items */
    .drawer-nav-item {
        display: block;
    }

    .drawer-nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.65rem 1.5rem; /* Compressed spacing */
        font-size: 0.875rem; /* Reduced font */
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        color: #111827;
        text-decoration: none;
        border-bottom: none;
        transition: background 0.15s ease, color 0.15s ease;
        cursor: pointer;
        background: transparent;
        border: none;
        width: 100%;
        text-align: left;
        letter-spacing: -0.01em;
    }

    .drawer-nav-link:hover,
    .drawer-nav-link:focus {
        background: #f0f7f0;
        color: #52A300;
        outline: none;
    }

    .drawer-nav-link.has-children {
        border-bottom: none;
    }

    /* Chevron icon */
    .drawer-nav-link .nav-chevron {
        width: 18px;
        height: 18px;
        color: #94a3b8;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
        flex-shrink: 0;
    }

    .drawer-nav-item.is-open > .drawer-nav-link .nav-chevron {
        transform: rotate(180deg);
        color: #52A300;
    }

    /* Submenu accordion */
    .drawer-submenu {
        max-height: 0;
        overflow: hidden;
        background: #f8fafc;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .drawer-nav-item.is-open > .drawer-submenu {
        max-height: 400px;
    }

    .drawer-submenu-link {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.5rem 1.5rem 0.5rem 2.5rem; /* Compressed spacing */
        font-size: 0.75rem; /* Reduced font */
        font-weight: 500;
        color: #475569;
        text-decoration: none;
        border-bottom: none;
        transition: background 0.15s ease, color 0.15s ease, padding 0.15s ease;
    }

    .drawer-submenu-link:last-child {
        border-bottom: none;
    }

    .drawer-submenu-link::before {
        content: '';
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #cbd5e1;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }

    .drawer-submenu-link:hover {
        background: #e8f5e9;
        color: #52A300;
        padding-left: 2.5rem;
    }

    .drawer-submenu-link:hover::before {
        background: #52A300;
    }

    /* Single link items (no submenu) */
    .drawer-nav-link.no-children {
        border-bottom: none;
    }

    /* Section divider */
    .drawer-divider {
        height: 1px;
        background: #e5e7eb;
        margin: 0.5rem 1.25rem;
    }

    /* Drawer Footer CTA */
    .drawer-footer {
        padding: 1rem 1.5rem; /* Compressed */
        border-top: none;
        background: #fff;
        flex-shrink: 0;
        text-align: center;
    }

    .drawer-badge {
        display: block;
        height: 90px; /* Increased by 50% for prominence */
        width: auto;
        margin: 0 auto 1rem;
        filter: drop-shadow(0 4px 12px rgba(0,0,0,0.06));
    }

    .drawer-footer-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.75rem 1.25rem; /* More compact */
        background: #52A300;
        color: #fff;
        font-family: 'Inter', sans-serif;
        font-size: 0.75rem; /* Reduced from 0.9rem */
        font-weight: 700;
        border-radius: 12px;
        text-decoration: none;
        letter-spacing: -0.01em;
        transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
        box-shadow: 0 4px 16px rgba(82, 163, 0, 0.25);
    }

    .drawer-footer-cta:hover {
        background: #478c00;
        transform: translateY(-1px);
        box-shadow: 0 8px 24px rgba(82, 163, 0, 0.35);
    }

    .drawer-footer-cta svg {
        margin-left: 0.5rem;
        transition: transform 0.2s ease;
    }

    .drawer-footer-cta:hover svg {
        transform: translateX(3px);
    }

    /* ── Body lock when menu is open ──────────────────── */
    body.nav-open {
        overflow: hidden;
    }
}

/* Desktop: hide the mobile-only elements */
@media (min-width: 1025px) {
    .mobile-nav-overlay,
    .mobile-nav-drawer,
    .top-bar-cta-mobile {
        display: none !important;
    }

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