/* =============================================================
   VALHALLA PEPTIDES — Mobile Nav Additive Overrides (Phase Mobile Nav)
   Date: 2026-05-25
   Scope: Additive overrides for the existing CC#2 Block C drawer.

   Additive only — keeps existing structure & classnames:
   - Hamburger 32×32 → 44×44 (WCAG 2.5.5)
   - Breakpoint ≤768 → ≤1024 (tablets now also get drawer UX)
   - Adds drawer-head (logo + close button) and drawer-foot styling
   - Body scroll lock decoupled from media query

   Loaded by inc/mobile-nav.php @ priority 1001 — cascades AFTER
   header.css (inline in vp-header.php) and mobile-optimizations.css.
   Color tokens (#D4AF37) match existing theme; do NOT switch to
   #C9A055 (separate Phase 5 design-system audit task).
   ============================================================= */

/* ============================================================
   Body scroll lock — runs at any breakpoint where drawer is open.
   Existing CSS scoped this to ≤768; lift to global so ≤1024 also
   locks scroll once hamburger drawer engages.
   ============================================================ */
body.vp-mobile-menu-open {
  overflow: hidden !important;
  touch-action: none;
}

/* ============================================================
   Tablet (769–1024px) — was: hamburger hidden, desktop nav visible.
   New: hamburger visible, desktop nav hidden — same as ≤768 mobile.
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Show hamburger (existing block at this breakpoint hid it) */
  .vp-hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 1001;
  }

  .vp-hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #D4AF37;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .vp-hamburger[aria-expanded="true"] .vp-hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .vp-hamburger[aria-expanded="true"] .vp-hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .vp-hamburger[aria-expanded="true"] .vp-hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Hide desktop horizontal nav + any open mega panel */
  .vp-nav,
  .vp-mega-wrap > .vp-mega {
    display: none !important;
  }

  /* Drawer (slide from right) — same as ≤768 baseline */
  .vp-mobile-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    background: #0A0A0A;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    z-index: 1000;
    transition: right 0.35s ease;
    overflow-y: auto;
    padding: 0 !important;
  }
  .vp-mobile-drawer.vp-mobile-drawer-open {
    right: 0;
  }

  .vp-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
  }
  body.vp-mobile-menu-open .vp-mobile-backdrop {
    display: block;
  }
}

/* ============================================================
   Mobile (≤1024px) — touch target 44×44 enforcement + drawer
   structural layout for new head/foot sections.
   Applies on top of existing ≤768 block (mobile) AND the new
   ≤769-1024 block above (tablet).
   ============================================================ */
@media (max-width: 1024px) {
  /* Hamburger touch target 44×44 (was 32×32 at ≤768) */
  .vp-hamburger {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
  }

  /* Drawer: column flex so head / nav / foot stack with nav flexing */
  .vp-mobile-drawer {
    display: flex !important;
    flex-direction: column;
    padding: 0 !important;
  }

  /* === Drawer head (NEW) ============================================= */
  .vp-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
  }
  .vp-mobile-logo {
    font-family: 'Fraunces', serif;
    font-size: 15px;
    letter-spacing: 1.8px;
    color: #D4AF37;
    text-decoration: none;
    text-transform: uppercase;
    line-height: 1;
  }
  .vp-mobile-logo:hover,
  .vp-mobile-logo:focus {
    color: #E8C766;
  }
  .vp-mobile-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: 0;
    color: #D4AF37;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin-right: -10px; /* visual alignment with drawer edge */
    transition: color 0.2s ease;
  }
  .vp-mobile-close:hover,
  .vp-mobile-close:focus {
    color: #E8C766;
  }

  /* === Drawer nav (existing — re-pad now that drawer pad reset) ====== */
  .vp-mobile-nav {
    flex: 1;
    padding: 12px 20px !important;
    min-height: 0; /* allow shrink in flex column */
  }

  /* === Drawer foot (NEW) ============================================= */
  .vp-mobile-drawer-foot {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
  }
  .vp-mobile-age {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: #8A8076;
    text-transform: uppercase;
    line-height: 1.4;
  }
}
