/* Amul Store Locator — hand-written CSS, no build step. */

:root {
  --red: #E01A22;
  --red-deep: #B0141A;
  --blue: #0F4C81;
  --blue-soft: #E3ECF4;
  --ink: #16232E;
  --ink-soft: #63747F;
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --bg: #F1F4F7;
  --line: #E0E6EB;
  --butter: #FFC72C;

  --font-head: 'Archivo', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Hind', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 35, 46, .06), 0 4px 16px rgba(22, 35, 46, .06);
  --header-h: 64px;
  --focus: 0 0 0 3px rgba(15, 76, 129, .35);
  --skeleton-a: #E9EEF2;
  --skeleton-b: #F5F7F9;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #7FB3E0;
    --blue-soft: #1B2B3A;
    --ink: #E8EEF3;
    --ink-soft: #9AAAB6;
    --surface: #17222C;
    --surface-2: #1C2934;
    --bg: #0F171E;
    --line: #2A3945;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
    --focus: 0 0 0 3px rgba(127, 179, 224, .45);
    --skeleton-a: #22313D;
    --skeleton-b: #1C2934;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #7FB3E0;
  --blue-soft: #1B2B3A;
  --ink: #E8EEF3;
  --ink-soft: #9AAAB6;
  --surface: #17222C;
  --surface-2: #1C2934;
  --bg: #0F171E;
  --line: #2A3945;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
  --focus: 0 0 0 3px rgba(127, 179, 224, .45);
  --skeleton-a: #22313D;
  --skeleton-b: #1C2934;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .wrap { padding: 0 24px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.site-header .wrap { display: flex; align-items: center; height: var(--header-h); gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { height: 38px; width: auto; display: block; }
.brand .divider { width: 1px; height: 30px; background: var(--line); }
.brand h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
@media (min-width: 900px) {
  .brand img { height: 50px; }
  .brand h1 { font-size: 20px; }
  :root { --header-h: 76px; }
}

/* ---------- search panel ---------- */
.search-panel { background: var(--blue-soft); border-bottom: 1px solid var(--line); padding: 18px 0 14px; }
.search-bar {
  display: grid; gap: 8px;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
}
@media (min-width: 900px) {
  .search-bar { grid-template-columns: 1.4fr 1.2fr auto; gap: 0; padding: 6px; align-items: stretch; }
  .search-bar .field + .field { border-left: 1px solid var(--line); }
}
.field { position: relative; display: flex; flex-direction: column; padding: 6px 12px; min-width: 0; }
.field label {
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.field label .req { color: var(--red); }
.field input {
  border: 0; background: transparent; padding: 4px 30px 4px 0; width: 100%; min-width: 0;
  font-size: 16px; font-weight: 500; color: var(--ink);
}
.field input::placeholder { color: var(--ink-soft); font-weight: 400; }
.field input:focus-visible { box-shadow: none; }
.field:focus-within { border-radius: 8px; box-shadow: inset 0 0 0 2px var(--blue); }
.field .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface-2);
  color: var(--ink-soft); cursor: pointer; display: none; align-items: center; justify-content: center;
}
.field.has-value .clear { display: inline-flex; }
.field .clear:hover { color: var(--ink); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red); color: #fff; border: 0; border-radius: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  padding: 12px 22px; cursor: pointer; white-space: nowrap; margin: 0;
}
.btn-primary:hover { background: var(--red-deep); }
.btn-primary:disabled { opacity: .6; cursor: default; }
@media (min-width: 900px) { .btn-primary { margin: 2px; } }

