/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   UNIT 365 — Navigation Premium Layer  v1
   Scope: desktop shop dropdown + mobile drawer ONLY.
   Loaded last on index.html (after typography-premium.css).
   No new sections · no new links · no JS logic changes.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ─── 1. Tokens ──────────────────────────────────────────── */
:root {
  --nav-hair: #e2e5e9;    /* shared hairline color for nav elements  */
  --nav-ink:  #111518;    /* darkest text / icon color               */
  --nav-sub:  #7d8590;    /* muted / secondary color                 */
}

/* ═══════════════════════════════════════════════════════════
   2. DESKTOP HAMBURGER (860–1024px tablet range)
   The base CSS shows a bordered, rounded button at this range.
   A flat icon is the premium standard.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .menu-btn {
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   3. DESKTOP SHOP DROPDOWN
   Changes:
   • Position flush with toggle left edge (was -10px)
   • Slightly narrower panel for 4 short items
   • Softer, more focused shadow
   • Remove padding-left hover animation (dated Bootstrap pattern)
     → replaced with clean color-only hover
   ═══════════════════════════════════════════════════════════ */

/* Panel */
.shop-dropdown__menu {
  left: 0;                /* was -10px — flush with toggle text */
  min-width: 188px;       /* was 220px — better proportion for 4 items */
  top: calc(100% + 8px);
  padding: 3px 0;
  border-color: var(--nav-hair);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.07),
    0 2px 6px  rgba(0, 0, 0, 0.04),
    0 0 0 1px  rgba(0, 0, 0, 0.03);
}

/* Items — lock out the padding-left indent pattern */
.shop-dropdown__menu a {
  padding: 12px 16px !important;
  border-top-color: var(--nav-hair) !important;
  transition: background 0.13s ease, color 0.13s ease !important;
}

/* Hover: clean color change only — NO left indent */
.shop-dropdown__menu a:hover,
.shop-dropdown__menu a:focus-visible {
  background: #f5f6f8 !important;
  color: var(--nav-ink) !important;
  padding-left: 16px !important;   /* lock at base — no indent shift */
}

/* Current-page indicator: matches hover state */
.shop-dropdown__menu a.is-current {
  background: #f3f4f6 !important;
  color: var(--nav-ink) !important;
  padding-left: 16px !important;   /* lock — no indent */
}

/* ═══════════════════════════════════════════════════════════
   4. MOBILE DRAWER — panel
   Changes:
   • Narrower: min(80vw, 340px) — page is visible behind (premium)
   • Top padding creates a clean header zone for the close button
   • Side padding: 20px (slightly more than 18px base)
   • gap: 0 — borders are the separators, not flex gap
   • Slightly off-white bg (#fcfcfc) for subtle panel depth
   • Lighter left border
   ═══════════════════════════════════════════════════════════ */
.drawer {
  width: min(80vw, 340px);
  padding-top: calc(env(safe-area-inset-top) + 64px);
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 30px;
  gap: 0;
  background: #fcfcfc;
  border-left-color: #dce0e4;
}

/* ═══════════════════════════════════════════════════════════
   5. DRAWER CLOSE BUTTON
   Absolutely positioned in the top-right header zone.
   CSS-drawn × — two thin lines, no character rendering quirks.
   ═══════════════════════════════════════════════════════════ */
.drawer-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 16px);
  right: 18px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #8e959e;
  transition: color 0.15s ease;
  z-index: 1;
  flex-shrink: 0;
}

/* CSS-drawn × — two thin diagonal lines */
.drawer-close::before,
.drawer-close::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}

.drawer-close::before { transform: rotate(45deg);  }
.drawer-close::after  { transform: rotate(-45deg); }

.drawer-close:hover { color: var(--nav-ink); }

.drawer-close:focus-visible {
  outline: 2px solid var(--nav-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   6. DRAWER LINK ROWS — direct <a> children
   • Remove the 2px horizontal padding — container handles it
   • Slightly more vertical breathing room (13px vs 10px)
   • Standardize border color to --nav-hair
   ═══════════════════════════════════════════════════════════ */
.drawer > a {
  padding-top: 13px;
  padding-bottom: 13px;
  padding-left: 0;
  padding-right: 0;
  min-height: 52px;
  border-bottom-color: var(--nav-hair);
}

/* Community link: ensure no top border (group border-bottom above it) */
.drawer > a:first-of-type {
  border-top: none !important;
}

/* ═══════════════════════════════════════════════════════════
   7. DRAWER SHOP GROUP (details/summary accordion)
   • Standardize border color
   • Match link row spacing rhythm
   ═══════════════════════════════════════════════════════════ */
.drawer .drawer-group {
  border-top-color:    var(--nav-hair);
  border-bottom-color: var(--nav-hair);
}

.drawer .drawer-group summary {
  padding-top: 13px;
  padding-bottom: 13px;
  padding-left: 0;
  padding-right: 0;
  min-height: 52px;
}

/* Chevron: match --nav-sub */
.drawer .drawer-group summary::after {
  border-color: var(--nav-sub);
}

.drawer .drawer-group[open] summary::after {
  border-color: var(--nav-ink);
}

/* ═══════════════════════════════════════════════════════════
   8. DRAWER SUBMENU (nested Shop categories)
   • Standardize border color
   • Maintain left indent to signal sub-navigation
   ═══════════════════════════════════════════════════════════ */
.drawer .drawer-submenu {
  padding-bottom: 10px;
}

.drawer .drawer-submenu a {
  min-height: 42px !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border-top-color: var(--nav-hair) !important;
}

/* ═══════════════════════════════════════════════════════════
   9. ACCESSIBILITY — focus states
   Keyboard-navigable with visible, precise focus rings.
   ═══════════════════════════════════════════════════════════ */
.drawer > a:focus-visible,
.drawer .drawer-group summary:focus-visible {
  outline: 2px solid var(--nav-ink);
  outline-offset: -2px;
  border-radius: 1px;
}

.shop-dropdown__menu a:focus-visible {
  outline: 2px solid var(--nav-ink) !important;
  outline-offset: -3px;
}

/* ═══════════════════════════════════════════════════════════
   10. RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════ */

/* Tablet (768px): slightly wider panel */
@media (min-width: 701px) and (max-width: 1024px) {
  .drawer {
    width: min(70vw, 360px);
  }
}

/* Large phones (420–700px): tighten top zone slightly */
@media (max-width: 700px) {
  .drawer {
    padding-top: calc(env(safe-area-inset-top) + 60px);
  }

  .drawer-close {
    top: calc(env(safe-area-inset-top) + 14px);
  }
}

/* Small phones (≤420px): proportional adjustments */
@media (max-width: 420px) {
  .drawer {
    width: min(84vw, 320px);
    padding-top: calc(env(safe-area-inset-top) + 56px);
    padding-left: 16px;
    padding-right: 16px;
  }

  .drawer-close {
    right: 14px;
    top: calc(env(safe-area-inset-top) + 12px);
  }

  .drawer > a,
  .drawer .drawer-group summary {
    min-height: 48px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
}

/* ═══════════════════════════════════════════════════════════
   11. REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .drawer-close,
  .drawer-close::before,
  .drawer-close::after,
  .shop-dropdown__menu a {
    transition: none !important;
  }
}
