/* ==========================================================================
   WarehouseHawk — a utility for tracking warehouse-club shelf prices & stock.
   Design priorities: function and trust first. Clean neutral surfaces, clear
   hierarchy, real data made scannable. Restrained brand colour from the hawk.
   - Headings : Fraunces
   - Body/UI  : DM Sans
   - Data     : IBM Plex Mono (SKUs, prices-as-data, timestamps, distances)
   ========================================================================== */

:root {
  --ink: #203b32;          /* header / footer / strongest text */
  --surface: #ffffff;      /* cards & panels */
  --surface-2: #f8f6f0;    /* inputs / subtle fills */
  --bg: #f3f0e8;           /* page background */
  --line: #e2ded3;         /* hairline borders */
  --line-strong: #c8c4b8;
  --text: #24372f;
  --muted: #626b61;

  --brand: #a34328;        /* red-tailed hawk: links + primary action */
  --brand-dark: #7b301c;
  --brand-tint: #f7e9df;
  --accent: #986212;       /* amber: deal highlight, used sparingly */

  --in-stock: #286644;
  --low-stock: #855c13;
  --out-stock: #b42318;
  --unknown: #626b61;

  --clearance: #714a75;
  --clearance-tint: #f4edf3;
  --clearance-line: #dfcfde;
  --sale: #335f73;
  --sale-tint: #edf3f5;
  --sale-line: #cddfe5;
  --price-drop: var(--in-stock);
  --price-drop-tint: #eef6f0;
  --price-drop-line: #cde2d3;

  /* Costco.com online offer: a cool blue keeps "buy online" visually distinct
     from the warehouse's red in-club identity. */
  --online: #335f73;
  --online-dark: #244555;
  --online-tint: #edf3f5;
  --online-line: #cddfe5;

  --shadow: 0 2px 4px rgba(32,59,50,.035);
  --shadow-lg: 0 12px 28px -16px rgba(32,59,50,.28);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Spacing scale. Card and panel rhythm is expressed in these steps so
     density can be retuned in one place instead of ~100 literals. */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Type scale. */
  --text-2xs: .72rem;
  --text-xs: .8rem;
  --text-sm: .9rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;

  /* Semantic surface tints, shared by flash messages, verdicts and cards so
     the same "this is good / caution / bad" colour is never respelled. */
  --ok-tint: #eef6f0;
  --ok-line: #bfe0cb;
  --ok-ink: #14532b;
  --warn-tint: #fbf2e3;
  --warn-line: #efddc0;
  --warn-ink: #6b4a05;
  --danger-tint: #fbeae8;
  --danger-line: #f1cdc8;
  --danger-ink: #7a1d0d;

  /* Shared height for search-row controls (input, warehouse chip, buttons) so
     the row reads as one aligned strip instead of a ragged staircase. */
  --control-h: 3rem;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.025em; font-weight: 600; }
h1 { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.8rem); line-height: 1.12; margin: 0 0 .9rem; }
h2 { font-size: 1.55rem; margin: 2rem 0 1rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: .5rem; z-index: 100; transform: translateY(-160%); padding: .6rem .85rem; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; box-shadow: var(--shadow-lg); }
.skip-link:focus { transform: translateY(0); }

/* mono inventory data */
.distance,
.change-link { font-family: var(--font-mono); }

/* inline icons */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex: none; }

/* ==========================================================================
   Header / footer
   ========================================================================== */
.site-header {
  background: var(--ink); color: #f3f1ec;
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 0 rgba(255,255,255,.04);
}
/* Local/dev environment: distinct header colour so it's never confused with prod. */
.site-header--dev {
  background: #3b2f75;
  border-bottom-color: rgba(0,0,0,.35);
}
.header-inner { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; }
.brand { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .65rem; font-family: var(--font-body); font-weight: 700; font-size: 1.3rem; letter-spacing: -.04em; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }

