/* ========================================
   MOBILE MENU — Drawer pattern
   Breakpoint: 991px and below
   ======================================== */

/* ── Toggle Button ──────────────────────── */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    z-index: 101;
}

.menu-toggle .bar {
    width: 26px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

body.drawer-open .menu-toggle .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

body.drawer-open .menu-toggle .bar:nth-child(2) {
    opacity: 0;
}

body.drawer-open .menu-toggle .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ── Overlay ────────────────────────────── */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.drawer-open .menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ── Drawer Panel ───────────────────────── */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100vw;
    width: 85vw;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #1B2838 0%, #152030 100%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.drawer-open .mobile-drawer {
    right: 0;
}

/* ── Drawer Header ──────────────────────── */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.drawer-logo {
    max-height: 36px;
    width: auto;
}

.drawer-close {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ── Nav Links ──────────────────────────── */
.drawer-links {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    flex: 1;
}

.drawer-links > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer-links > li > a,
.drawer-links > li > button.child-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 24px;
    color: #fff;
    text-decoration: none;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.drawer-links > li > a:active,
.drawer-links > li > button.child-toggle:active {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Submenu ────────────────────────────── */
.toggle-arrow {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.toggle-arrow.open {
    transform: rotate(180deg);
}

.child-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.child-menu li a {
    display: block;
    padding: 15px 24px 15px 44px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.child-menu li a:active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding-left: 48px;
}

/* ── Drawer Footer ──────────────────────── */
.drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.drawer-cta {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 12px;
    text-align: center;
}

.drawer-cta-btn {
    display: block;
    background: #D5102B;
    color: #fff;
    text-decoration: none;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

/* ── Scroll Lock ────────────────────────── */
body.drawer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ── Breakpoints ────────────────────────── */
/* Show drawer toggle below 992px */
@media (max-width: 991px) {
    .menu-toggle {
        display: flex;
    }
    /* Hide desktop nav */
    .nav-menu {
        display: none !important;
    }
}

/* Hide drawer on desktop */
@media (min-width: 992px) {
    .mobile-drawer,
    .menu-overlay,
    .menu-toggle {
        display: none !important;
    }
}

/* ── Safe Areas ─────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-drawer {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .drawer-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}
