/* Abstract Ice — store locator
   Palette (brand guidelines 6.1): Black #222C33, Dark Gray #3A3F4A, Light Gray #EFF2F4, White #FFFFFF.
   Type (7.1/7.2): Aeonik Bold headlines (sentence case), Medium sub-heads/labels, Regular body. */

@font-face { font-family: "Aeonik"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("assets/fonts/Aeonik-Regular.woff2") format("woff2"); }
@font-face { font-family: "Aeonik"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("assets/fonts/Aeonik-Medium.woff2") format("woff2"); }
@font-face { font-family: "Aeonik"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("assets/fonts/Aeonik-Bold.woff2") format("woff2"); }

:root {
  --black: #222C33;
  --dark: #3A3F4A;
  --light: #EFF2F4;
  --white: #FFFFFF;
  --rule: rgba(58, 63, 74, 0.16);
  --rule-strong: rgba(58, 63, 74, 0.32);
  --font: "Aeonik", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --panel-w: 400px;
  --header-h: 76px;
  --radius: 10px;
  --pin: 32px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--black); color: var(--white); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* ---------- header (standalone page only) ---------- */
.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--white);
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 22px; width: auto; display: block; }
.headline { font-size: 22px; font-weight: 700; letter-spacing: 0; margin: 0; line-height: 1.1; }
.store-count { margin: 0 0 0 auto; font-size: 13px; color: var(--dark); }
.all-stores { font-size: 13px; font-weight: 500; color: var(--dark); text-decoration: none; white-space: nowrap; }
.all-stores:hover { text-decoration: underline; }
.embed .site-header, .embed .site-footer { display: none; }

/* ---------- layout ---------- */
.locator {
  position: relative;
  height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  overflow: hidden;
}
.embed .locator { height: 100svh; }
@supports not (height: 100svh) { .locator { height: calc(100vh - var(--header-h)); } .embed .locator { height: 100vh; } }

.map-wrap { position: relative; background: var(--dark); min-width: 0; }
#map { position: absolute; inset: 0; }
.map-wrap :focus-visible { outline-color: var(--white); }

/* ---------- panel ---------- */
.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--white);
  border-right: 1px solid var(--rule);
  z-index: 2;
}
.panel-top { padding: 18px 20px 12px; border-bottom: 1px solid var(--rule); }
.sheet-handle { display: none; }

.search { display: flex; gap: 8px; }
.search-field { position: relative; flex: 1; }
.search-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--dark); pointer-events: none; }
#q {
  width: 100%; height: 48px;
  padding: 0 40px 0 42px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--light);
  font-size: 15px; font-weight: 400;
  -webkit-appearance: none; appearance: none;
}
#q::placeholder { color: var(--dark); opacity: .8; }
#q::-webkit-search-cancel-button, #q::-webkit-search-decoration { -webkit-appearance: none; }
#q:focus { outline: none; border-color: var(--black); background: var(--white); }
.clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent; border-radius: 50%;
  color: var(--dark); display: grid; place-items: center;
}
.clear:hover { background: rgba(58,63,74,.1); }
.near-me {
  height: 48px; padding: 0 14px; border: 0; border-radius: var(--radius);
  background: var(--black); color: var(--white);
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 14px; white-space: nowrap;
}
.near-me svg { width: 16px; height: 16px; }
.near-me:hover { background: var(--dark); }
.near-me[aria-busy="true"] { opacity: .7; pointer-events: none; }

.panel-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; min-height: 28px; }
.results-label { margin: 0; font-size: 13px; color: var(--dark); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.retailer-filter { position: relative; flex: none; }
.retailer-filter select {
  height: 28px; padding: 0 26px 0 10px; border: 1px solid var(--rule-strong); border-radius: 6px;
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%233A3F4A' stroke-width='1.5'/></svg>") no-repeat right 9px center;
  font-size: 13px; font-weight: 500; max-width: 180px;
  -webkit-appearance: none; appearance: none;
}
.retailer-filter select:hover { border-color: var(--dark); }

.panel-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- list ---------- */
.store-list { list-style: none; margin: 0; padding: 0; }
.store-list li { border-bottom: 1px solid var(--rule); }
.row {
  width: 100%; text-align: left; border: 0; background: transparent;
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px;
  padding: 14px 20px;
}
.row:hover, .row.is-active { background: var(--light); }
.row:focus-visible { outline-offset: -2px; }
.row-name { font-weight: 500; font-size: 15px; line-height: 1.3; }
.row-dist { font-size: 13px; color: var(--dark); white-space: nowrap; padding-top: 2px; }
.row-addr { grid-column: 1 / -1; font-size: 13.5px; color: var(--dark); line-height: 1.4; }
.row-status { grid-column: 1 / -1; font-size: 13px; line-height: 1.4; }
.row-status.open { color: var(--black); }
.row-status.closed { color: var(--dark); }
.list-more { display: block; width: calc(100% - 40px); margin: 14px 20px 20px; height: 40px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); font-weight: 500; font-size: 14px; }
.list-more:hover { background: var(--light); }
.empty { margin: 0; padding: 28px 20px; color: var(--dark); font-size: 14px; }
.empty strong { color: var(--black); font-weight: 500; }