.search-options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 14px 6px 10px; cursor: pointer; font-weight: 500; font-size: 14px;
}
.pill:hover { border-color: var(--blue); }
.pill[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill svg { width: 16px; height: 16px; }
.pill .spin { display: none; }
.pill.busy .spin { display: inline-block; animation: spin 1s linear infinite; }
.pill.busy .dot { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.radius { display: none; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.radius.show { display: inline-flex; }
.radius select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 8px; color: var(--ink); }
.search-hint { font-size: 14px; color: var(--ink-soft); margin: 0; }
/* Location first: the "Where" cell is a button, not an input; city/area are a second, collapsible row. */
.field-where { justify-content: center; }
.where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 2px 30px 2px 0; }
.where-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--blue); background: var(--surface); color: var(--blue);
  border-radius: 999px; padding: 6px 14px 6px 10px; cursor: pointer; font-weight: 600; font-size: 15px; max-width: 100%;
}
.where-btn:hover { background: var(--blue-soft); }
.where-btn[aria-pressed="true"] { background: var(--blue); color: #fff; }
.where-btn svg { width: 16px; height: 16px; flex: none; }
.where-btn .spin { display: none; }
.where-btn.busy .spin { display: inline-block; animation: spin 1s linear infinite; }
.where-btn.busy .dot { display: none; }
.search-bar .manual { display: none; }
.search-bar.manual .manual { display: flex; }
@media (max-width: 899.98px) {
  .search-bar #find-btn { order: 10; }              /* the Find button stays last when the city/area row opens */
}
@media (min-width: 900px) {
  .search-bar #field-product { grid-area: 1 / 1; }
  .search-bar #field-where { grid-area: 1 / 2; }
  .search-bar #find-btn { grid-area: 1 / 3; }
  .search-bar #field-city { grid-area: 2 / 1; }
  .search-bar #field-area { grid-area: 2 / 2 / 3 / 4; border-left: 1px solid var(--line); }
  .search-bar .manual { border-top: 1px solid var(--line); }
}
.manual-toggle {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 0;
  color: var(--blue); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.manual-toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.manual-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- combobox listbox ---------- */
.listbox {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; display: none;
  min-width: 260px;
}
.listbox.open { display: block; }
.listbox li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.listbox li[aria-selected="true"], .listbox li:hover { background: var(--blue-soft); }
.listbox li .primary { font-weight: 500; }
.listbox li .secondary { font-size: 13px; color: var(--ink-soft); }
.listbox li mark { background: transparent; color: var(--blue); font-weight: 700; }
.listbox li.status { color: var(--ink-soft); cursor: default; font-size: 14px; }
.listbox li.status:hover { background: transparent; }
.listbox li.group-head {
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft); cursor: default; padding-top: 10px;
}
.listbox li.group-head:hover { background: transparent; }

/* ---------- category chips ---------- */
.categories { background: var(--surface); border-bottom: 1px solid var(--line); }
.chip-strip { display: flex; gap: 22px; overflow-x: auto; padding: 12px 0; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chip-group { flex: 0 0 auto; }
.chip-group h2 {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 6px; white-space: nowrap;
}
.chip-row { display: flex; gap: 6px; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip-strip.skeleton .chip { color: transparent; border-color: transparent; min-width: 90px; }

/* ---------- main split ---------- */
.main { padding: 16px 0 32px; }
.layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(360px, 480px) 1fr; gap: 20px; align-items: start; }
  .map-panel { position: sticky; top: calc(var(--header-h) + 16px); height: calc(100vh - var(--header-h) - 32px); }
}
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.results-head h2 { font-size: 18px; font-weight: 700; }
.results-head p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.results-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }

.card {
  position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover, .card.active, .card:focus-within { border-color: var(--blue); }
.card.active { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.card .num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.card.no-pin .num { background: var(--ink-soft); }
.card h3 { font-size: 16px; font-weight: 700; margin: 0 0 2px; overflow-wrap: anywhere; }
.card .addr { margin: 0; color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; align-items: center; }
.card .meta a { text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.card .meta a:hover { text-decoration: underline; }
.card .meta svg { width: 15px; height: 15px; }
.card .dist { color: var(--ink-soft); }
.card .muted { color: var(--ink-soft); }
.card .badge { font-size: 12px; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.skeleton .card { pointer-events: none; }
.sk { background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; height: 14px; }
.sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.w40 { width: 40%; height: 12px; margin-top: 8px; } .sk.num { width: 30px; height: 30px; border-radius: 50%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.load-more { display: flex; justify-content: center; margin-top: 14px; }
.btn-secondary {
  border: 1px solid var(--line); background: var(--surface); color: var(--blue); border-radius: 10px;
  font-family: var(--font-head); font-weight: 700; padding: 10px 18px; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--blue); }

/* empty / intro states */
.state {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 28px 22px; text-align: center; color: var(--ink-soft);
}
.state h2 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.state p { margin: 0 0 10px; }
.state ul { text-align: left; display: inline-block; margin: 6px 0 0; padding-left: 20px; }
.state .btn-secondary { margin-top: 10px; }
.state.error { border-color: var(--red); border-style: solid; }

/* ---------- map ---------- */
.map-panel { display: flex; flex-direction: column; min-height: 320px; }
#map {
  flex: 1; min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); z-index: 1;
}
@media (max-width: 899.98px) {
  .map-panel { height: calc(100vh - var(--header-h) - 120px); min-height: 360px; }
  .layout[data-view="list"] .map-panel { display: none; }
  .layout[data-view="map"] .results-panel { display: none; }
}
@media (min-width: 900px) { .view-toggle { display: none; } }
.view-toggle {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 25;
  display: inline-flex; background: var(--ink); color: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow);
}
.view-toggle button {
  border: 0; background: transparent; color: inherit; padding: 8px 18px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; cursor: pointer;
}
.view-toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.view-toggle[hidden] { display: none; }

.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--red); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.pin span { transform: rotate(45deg); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 12px; }
.pin.active { background: var(--blue); width: 36px; height: 36px; }
.pin.origin { background: var(--butter); border-color: #fff; }
.pin.origin span { color: var(--ink); }
.leaflet-marker-icon.pin-wrap { background: transparent; border: 0; }
.leaflet-popup-content-wrapper { border-radius: 10px; font-family: var(--font-body); }
.leaflet-popup-content { margin: 10px 14px; font-size: 14px; }
.leaflet-popup-content strong { font-family: var(--font-head); }
.leaflet-container { font-family: var(--font-body); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(224, 26, 34, .25); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--red); color: #fff; font-family: var(--font-head); font-weight: 700; }
:root[data-theme="dark"] .leaflet-tile-pane, :root:not([data-theme="light"]) .leaflet-tile-pane { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.85) contrast(1.05) saturate(.85); }
  :root:not([data-theme="light"]) .leaflet-control-attribution, :root:not([data-theme="light"]) .leaflet-bar a { background: var(--surface); color: var(--ink); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.85) contrast(1.05) saturate(.85); }