.header-search {
  flex: 1 1 18rem; min-width: 0; max-width: 34rem; margin-left: 1rem; display: flex; align-items: stretch; min-height: 40px;
  border: 1px solid rgba(243,241,236,.45); border-radius: var(--radius-sm); background: rgba(243,241,236,.08);
}
.header-search:focus-within { outline: 2px solid #f3f1ec; outline-offset: 1px; background: rgba(243,241,236,.14); }
.header-search select, .header-search input, .header-search button { border: 0; background: transparent; color: #f3f1ec; font: inherit; font-size: .94rem; }
.header-search select:focus, .header-search input:focus, .header-search button:focus { outline: none; }
.header-search select:focus-visible, .header-search button:focus-visible { background-color: rgba(243,241,236,.18); box-shadow: inset 0 0 0 2px rgba(243,241,236,.7); }
.header-search .header-search-scope {
  flex: 0 1 auto; max-width: 10rem; min-width: 0; padding: 0 1.6rem 0 .75rem; border-right: 1px solid rgba(243,241,236,.45);
  font-weight: 600; text-overflow: ellipsis; cursor: pointer; appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cdc9c0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .5rem center / .8rem;
}
.header-search-scope option { color: var(--text); background: var(--surface); }
.header-search input { flex: 1 1 auto; min-width: 0; padding: .45rem .75rem; }
.header-search input::placeholder { color: #cdc9c0; }
.header-search .header-search-submit { flex: 0 0 44px; display: grid; place-items: center; color: #cdc9c0; cursor: pointer; }
.header-search .header-search-submit:hover { color: #fff; }
.header-search-submit svg { width: 1.1rem; height: 1.1rem; }

.nav { display: flex; align-items: center; gap: .35rem 1rem; flex-wrap: wrap; margin-left: auto; }
.nav a { min-height: 36px; display: inline-flex; align-items: center; color: #cdc9c0; text-decoration: none; font-size: .94rem; }
.nav a:hover { color: #fff; }

.btn-outline { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: .5rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.site-header .btn-outline { border-color: rgba(243,241,236,.38); background: transparent; color: #f3f1ec; }
.site-header .btn-outline:hover { background: rgba(243,241,236,.1); color: #fff; }

.nav .nav-warehouse {
  display: inline-flex; align-items: center; gap: .35rem; background: rgba(243,241,236,.08);
  border: 1px solid rgba(243,241,236,.2); padding: .38rem .72rem; border-radius: var(--radius-sm);
  color: #f3f1ec; font-weight: 500; font-size: .9rem; max-width: 240px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.nav .nav-warehouse:hover { background: rgba(243,241,236,.16); }
.nav-warehouse .ico { color: #ebbb99; }
.nav-warehouse .ico, .btn-locate .ico { opacity: .95; }

.linklike { background: none; border: none; color: #cdc9c0; cursor: pointer; font: inherit; font-size: .94rem; padding: 0; }
.linklike:hover { color: #fff; text-decoration: underline; }
.linklike.danger { color: var(--out-stock); }
.linklike.danger:hover { color: #7a1d0d; }
.linklike.edit-link { color: var(--brand); text-decoration: none; }
.linklike.edit-link:hover { color: var(--brand-dark); text-decoration: underline; }

main.container { flex: 1 0 auto; padding-top: 2rem; padding-bottom: 4rem; }

.site-footer { border-top: 1px solid rgba(0,0,0,.25); background: var(--ink); }
.footer-inner { display: flex; justify-content: center; padding: var(--space-6) 0; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: .25rem var(--space-5); flex-wrap: wrap; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; color: #d7d3ca; font-size: var(--text-xs); font-weight: 600; text-decoration: none; white-space: nowrap; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* ==========================================================================
   Flash messages
   ========================================================================== */
.flash { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left: 3px solid var(--muted); background: var(--surface); font-size: .95rem; }
.flash-success { border-left-color: var(--in-stock); background: var(--ok-tint); color: var(--ok-ink); }
.flash-error { border-left-color: var(--out-stock); background: var(--brand-tint); color: var(--danger-ink); }
.flash-info { border-left-color: var(--accent); background: var(--warn-tint); color: var(--warn-ink); }

/* ==========================================================================
   Hero — concise onboarding
   ========================================================================== */
.landing {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center; gap: 3.5rem; margin: 1.5rem 0 3rem;
}
.landing .hero { padding: 0; }
.landing .hero h1 { max-width: 19ch; font-size: clamp(2.25rem, 1.5rem + 2.5vw, 3.75rem); line-height: 1.06; letter-spacing: -.04em; }
.landing .hero-sub { max-width: 40ch; line-height: 1.65; }
.landing .search-panel {
  --panel-pad: 1.5rem; margin-top: 0; min-width: 0;
  box-shadow: var(--shadow-lg);
}
.landing .search-form { gap: 1rem; }
.landing .field { min-width: 0; flex-basis: 100%; }
.landing .search-form .btn { width: 100%; }
.landing .search-scope-options { display: flex; border-radius: 8px; }
.landing .search-scope-option { flex: 1; }
.landing .search-scope-label { min-height: 52px; border-radius: 5px; }
.landing .search-scope-label strong { font-size: .9rem; }
.landing .search-scope-label small { font-size: .75rem; overflow-wrap: anywhere; white-space: normal; }
.landing .search-scope-option input:checked + .search-scope-label {
  background: var(--brand-tint); border-color: var(--brand); box-shadow: none;
}
.landing .search-scope-option input:checked + .search-scope-label strong { color: var(--brand-dark); }
.hero { max-width: 760px; padding: 1.4rem 0 .4rem; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
.hero-sub { color: var(--muted); font-size: 1.05rem; margin: 0; max-width: 58ch; }

/* ==========================================================================
   Static support pages
   ========================================================================== */
.page-hero { max-width: 760px; padding: 1.4rem 0 .6rem; }
.page-sub { color: var(--muted); font-size: 1.02rem; margin: 0; max-width: 68ch; }

.policy-panel, .contact-panel { min-width: 0; }
.policy-panel { padding: 1.35rem 1.5rem; }
.policy-simple { max-width: 760px; margin-top: 1rem; }
.policy-panel section + section { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.policy-panel h2 { margin: 0 0 .55rem; font-size: 1.12rem; }
.policy-panel p { margin: .55rem 0 0; }
.policy-panel ul, .policy-panel ol { margin: .65rem 0 0; padding-left: 1.15rem; }
.policy-panel li { margin: .28rem 0; }
.policy-updated { color: var(--muted); font-family: var(--font-mono); font-size: .82rem; }

.contact-page { max-width: 760px; padding-top: 1.1rem; }
.contact-head { max-width: 680px; margin-bottom: 1rem; }
.contact-panel { padding: 1.35rem 1.5rem; }
.contact-panel-head { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.contact-panel h2 { margin: 0 0 .25rem; }
.contact-panel .muted { margin: 0; font-size: .9rem; }
.contact-form { margin-top: 1rem; }
.contact-form .btn { align-self: flex-start; min-width: 12rem; }
.form-field { display: flex; flex-direction: column; gap: .35rem; }
.errorlist { list-style: none; margin: 0; padding: 0; }
.contact-success { max-width: 620px; margin: 1rem auto; }

/* ==========================================================================
   Panels & forms
   ========================================================================== */
.search-panel, .compare-panel, .chart-panel, .desc-panel, .availability-panel, .empty-state, .story, .lookup-panel, .policy-panel, .contact-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search-panel { --panel-pad: 1.25rem; padding: var(--panel-pad); margin-top: 1rem; }
.warehouse-search-panel { margin: .8rem 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.warehouse-search-form { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .7rem; }
.warehouse-search-query { flex: 1 1 auto; min-width: 0; }
.warehouse-search-query input { width: 100%; min-height: var(--control-h); padding-top: .6rem; padding-bottom: .6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.warehouse-search-query input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.warehouse-search-form .btn { flex: 0 0 auto; min-height: var(--control-h); }
.warehouse-search-panel > .geo-banner { display: flex; padding: .55rem .75rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.warehouse-search-panel > .geo-banner .geo-banner-actions { margin-left: auto; }
.warehouse-search-panel > .geo-banner:first-child { border-top: 0; }
.results-context { display: flex; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.results-context .back-link { margin-bottom: 0; }
.search-form { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.search-scope { width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.search-scope legend {
  margin: 0 0 .5rem; color: var(--muted); font-family: var(--font-body);
  font-size: .8rem; font-weight: 600;
}
.search-scope-options {
  display: inline-flex; max-width: 100%; padding: 3px; gap: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.search-scope-option { position: relative; min-width: 0; cursor: pointer; }
.search-scope-option input {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.search-scope-label {
  min-height: 40px; display: flex; flex-direction: column; justify-content: center;
  padding: .35rem .7rem; border: 1px solid transparent; border-radius: calc(var(--radius-sm) - 2px);
  color: var(--muted); line-height: 1.15; transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.search-scope-label strong { color: var(--text); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.search-scope-label small { margin-top: .16rem; font-size: .68rem; white-space: nowrap; }
.search-scope-option:hover .search-scope-label { color: var(--text); }
.search-scope-option input:checked + .search-scope-label {
  border-color: var(--line-strong); background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow);
}
.search-scope-option input:focus-visible + .search-scope-label {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.search-form:has(.scope-national-input:checked) .scope-warehouse-only,
.search-panel:has(.scope-national-input:checked) .panel-store { display: none; }
.field { display: flex; flex-direction: column; flex: 1 1 200px; }
.field-grow { flex: 2 1 320px; }
.field label, .stack-form label {
  display: block;
  font-size: .8rem; color: var(--muted); margin-bottom: .4rem;
  font-family: var(--font-body); font-weight: 600;
}
.field input, .stack-form input[type=email], .stack-form input[type=text], .stack-form textarea {
  padding: .68rem .78rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: var(--font-body); background: var(--surface); color: var(--text);
}
.field input::placeholder, .stack-form textarea::placeholder { color: var(--muted); }
.field input:focus, .stack-form input:focus, .stack-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.stack-form textarea { min-height: 11rem; resize: vertical; line-height: 1.5; }
input[type=checkbox] { accent-color: var(--brand); width: 1.05em; height: 1.05em; }

/* Every control on a search row shares one height, so labels line up across the
   row and the strip reads as a single search bar. */
.search-form .field input,
.search-form .btn,
.search-form .btn-locate { min-height: var(--control-h); }

/* Leading icon inside the main query input. */
.input-affix { position: relative; display: flex; }
.input-affix input { width: 100%; padding-left: 2.5rem; }
.input-affix-ico {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  width: 1.05rem; height: 1.05rem; color: var(--muted); pointer-events: none;
}
.input-affix input:focus ~ .input-affix-ico,
.input-affix:focus-within .input-affix-ico { color: var(--brand); }

/* The search panel states its warehouse once, as a header strip above the query
   row, so the store is never repeated in a field that looks disabled. */
.panel-store {
  display: flex; align-items: center; gap: .55rem;
  width: calc(100% + var(--panel-pad) * 2);
  margin: calc(var(--panel-pad) * -1) calc(var(--panel-pad) * -1) 1rem;
  padding: .6rem var(--panel-pad);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0;
}
.panel-store > .ico { flex: 0 0 auto; color: var(--brand); }
.panel-store-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.panel-store-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-store-link { color: var(--text); text-decoration: none; }
.panel-store-link:hover { color: var(--brand-dark); text-decoration: underline; }
.panel-store-sub { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-store-sub:empty { display: none; }
.panel-store-actions { display: inline-flex; align-items: center; gap: .7rem; margin-left: auto; }
.panel-store-save, .deals-save-form { display: inline-flex; margin: 0; }
.panel-store-save .change-link, .deals-save-form .change-link { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; }
.change-link { flex: 0 0 auto; font-size: .76rem; color: var(--muted); }
.change-link:hover { color: var(--brand-dark); }
.btn {
  padding: .68rem 1.4rem; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
button[data-loading]:disabled { opacity: .9; cursor: progress; }
.spinner { display: inline-block; width: .85em; height: .85em; margin-right: .15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.1em; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.alert { margin: 1rem 0 0; padding: .7rem .9rem; background: var(--brand-tint); border: 1px solid #eab9ac; border-left: 3px solid var(--out-stock); color: #7a1d0d; border-radius: var(--radius-sm); }
.alert p { margin: 0 0 .65rem; }
.alert p:last-child { margin-bottom: 0; }
/* ==========================================================================
   How it works — plain numbered steps
   ========================================================================== */
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 1rem; }
.story { padding: 1.5rem; }
.story-step {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--ink); color: #fff;
  font-family: var(--font-mono); font-weight: 600; font-size: .85rem;
}
.story h3 { margin: .8rem 0 .45rem; font-size: 1.3rem; }
.story p { margin: 0; color: var(--muted); font-size: .94rem; }

.warehouse-directory { margin-top: 2.2rem; }

/* ==========================================================================
   Warehouse cards
   ========================================================================== */
.warehouse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: .8rem; }
.warehouse-card {
  display: flex; flex-direction: column; gap: .12rem; padding: .9rem 1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: border-color .12s ease, box-shadow .12s ease;
}
.warehouse-card strong { font-weight: 600; }
.warehouse-card:hover, .warehouse-card:focus-within { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.warehouse-card span { color: var(--muted); font-size: .85rem; }
.warehouse-card .distance { color: var(--brand); font-weight: 600; font-size: .8rem; margin-top: .25rem; }

.stores-panel {
  padding: 1.45rem 1.55rem;
}
.stores-intro h1 { margin: 0 0 .45rem; }
.stores-intro > p { margin: 0; color: var(--muted); max-width: 48ch; }
.stores-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end; gap: .75rem; margin-top: 1rem;
}
.stores-form .field { min-width: 0; }
.stores-form .btn, .stores-form .btn-locate { white-space: nowrap; }
.btn-locate { align-self: flex-end; padding: .68rem 1rem; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 500; font-family: var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.btn-locate:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-locate:disabled { opacity: .6; cursor: progress; }
.locate-status { margin: .6rem 0 0; font-size: .9rem; }

.store-card { gap: .15rem; }
.store-card.is-current { border-color: var(--in-stock); background: #eef6f0; }
.current-badge { margin-top: .55rem; color: var(--in-stock); font-weight: 600; font-size: .85rem; font-family: var(--font-mono); }
.store-actions { display: flex; align-items: center; gap: .6rem; margin-top: .65rem; flex-wrap: wrap; }
.store-actions .store-select { margin: 0; flex: 1 1 auto; }
.store-actions .store-remove { margin: 0; }
.store-remove .linklike { min-height: 44px; display: inline-flex; align-items: center; }
.store-select { margin: .6rem 0 0; }
.store-card .btn-outline { display: block; width: 100%; text-align: center; color: var(--text); border: 1px solid var(--line-strong); padding: .5rem .7rem; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; background: var(--surface); }
.store-card .btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.saved-tag { font-family: var(--font-mono); font-size: .76rem; margin-top: .3rem; color: var(--accent); }
.store-page-link { min-height: 44px; display: inline-flex; align-items: center; font-size: .82rem; font-weight: 600; margin-top: .15rem; text-decoration: none; }
.store-page-link:hover { text-decoration: underline; }
.warehouse-picker { margin-top: 1.5rem; }
.saved-section { margin-top: 1.5rem; }
.nearby-guess-head { display: flex; align-items: end; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.nearby-guess-head h2 { margin: 0 0 .2rem; }
.nearby-guess-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.warehouse-directory-head {
  display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem;
}
.warehouse-directory-head h2 { margin: 0 0 .35rem; }
.warehouse-directory-head p { margin: 0; color: var(--muted); max-width: 68ch; }
.warehouse-directory-count {
  flex: none; padding: .35rem .55rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--muted);
  font-family: var(--font-mono); font-size: .76rem; white-space: nowrap;
}
.warehouse-region-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start; gap: .75rem; margin-top: 1rem;
}
.warehouse-region {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.warehouse-region[open] { grid-column: 1 / -1; border-color: var(--line-strong); }
.warehouse-region > summary {
  min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: .65rem; padding: .8rem 1rem; cursor: pointer; list-style: none;
}
.warehouse-region > summary::-webkit-details-marker { display: none; }
.warehouse-region > summary::after {
  content: "＋"; flex: none; color: var(--muted); font-size: 1.05rem; line-height: 1;
}
.warehouse-region[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.warehouse-region[open] > summary::after { content: "−"; }
.warehouse-region > summary:hover strong { color: var(--brand-dark); }
.warehouse-region-name { min-width: 0; }
.warehouse-region-name strong {
  font-family: var(--font-body); font-size: .98rem; font-weight: 600; letter-spacing: 0;
}
.warehouse-region-count { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.warehouse-region-body { padding: .4rem 1rem .8rem; }
.warehouse-region ul {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 0 1.25rem; list-style: none; margin: 0; padding: 0;
}
.warehouse-region li { border-bottom: 1px solid var(--line); }
.warehouse-region a {
  min-height: 52px; display: flex; align-items: center;
  padding: .55rem .25rem; color: var(--text); text-decoration: none;
}
.warehouse-region a:hover strong { color: var(--brand-dark); text-decoration: underline; }
.warehouse-region a > span:first-child { min-width: 0; display: flex; flex-direction: column; gap: .08rem; }
.warehouse-region a strong {
  font-family: var(--font-body); font-size: .9rem; font-weight: 500; letter-spacing: 0;
}
.warehouse-region a small { color: var(--muted); font-size: .74rem; }

/* Header warehouse switcher (dropdown) */
.warehouse-menu { position: relative; }
.warehouse-menu > summary { list-style: none; cursor: pointer; }
.warehouse-menu > summary::-webkit-details-marker { display: none; }
.warehouse-menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); min-width: min(240px, calc(100vw - 1.5rem)); max-width: calc(100vw - 1.5rem); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .45rem; z-index: 40; }
.menu-label { color: var(--muted); font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; margin: .3rem .55rem .4rem; }
.menu-item-form { margin: 0; }
.menu-item { display: block; width: 100%; min-height: 44px; text-align: left; background: none; border: none; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: .92rem; cursor: pointer; }
.menu-item:hover { background: var(--brand-tint); }
.menu-item.is-active { color: var(--brand); font-weight: 600; }
.warehouse-menu-panel .menu-warehouse-page { display: flex; align-items: center; min-height: 44px; padding: .55rem .6rem; margin-top: .35rem; border-top: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none; }
.warehouse-menu-panel .menu-warehouse-page:hover { color: var(--brand-dark); background: var(--brand-tint); }
.warehouse-menu-panel .menu-add { display: flex; align-items: center; min-height: 44px; padding: .55rem .6rem; margin-top: .35rem; border-top: 1px solid var(--line); color: var(--brand); font-weight: 600; font-size: .9rem; text-decoration: none; }
.warehouse-menu-panel .menu-warehouse-page + .menu-add { margin-top: 0; border-top: 0; }
.warehouse-menu-panel .menu-add:hover { color: var(--brand-dark); background: var(--brand-tint); }