/* ---------- detail ---------- */
.store-detail { padding: 18px 20px 28px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 0;
  font-size: 13px; font-weight: 500; color: var(--dark); margin-bottom: 14px;
}
.back svg { width: 14px; height: 14px; }
.back:hover { color: var(--black); }
.detail-head { display: flex; align-items: flex-start; gap: 14px; }
.logo {
  flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--light);
  display: grid; place-items: center; overflow: hidden; border: 1px solid var(--rule);
}
.logo img { width: 30px; height: 30px; object-fit: contain; display: block; }
.logo .mono { font-weight: 700; font-size: 18px; color: var(--black); }
.detail-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: 0; }
.detail-retailer { margin: 2px 0 0; font-size: 13px; color: var(--dark); }
.detail-status { margin: 16px 0 0; font-size: 14px; font-weight: 500; }
.detail-status.closed { color: var(--dark); }
.detail-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.detail-label { display: block; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--dark); margin-bottom: 6px; }
.detail-text { margin: 0; font-size: 15px; line-height: 1.45; }
.detail-text a { text-decoration: none; }
.detail-text a:hover { text-decoration: underline; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours td { padding: 3px 0; vertical-align: top; }
.hours td:first-child { width: 72px; color: var(--dark); }
.hours tr.today td { font-weight: 500; color: var(--black); }
.hours-toggle { margin-top: 8px; border: 0; background: transparent; padding: 0; font-size: 13px; font-weight: 500; color: var(--dark); text-decoration: underline; text-underline-offset: 3px; }
.hours-toggle:hover { color: var(--black); }
.products { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.products li { font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: var(--light); }
.fine { margin: 8px 0 0; font-size: 12px; color: var(--dark); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.btn {
  height: 44px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 500; font-size: 14px; text-decoration: none; border: 1px solid var(--black); padding: 0 12px;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--dark); border-color: var(--dark); }
.btn-secondary { background: var(--white); color: var(--black); }
.btn-secondary:hover { background: var(--light); }
.actions .btn[hidden] { display: none; }

/* ---------- map UI ---------- */
.map-controls { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.map-btn {
  width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--white); color: var(--black);
  display: grid; place-items: center; box-shadow: 0 1px 2px rgba(34,44,51,.3), 0 4px 14px rgba(34,44,51,.25);
}
.map-btn svg { width: 18px; height: 18px; }
.map-btn:hover { background: var(--light); }
.map-btn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.map-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: var(--light); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; pointer-events: none;
  opacity: .9; transition: opacity .3s;
}
.map-loading[hidden] { display: none; }
.map-notice {
  position: absolute; left: 14px; right: 14px; bottom: 34px; margin: 0 auto; max-width: 420px;
  background: var(--white); color: var(--black); padding: 12px 14px; border-radius: var(--radius);
  font-size: 13px; box-shadow: 0 4px 18px rgba(34,44,51,.3); z-index: 4;
}
.map-notice[hidden] { display: none; }

/* markers: single stores are spheres carrying the mark; clusters are cubes with a count.
   Flat by design: a light disc with the mark, no outline and no dark drop shadow. */
.maplibregl-marker { will-change: transform; }
.pin {
  width: var(--pin); height: var(--pin); border-radius: 50%; border: 0; padding: 0;
  background: var(--light); color: var(--black);
  display: grid; place-items: center;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.pin svg { width: 68%; height: 68%; display: block; }
.pin:hover, .pin.is-hover { transform: scale(1.14); }
.pin.is-selected { transform: scale(1.35); background: var(--white); box-shadow: 0 0 0 7px rgba(239,242,244,.28); }
.pin:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }
.cluster {
  --size: 34px;
  width: var(--size); height: var(--size); border: 0; padding: 0; border-radius: 9px;
  background: var(--light); color: var(--black);
  font-weight: 500; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
  transition: transform .18s var(--ease);
}
.cluster.lg { --size: 40px; font-size: 14px; border-radius: 10px; }
.cluster.xl { --size: 46px; font-size: 15px; border-radius: 12px; }
.cluster:hover { transform: scale(1.08); background: var(--white); }
.cluster:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }
.origin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--light); box-shadow: 0 0 0 5px rgba(239,242,244,.3); }