:root[data-theme="dark"] .leaflet-control-attribution, :root[data-theme="dark"] .leaflet-bar a { background: var(--surface); color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--ink-soft); font-size: 13px; }
.site-footer p { margin: 0 0 8px; max-width: 70ch; }
.site-footer .legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: inherit; }

/* toast for transient errors */
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- category carousel ---------- */
.categories { padding: 14px 0 6px; }
.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.cat-head h2 { font-size: 15px; font-weight: 700; margin-right: 4px; }
/* says why the strip is shorter once a visitor has shared their location */
.cat-near {
  display: inline-block; vertical-align: 1px; margin-left: 2px; padding: 2px 8px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: .02em; text-transform: none;
}
.cat-near[hidden] { display: none; }
.cat-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs button {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-soft); font-weight: 500; font-size: 14px;
  padding: 6px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.cat-tabs button:hover { color: var(--ink); background: var(--surface-2); }
.cat-tabs button[aria-selected="true"] { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.cat-arrows { display: none; gap: 4px; margin-left: auto; }
@media (min-width: 900px) { .cat-arrows { display: flex; } }
.cat-arrows .icon-btn { border: 1px solid var(--line); font-size: 22px; line-height: 1; width: 34px; height: 34px; }
.carousel {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px; margin: 0 -2px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  scroll-padding: 0 2px;
}
.cat-card {
  flex: 0 0 164px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 5px 5px 9px; cursor: pointer; text-align: left; color: inherit; font: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.cat-card > .cat-name, .cat-card > .cat-count { padding: 0 3px; }
.cat-card:hover, .cat-card:focus-visible { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.cat-card[hidden] { display: none; }
.cat-img {
  aspect-ratio: 1; border-radius: 8px; background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.cat-img img { width: 100%; height: 100%; object-fit: contain; padding: 1px; display: block; }
.cat-img .placeholder { font-family: var(--font-head); font-weight: 800; font-size: 36px; color: var(--red); opacity: .85; }
.cat-name { font-family: var(--font-head); font-weight: 700; font-size: 13px; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.cat-count { font-size: 11.5px; color: var(--ink-soft); line-height: 1.2; }
.carousel.skeleton .cat-card { pointer-events: none; }
.carousel.skeleton .cat-img { background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border: 0; }
.carousel.skeleton .cat-name { background: var(--skeleton-a); border-radius: 6px; height: 14px; width: 70%; }
@media (min-width: 900px) { .cat-card { flex-basis: 176px; } }

/* thumbnails in the product dropdown */
.listbox li.with-thumb { flex-direction: row; align-items: center; gap: 10px; }
.listbox li .thumb { width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid var(--line); flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.listbox li .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.listbox li .thumb.none { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.listbox li .text { display: flex; flex-direction: column; min-width: 0; }

/* product hero above results */
.product-hero {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.product-hero[hidden] { display: none; }
.product-hero .hero-img { width: 72px; height: 72px; border-radius: 10px; background: #fff; border: 1px solid var(--line); flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.product-hero .hero-img img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.product-hero .hero-img .placeholder { font-family: var(--font-head); font-weight: 800; color: var(--red); font-size: 22px; }
.product-hero .eyebrow { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.product-hero h2 { font-size: 17px; margin: 2px 0; }
.product-hero p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.product-hero .hero-text { min-width: 0; }

/* ---------- feedback ---------- */
.fab {
  position: fixed; right: 16px; bottom: 18px; z-index: 26;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--blue); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-family: var(--font-head); font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
}
.fab:hover { border-color: var(--blue); }
@media (max-width: 899.98px) { .fab { bottom: 72px; right: 12px; padding: 10px 12px; } .layout[data-view="map"] ~ .fab { display: none; } }
.dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.dialog::backdrop { background: rgba(22, 35, 46, .55); }
.dialog form { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 20px; }
.dialog-lead { margin: 0; color: var(--ink-soft); font-size: 14px; }
.fb-kinds { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.fb-kinds legend { font-family: var(--font-head); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.fb-kinds label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; }
.fb-kinds label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.fb-kinds input { accent-color: var(--blue); margin: 0; }
.fb-field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-head); font-weight: 700; font-size: 13px; }
.fb-field .req { color: var(--red); }
.fb-field textarea, .fb-field input[type="text"] {
  font-family: var(--font-body); font-weight: 400; font-size: 15px; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; background: var(--surface-2); color: var(--ink); resize: vertical;
}
.fb-field textarea:focus, .fb-field input:focus { border-color: var(--blue); }
.stars { display: flex; gap: 2px; }
.stars button { border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--line); cursor: pointer; padding: 0 2px; }
.stars button.on, .stars button:hover, .stars:hover button:hover ~ button { color: var(--line); }
.stars button.on { color: var(--butter); }
.stars:hover button { color: var(--butter); }
.stars button:hover ~ button { color: var(--line); }
.fb-hp { position: absolute; left: -9999px; top: -9999px; }
.fb-status { margin: 0; font-size: 14px; color: var(--ink-soft); min-height: 1.2em; }
.fb-status.error { color: var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- product picker (opened from a category card) ---------- */
html.modal-open { overflow: hidden; }
.picker {
  width: min(760px, calc(100vw - 32px)); max-height: min(82vh, 760px);
  display: flex; flex-direction: column; overflow: hidden;
}
.picker:not([open]) { display: none; }
.picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; }
.picker-title h2 { font-size: 19px; line-height: 1.2; margin: 0; }
.picker-title p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.picker-head .icon-btn { flex: 0 0 auto; margin: -6px -8px 0 0; font-size: 26px; line-height: 1; }
.picker-cats-wrap { position: relative; }
.picker-cats-wrap::after {
  content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 36px; pointer-events: none;
  background: linear-gradient(270deg, var(--surface) 25%, transparent);
}
.picker-cats {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 18px 8px;
  scroll-padding: 0 18px; -webkit-overflow-scrolling: touch;
}
.picker-cats::-webkit-scrollbar { display: none; }
.picker-cats button {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.picker-cats button:hover { color: var(--ink); border-color: var(--blue); }
.picker-cats button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.picker-filter { display: flex; align-items: center; gap: 8px; margin: 0 18px 10px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink-soft); }
.picker-filter:focus-within { border-color: var(--blue); }
.picker-filter input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; font-size: 15px; color: var(--ink); }
.picker-filter input:focus-visible { box-shadow: none; }
.picker-filter input::-webkit-search-cancel-button { -webkit-appearance: none; }
.picker-body { overflow-y: auto; padding: 0 18px 18px; flex: 1 1 auto; min-height: 120px; overscroll-behavior: contain; }
.picker-status { margin: 24px 0; text-align: center; color: var(--ink-soft); font-size: 14px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pick-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 7px 8px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.pick-card:hover, .pick-card:focus-visible { border-color: var(--blue); box-shadow: var(--shadow); }
.pick-card[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.pick-img { aspect-ratio: 1; border-radius: 8px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pick-img img { width: 100%; height: 100%; object-fit: contain; padding: 2px; display: block; }
.pick-img .placeholder { font-family: var(--font-head); font-weight: 800; font-size: 24px; color: var(--red); opacity: .85; }
.pick-name { font-family: var(--font-head); font-weight: 600; font-size: 12.5px; line-height: 1.25; overflow-wrap: anywhere; }
/* phones: bottom sheet */
@media (max-width: 899.98px) {
  .picker {
    width: 100vw; max-width: none; max-height: 88vh; max-height: 88dvh;
    margin: auto 0 0; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.3);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .picker-head { padding: 12px 14px 6px; }
  .picker-cats { padding-left: 14px; padding-right: 14px; }
  .picker-filter { margin: 0 14px 8px; }
  .picker-body { padding: 0 14px 14px; }
  .pick-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* alternatives in the empty state */
.state.has-alts { text-align: left; }
.state.has-alts h2 { text-align: center; }
.state.has-alts > p { text-align: center; }
.alts { margin: 16px 0 10px; }
.alts h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.alt-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.alt-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.alt-card:hover, .alt-card:focus-visible { border-color: var(--blue); transform: translateY(-2px); }
.alt-img { aspect-ratio: 1; border-radius: 8px; background: #fff; border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.alt-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.alt-img .placeholder { font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--red); opacity: .85; }
.alt-name { font-family: var(--font-head); font-weight: 700; font-size: 13px; line-height: 1.25; }
.alt-count { font-size: 12px; color: var(--blue); font-weight: 600; }
.state.has-alts ul { margin-top: 12px; }

/* phone reveal: number lives in glyph spans, not selectable text */
.link-btn { border: 0; background: transparent; padding: 0; font: inherit; color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--ink-soft); cursor: wait; }
.phone-reveal .reveal-hint { font-size: 12px; background: var(--blue-soft); color: var(--blue); border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.num-text { letter-spacing: .02em; }
.phone-shown { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.num-glyphs { display: inline-flex; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.num-glyphs i { font-style: normal; }
.num-glyphs i:nth-child(6)::before { content: ' '; }   /* visual 5-5 split of a 10-digit number */
.phone-shown .tel { text-decoration: none; font-size: 12px; background: var(--blue); color: #fff; border-radius: 6px; padding: 2px 8px; font-weight: 600; }
.leaflet-popup-content .link-btn { font-size: 14px; }

/* ---------- carousel scroll affordance ---------- */
.carousel-wrap { position: relative; }
/* edge fades: show there is more to the right (and left once scrolled) */
.carousel-wrap::before, .carousel-wrap::after {
  content: ''; position: absolute; top: 0; bottom: 14px; width: 44px; pointer-events: none; z-index: 2;
  transition: opacity .2s; opacity: 1;
}
.carousel-wrap::before { left: -2px; background: linear-gradient(90deg, var(--surface) 20%, transparent); }
.carousel-wrap::after  { right: -2px; background: linear-gradient(270deg, var(--surface) 20%, transparent); }
.carousel-wrap.at-start::before, .carousel-wrap.at-end::after, .carousel-wrap.no-scroll::before, .carousel-wrap.no-scroll::after { opacity: 0; }

/* phones: size cards so a partial card always peeks in from the right edge */
@media (max-width: 899.98px) {
  .carousel { gap: 10px; padding-bottom: 10px; scrollbar-width: none; }
  .carousel::-webkit-scrollbar { display: none; }
  .cat-card { flex-basis: calc((100% - 20px) / 2.25); }
  .categories { padding-bottom: 10px; }
}

/* one-time swipe hint pinned to the right edge */
.swipe-hint {
  position: absolute; right: 6px; top: 34%; z-index: 3; pointer-events: none;
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--ink); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 12px;
  padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow);
  animation: hint-bob 1.6s ease-in-out infinite; transition: opacity .3s;
}
.swipe-hint span { display: inline-block; animation: hint-arrow 1.6s ease-in-out infinite; }
.swipe-hint.gone, .carousel-wrap.no-scroll .swipe-hint, .carousel-wrap.at-end .swipe-hint { opacity: 0; }
@media (min-width: 900px) { .swipe-hint { display: none; } }
@keyframes hint-bob { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-6px); } }
@keyframes hint-arrow { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .swipe-hint, .swipe-hint span { animation: none; } }

/* thin progress bar under the strip (phones) */
.scroll-progress { position: relative; height: 4px; border-radius: 2px; background: var(--line); margin: 0 0 4px; overflow: hidden; }
.scroll-progress i { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; border-radius: 2px; background: var(--blue); transition: left .08s linear; }
@media (min-width: 900px) { .scroll-progress { display: none; } }
.carousel-wrap.no-scroll + .scroll-progress { display: none; }

/* phones: the heading sits above the division tabs instead of squeezing them */
@media (max-width: 899.98px) {
  .cat-head { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
  .cat-head h2 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
  .cat-tabs { width: 100%; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); scroll-padding: 0 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .cat-tabs button { padding: 6px 12px; border: 1px solid var(--line); background: var(--surface); }
  .cat-tabs button[aria-selected="true"] { border-color: var(--blue); }
}
/* auto-scroll: snapping would fight the animation; it comes back the moment the user takes over */
.carousel.autoscrolling { scroll-snap-type: none; scroll-behavior: auto; }
.categories { border-bottom: 1px solid var(--line); }
.search-panel { border-top: 0; }
