/* ==========================================================
   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: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        background: transparent;
        border: 1.5px solid #e5e7eb;
        border-radius: 10px;
        cursor: pointer;
        padding: 0;
        transition: border-color 0.2s ease, background 0.2s ease;
        position: relative;
        z-index: 2100;
        flex-shrink: 0;
    }

    .mobile-menu-btn:hover {
        border-color: #52A300;
        background: #f0f7f0;
    }

    .mobile-menu-btn span {
        display: block;
        width: 18px;
        height: 2px;
        background: #111827;
        border-radius: 2px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.2s ease,
                    width 0.25s ease;
        transform-origin: center;
    }

    /* Hamburger → X animation */
    .mobile-menu-btn.is-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-btn.is-open span:nth-child(2) {
        opacity: 0;
        width: 0;
    }
    .mobile-menu-btn.is-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ── 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: min(340px, 88vw);
        height: 100%;
        height: 100dvh;
        background: #fff;
        z-index: 2100;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -12px 0 40px rgba(1,22,26,0.18);
        overflow: hidden;
    }

    .mobile-nav-drawer.is-open {
        transform: translateX(0);
    }

    /* Drawer Header */
    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid #f1f5f9;
        background: #fff;
        flex-shrink: 0;
    }

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

    .drawer-close {
        width: 36px;
        height: 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: 1.2rem;
        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.75rem 1.25rem;
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
        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.95rem 1.25rem;
        font-size: 0.95rem;
        font-weight: 600;
        font-family: 'Inter', sans-serif;
        color: #111827;
        text-decoration: none;
        border-bottom: 1px solid #f1f5f9;
        transition: background 0.15s ease, color 0.15s ease;
        cursor: pointer;
        background: transparent;
        border-left: none;
        border-right: none;
        border-top: 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: 1px solid #f1f5f9;
    }

    /* 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.8rem 1.25rem 0.8rem 2.25rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: #475569;
        text-decoration: none;
        border-bottom: 1px solid #e9eef3;
        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: 1px solid #f1f5f9;
    }

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

    /* Drawer Footer CTA */
    .drawer-footer {
        padding: 1rem 1.25rem;
        border-top: 1px solid #e5e7eb;
        background: #fff;
        flex-shrink: 0;
    }

    .drawer-footer-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.95rem 1.5rem;
        background: #52A300;
        color: #fff;
        font-family: 'Inter', sans-serif;
        font-size: 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;
    }
}