/* MapLibre chrome restyled to the palette */
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 11px; background: rgba(34,44,51,.75) !important; color: var(--light); border-radius: 6px 0 0 0; }
.maplibregl-ctrl-attrib a { color: var(--light); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(34,44,51,.85) !important; border-radius: 12px; }
.maplibregl-ctrl-attrib.maplibregl-compact-show { border-radius: 6px; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-bottom-right { z-index: 3; }
.maplibregl-canvas:focus { outline: none; }

/* ---------- footer (standalone) ---------- */
.site-footer { display: none; }

/* ---------- mobile: map full-bleed, panel becomes a bottom sheet ---------- */
@media (max-width: 899px) {
  :root { --header-h: 60px; --panel-w: 100%; }
  .site-header { gap: 14px; padding: 0 16px; }
  .brand img { height: 18px; }
  .headline { font-size: 17px; }
  .store-count { display: none; }
  .all-stores { margin-left: auto; }
  .locator { display: block; }
  .map-wrap { position: absolute; inset: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: var(--sheet-h, 46%);
    border-right: 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 24px rgba(34,44,51,.28);
    transition: height .28s var(--ease);
    touch-action: none;
  }
  .panel.is-dragging { transition: none; }
  .panel.peek { height: 132px; }
  .panel.half { height: 46%; }
  .panel.full { height: calc(100% - 12px); }
  .sheet-handle {
    display: block; width: 100%; height: 22px; border: 0; background: transparent; padding: 8px 0 0; position: relative; cursor: grab;
  }
  .sheet-handle::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(58,63,74,.35); margin: 0 auto; }
  .panel-top { padding: 4px 16px 10px; }
  .panel-body { touch-action: pan-y; }
  .panel.peek .panel-body { overflow: hidden; }
  .row, .store-detail { padding-left: 16px; padding-right: 16px; }
  .map-controls { top: 10px; right: 10px; }
  .map-btn { width: 38px; height: 38px; }
  .map-notice { bottom: auto; top: 10px; left: 10px; right: 58px; }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--sheet-h, 46%) + 4px); transition: bottom .28s var(--ease); }
  .panel.peek ~ .map-wrap .maplibregl-ctrl-bottom-right { bottom: 136px; }
  .panel.full ~ .map-wrap .maplibregl-ctrl-bottom-right { display: none; }
  .detail-title { font-size: 19px; }
}

@media (max-width: 420px) {
  .near-me span { display: none; }
  .near-me { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* print: just the list */
@media print {
  body { overflow: visible; }
  .map-wrap, .search, .map-controls, .sheet-handle { display: none !important; }
  .locator { display: block; height: auto; }
  .panel { position: static; height: auto; border: 0; box-shadow: none; }
  .panel-body { overflow: visible; }
}

/* ---------- light basemap variant (CONFIG.mapTheme = 'light' or ?map=light) ---------- */
html[data-map="light"] .map-wrap { background: var(--light); }
html[data-map="light"] .pin { background: var(--black); color: var(--white); }
html[data-map="light"] .pin.is-selected { background: var(--black); box-shadow: 0 0 0 7px rgba(34,44,51,.2); }
html[data-map="light"] .pin:focus-visible, html[data-map="light"] .cluster:focus-visible, html[data-map="light"] .map-btn:focus-visible { outline-color: var(--black); }
html[data-map="light"] .cluster { background: var(--black); color: var(--white); }
html[data-map="light"] .cluster:hover { background: var(--dark); }
html[data-map="light"] .origin-dot { background: var(--black); box-shadow: 0 0 0 5px rgba(34,44,51,.2); }
html[data-map="light"] .map-btn { border: 1px solid var(--rule-strong); box-shadow: 0 1px 2px rgba(34,44,51,.12), 0 4px 14px rgba(34,44,51,.12); }
html[data-map="light"] .map-loading { color: var(--dark); }
html[data-map="light"] .maplibregl-ctrl-attrib { background: rgba(239,242,244,.85) !important; color: var(--dark); }
html[data-map="light"] .maplibregl-ctrl-attrib a { color: var(--dark); }
html[data-map="light"] .maplibregl-ctrl-attrib-button { filter: none; }
