/* ============================================================
   VAULT — standalone mobile H5 stylesheet
   Loaded from header.php AFTER wp_head()/main.css.

   DO NOT MERGE THIS FILE INTO main.css. On 2026-11-07 commit 23c08b2
   a parallel task wrote main.css back from an older snapshot and wiped
   the whole mobile block below (194 lines). Keeping it separate means
   future main.css edits can never remove it again.
   Restored 2026-11-08. Sections 6 = product detail first screen,
   8 = header search, 9 = drawer.
   ============================================================ */

/* ── 6. Product detail: the first screen must show the title ──────
   At 390x844 the <h1> started at y=844 — exactly one pixel below the
   fold. Four empty bands stacked up to that: 40px page-header padding
   above the breadcrumb, 40px section padding, a 1:1 gallery pinned to
   the full column width, and 172px of 80px thumbnails wrapping onto two
   rows. Desktop (>=521px) keeps the 1:1 gallery. */
@media (max-width: 520px) {
  .page-header { padding: 10px 0 8px; }
  /* The 90-character product name was pushed onto a second line by
     flex-wrap + display:block, costing another 30px. One row, truncated. */
  .breadcrumb {
    font-size: 0.72rem;
    gap: 6px;
    line-height: 1.25;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
  }
  .breadcrumb a,
  .breadcrumb-sep { white-space: nowrap; }
  .breadcrumb > span:last-child {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  .single-product-section { padding: 12px 0 64px; }
  /* A nowrap thumb strip raises the track's min-content width and the
     grid grew to 400px. minmax(0,1fr) lets it shrink again. */
  .product-layout {
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
  }
  .product-gallery { min-width: 0; }
  .product-gallery { margin-top: 0; }

  .gallery-main {
    aspect-ratio: auto;
    height: 300px;
    margin-bottom: 10px;
  }
  .gallery-main img { padding: 12px; }
  .gallery-thumbs {
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .gallery-thumbs::-webkit-scrollbar { display: none; }
  .gallery-thumb {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
  }

  .product-title {
    font-size: 1.05rem;
    line-height: 1.32;
    margin-bottom: 8px;
  }
  .product-price-row { margin-bottom: 14px; }
  .product-price { font-size: 1.75rem; }
  .product-price del { font-size: 1.05rem; margin-right: 8px; }
}


/* ============================================================
   8. Header search — always-visible icon + panel (2026-11-08)
   On <=1100px the desktop inline search is hidden, so search used to
   exist only inside the drawer. Now the icon is always in the header.
   ============================================================ */
.header-actions .header-search-toggle { display: none; }

@media (max-width: 1100px) {
  .header-actions .header-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--accent, #CBF631);
    color: #000;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }
  .header-actions .header-search-toggle[aria-expanded="true"] { background: #D8F85E; }
  /* The account entry already lives in the drawer footer. Freeing this
     slot keeps logo + search + cart + menu inside 320px. */
  .header-actions .header-account-btn { display: none; }
}

.header-search-panel {
  display: none;
  position: fixed;
  top: var(--fpf-header-h, 72px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  background: var(--bg-primary, #0B0B0D);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px 20px 32px;
}
.header-search-panel.is-open { display: block; }

.header-search-panel-label,
.header-search-tags-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted, #5A5A66);
}
.header-search-form { display: flex; gap: 8px; margin-top: 14px; }
.header-search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary, #EDEDED);
  background: var(--bg-input, #131318);
  border: 1px solid var(--accent, #CBF631);
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.header-search-form input[type="search"]::placeholder { color: var(--text-muted, #5A5A66); }
.header-search-form input[type="search"]::-webkit-search-cancel-button,
.header-search-form input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.header-search-cancel {
  flex: 0 0 64px;
  height: 48px;
  border: 1px solid var(--border-color, rgba(255,255,255,.18));
  border-radius: 3px;
  background: transparent;
  color: var(--text-primary, #EDEDED);
  font-size: 0.875rem;
  cursor: pointer;
}
.header-search-tags-title { margin-top: 30px; }
.header-search-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.header-search-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-color, rgba(255,255,255,.18));
  border-radius: 3px;
  color: var(--text-primary, #EDEDED);
  font-size: 0.875rem;
  text-decoration: none;
}
.header-search-tags a:hover { border-color: var(--accent, #CBF631); color: var(--accent, #CBF631); }
.header-search-hint { margin-top: 26px; font-size: 0.8rem; color: var(--text-muted, #5A5A66); }

/* ============================================================
   9. Drawer — three rows, block-level links, unified button
   Uses #mobile-nav so it beats both the base .mobile-nav rules and
   the <=768 rules left in main.css, regardless of load order.
   ============================================================ */
#mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: var(--bg-primary, #0B0B0D);
  z-index: 2000;
  flex-direction: column;
  overscroll-behavior: contain;
}
#mobile-nav.open { display: flex; }

.mobile-nav-head {
  flex: 0 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,.1));
}
.mobile-nav-head-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted, #5A5A66);
}
#mobile-nav .mobile-nav-close {
  position: static;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-primary, #EDEDED);
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Account entry lives in the drawer header, not the cart footer.
   44px tall = WCAG / iOS minimum touch target. Brand green on #0B0B0D
   measures ~15.7:1 contrast (AA needs 4.5:1). */
.mobile-nav-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}
.mobile-nav-account-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(203, 246, 49, .55);
  border-radius: 3px;
  background: rgba(203, 246, 49, .06);
  color: var(--accent, #CBF631);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-account-pill svg { flex: 0 0 auto; }
.mobile-nav-account-pill:hover { background: rgba(203, 246, 49, .14); border-color: var(--accent, #CBF631); }
.mobile-nav-account-pill:active { background: rgba(203, 246, 49, .22); }

.mobile-nav-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 16px 0 4px;
  padding: 0 14px;
  background: var(--bg-input, #131318);
  border: 1px solid rgba(203,246,49,.45);
  border-radius: 3px;
  color: var(--text-primary, #EDEDED);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.mobile-nav-search-row svg { flex: 0 0 auto; color: var(--accent, #CBF631); }

.mobile-nav-label {
  margin: 20px 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: none;
  color: var(--text-muted, #5A5A66);
}
.mobile-nav-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,.1));
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-primary, #EDEDED);
}
.mobile-nav-summary::-webkit-details-marker { display: none; }
.mobile-nav-summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--accent, #CBF631);
}
.mobile-nav-group[open] .mobile-nav-summary::after { content: '\2013'; }
.mobile-nav-count {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted, #5A5A66);
}
.mobile-nav-cats { display: flex; flex-direction: column; }
.mobile-nav-group:not([open]) .mobile-nav-cats { display: none; }

#mobile-nav .mobile-nav-scroll {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 16px;
}
#mobile-nav .mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary, #A0A0A8);
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,.1));
  text-decoration: none;
}
#mobile-nav .mobile-nav-link:hover { color: var(--accent, #CBF631); }
#mobile-nav .mobile-nav-cat {
  padding-left: 14px !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  min-height: 42px;
}
#mobile-nav .mobile-nav-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-color, rgba(255,255,255,.1));
  background: var(--bg-primary, #0B0B0D);
}
#mobile-nav .mobile-nav-cart {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 3px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  background: var(--accent, #CBF631) !important;
  color: #000 !important;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}
#mobile-nav .mobile-nav-cart:hover { transform: none; box-shadow: none !important; }

.header-search-toggle:focus-visible,
.header-search-cancel:focus-visible,
.header-search-tags a:focus-visible,
.header-search-form input:focus-visible,
#mobile-nav button:focus-visible,
#mobile-nav a:focus-visible,
#mobile-nav summary:focus-visible { outline: 2px solid var(--accent, #CBF631); outline-offset: 2px; }

@media (max-width: 380px) {
  .header-actions .header-search-toggle,
  .header-actions .header-icon-btn,
  .header-actions .mobile-menu-btn { width: 38px; height: 38px; flex: 0 0 38px; }
}

@media (max-width: 360px) {
  .mobile-nav-account-pill { font-size: 0.8125rem; padding: 0 12px; gap: 6px; }
  .mobile-nav-account-pill svg { width: 15px; height: 15px; }
}
