/**
 * PUBLIC CATALOG — THE MOBILE NAV: the click-catching overlay, the slide-out
 * category drawer (parents, chevrons, expandable subcategory lists), and the
 * two narrow-width blocks that reshape the HEADER and the drawer together.
 *
 * SECOND of ten sheets — after styles.css (tokens, reset, header), before
 * styles-page.css. Read the load-order block at the top of styles.css before
 * moving a rule between sheets: the split is a contiguous slice of one original
 * file and the cascade depends on it.
 *
 * The <=768px and <=720px blocks at the bottom restyle `.header`, `.search-box`
 * and `.menu-btn` as well as the drawer. They live here rather than with the
 * header in sheet 1 because that is where they were in the original, and
 * because the mobile header and the drawer are one design: the bar collapses
 * so the drawer can take over.
 */
/* ── Nav Overlay + Drawer ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }
.nav-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: rgba(8, 13, 20, 0.98);
  border-right: 1px solid var(--border-strong);
  z-index: 201;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  will-change: left;
  box-shadow: var(--shadow);
}
.nav-drawer.open { left: 0; }
.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: var(--border-1);
  flex-shrink: 0;
}
.nav-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}
.nav-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-close-btn:hover { color: var(--text); background: var(--bg-hover); }
.nav-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.nav-home-link {
  display: block;
  padding: 12px 20px;
  min-height: 44px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  border-bottom: var(--border-1);
  margin-bottom: 4px;
}
.nav-home-link:hover { background: var(--bg-hover); color: var(--accent); }
.nav-home-link.active { color: var(--accent); background: var(--accent-glow); }

.nav-parent {
  border-bottom: 1px solid rgba(42, 46, 58, 0.5);
}
.nav-parent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 20px;
  min-height: 44px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.nav-parent-header:hover { background: var(--bg-hover); color: var(--accent); }
.nav-parent-header.active { color: var(--accent); background: var(--accent-glow); }
.nav-parent-header.active-parent { color: var(--accent); }
.nav-parent-header span {
  min-width: 0;
}
.nav-parent-header .nav-count {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}
.nav-parent-header .nav-chevron {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  transition: transform 0.2s, color 0.15s;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  margin-left: 8px;
}
.nav-parent.expanded .nav-chevron { transform: rotate(90deg); }
.nav-subcats {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: rgba(0,0,0,0.15);
}
.nav-parent.expanded .nav-subcats { max-height: 1000px; }
.nav-subcat-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 20px 8px 36px;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-subcat-link:hover { background: var(--bg-hover); color: var(--accent); }
.nav-subcat-link.active { color: var(--accent); font-weight: 600; background: var(--accent-glow); }
.nav-subcat-link span:first-child {
  min-width: 0;
  line-height: 1.35;
}
.nav-subcat-link .nav-sub-count {
  font-size: 11px;
  color: var(--text-dim);
}
.catalog-nav-unavailable {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 16px;
  padding: 14px;
  border: 1px solid rgba(255, 107, 44, 0.24);
  border-radius: 12px;
  background: rgba(255, 107, 44, 0.07);
}
.catalog-nav-unavailable-title {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}
.catalog-nav-retry {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 107, 44, 0.4);
  border-radius: var(--radius-pill);
  background: rgba(255, 107, 44, 0.12);
  color: var(--text);
  font: 600 13px var(--font-display);
  cursor: pointer;
}
.catalog-nav-retry:hover {
  border-color: var(--accent);
  background: rgba(255, 107, 44, 0.2);
}

@media (max-width: 768px) {
  .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    /* Tighter than the old 12/10-12: with the kicker + caption gone the rows
       sit closer without crowding (mobile header compaction 2026-07-26). */
    padding: 10px 14px;
    gap: 8px 12px;
  }
  .header-brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    width: auto;
    gap: 8px;
    min-height: 44px;
  }
  /* COMPACT MOBILE HEADER (2026-07-26): the chrome ate ~40% of the screen
     before a single result — brand row + a "SEARCH" caption + the input +
     TWO full-width stacked buttons. Everything below trims height WITHOUT
     removing a control or shrinking a tap target below 44px. */
  .header-kicker {
    /* The wordmark directly below already reads "Catalog"; on a phone this
       kicker is pure height. Still in the DOM for desktop + screen readers. */
    display: none;
  }
  .header-logo {
    font-size: 18px;
    white-space: nowrap;
  }
  .header-brand-icon { width: 34px; height: 34px; }
  .header-stats { display: none; }
  /* The field already has a magnifier icon, a descriptive placeholder AND an
     aria-label, so the separate uppercase "SEARCH" caption is redundant here.
     Visually hidden rather than display:none so the label stays for a11y. */
  .search-box-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .search-box { gap: 0; }
  .search-box input { padding-top: 12px; padding-bottom: 12px; }
  .header-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-basis: 100%;
    max-width: none;
    width: 100%;
  }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  /* Share one row instead of each taking a full-width row of its own. Two
     buttons stacked was ~112px of chrome; side-by-side is ~48px. min-height
     stays 44px+ so both remain comfortable tap targets.
     `padding: 0 12px` used to sit here too and had NEVER applied: the duplicate
     .adv-search-link rule in styles-search.css loads after this sheet and its
     `padding: 6px 14px` won at every width. Measured in Chromium at 390px before
     that duplicate was merged away (2026-08-10) — the computed padding was
     6px 14px, not 0 12px. Dropped rather than "restored", because restoring it
     would have been a real 2px change dressed up as a cleanup. */
  .adv-search-link {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    min-height: 44px;
    white-space: nowrap;
  }
  .nav-drawer {
    width: 86vw;
    max-width: 320px;
    left: -86vw;
  }
  .nav-drawer-header,
  .nav-home-link,
  .nav-parent-header,
  .nav-subcat-link {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 22px 14px 26px;
  }
  .catalog-page-surface {
    padding: 18px 16px 16px;
    border-radius: 22px;
  }
  .landing-hero {
    gap: 12px;
    margin-bottom: 24px;
  }
  .landing-panel {
    padding: 18px;
    border-radius: 22px;
  }
  .landing-title {
    font-size: clamp(30px, 10vw, 42px);
    max-width: none;
  }
  .landing-copy {
    font-size: 15px;
    max-width: none;
    line-height: 1.55;
  }
  .landing-actions {
    flex-direction: column;
    margin-top: 18px;
  }
  .landing-action {
    width: 100%;
  }
  .landing-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .landing-fact {
    width: auto;
    min-width: 0;
    white-space: normal;
  }
  .landing-section {
    margin-top: 22px;
  }
  .landing-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .landing-section-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .landing-section-meta {
    align-self: flex-start;
  }
  .category-surface-grid {
    gap: 14px;
  }
}
