/* =========================================================
   Store locator — list + map, and the single-store page
   ========================================================= */

/* ---------- Controls ---------- */
.locator-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: end;
}
.locator-search { position: relative; }
.locator-search .input { padding-left: 46px; }
.locator-search svg {
  position: absolute;
  left: var(--s-4);
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-45);
  pointer-events: none;
}
.locator-clear {
  position: absolute;
  right: var(--s-2); top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  color: var(--ink-70);
}
.locator-clear:hover { background: rgba(28,29,33,.07); color: var(--ink); }

.state-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.locator-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.locator-count { font-family: var(--font-head); font-size: var(--t-sm); }
.locator-note { font-size: var(--t-xs); color: var(--ink-70); }

/* ---------- Two-pane layout ---------- */
.locator {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
  margin-top: var(--s-5);
}
.locator-results {
  max-height: 68vh;
  overflow-y: auto;
  padding-right: var(--s-2);
  scrollbar-width: thin;
}
.locator-results::-webkit-scrollbar { width: 8px; }
.locator-results::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: var(--r-full);
}

/* sticky map so it stays in view while the list scrolls */
.locator-map-wrap { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
#map {
  height: 68vh;
  min-height: 460px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--sand-deep);
  z-index: 0;
}
.map-note {
  margin-top: var(--s-2);
  font-size: var(--t-xs);
  color: var(--ink-70);
  text-align: right;
}

/* ---------- Store card ---------- */
.store {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-3);
  transition: border-color .18s, box-shadow .18s, transform .14s;
}
.store:hover { box-shadow: var(--shadow-md); border-left-color: var(--red); transform: translateY(-1px); }
.store.is-active {
  border-left-color: var(--red);
  box-shadow: var(--shadow-md);
  background: color-mix(in srgb, var(--sand) 45%, var(--white));
}
.store-top {
  display: flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.store-name { font-size: var(--t-md); font-family: var(--font-head); }
.store-dist {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: var(--t-xs);
  color: var(--red-text);
  white-space: nowrap;
}
.store-addr { font-size: var(--t-sm); color: var(--ink-70); margin: 0 0 var(--s-3); }
.store-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.store-actions .btn { min-height: 38px; padding: var(--s-2) var(--s-4); font-size: var(--t-xs); }

.locator-empty {
  text-align: center;
  padding: var(--s-8) var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--white);
}
.locator-empty h3 { font-size: var(--t-lg); margin-bottom: var(--s-2); }
.locator-empty p { color: var(--ink-70); font-size: var(--t-sm); }

/* skeleton while the data loads */
.skeleton { border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-3); }
.skeleton-line {
  height: 12px; border-radius: var(--r-full); margin-bottom: var(--s-3);
  background: linear-gradient(90deg, #ece4df 25%, #f6f1ee 37%, #ece4df 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skeleton-line:nth-child(1) { width: 55%; }
.skeleton-line:nth-child(2) { width: 90%; }
.skeleton-line:nth-child(3) { width: 40%; margin-bottom: 0; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Leaflet overrides ---------- */
.leaflet-container { font-family: var(--font-body); border-radius: var(--r-md); }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.leaflet-popup-content { margin: var(--s-4); font-size: var(--t-sm); }
.leaflet-popup-content strong { font-family: var(--font-head); display: block; margin-bottom: 4px; }
.leaflet-popup-content a { color: var(--red-text); text-decoration: underline; }

.pin {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transform: rotate(-45deg);
  transition: background-color .15s, transform .15s;
}
.pin.is-active { background: var(--ink); transform: rotate(-45deg) scale(1.25); }
.cluster {
  display: grid; place-items: center;
  background: var(--red);
  color: var(--white);
  border: 3px solid rgba(255,255,255,.85);
  border-radius: var(--r-full);
  font-family: var(--font-head);
  font-size: var(--t-xs);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* =========================================================
   Single store page
   ========================================================= */
.store-hero { background: var(--sand); padding-block: var(--s-6) var(--s-7); }
.store-hero h1 { font-size: var(--t-2xl); margin-block: var(--s-2) var(--s-3); }
.store-hero .store-addr { font-size: var(--t-md); max-width: 54ch; }

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
#store-map {
  height: 420px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--sand-deep);
  z-index: 0;
}
.detail-list { display: grid; gap: var(--s-5); }
.detail-list dt {
  font-family: var(--font-head);
  font-size: var(--t-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red-text);
  margin-bottom: var(--s-1);
}
.detail-list dd { margin: 0; font-size: var(--t-base); line-height: 1.6; }
.detail-list a:hover { text-decoration: underline; }

.store-aside { position: sticky; top: calc(var(--header-h) + var(--s-4)); display: grid; gap: var(--s-4); }
.store-aside .card { padding: var(--s-5); }
.nearby li + li { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.nearby a { display: block; }
.nearby a:hover .nearby-name { color: var(--red-text); }
.nearby-name { font-family: var(--font-head); font-size: var(--t-sm); }
.nearby-meta { font-size: var(--t-xs); color: var(--ink-70); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .locator { grid-template-columns: 1fr; }
  .locator-map-wrap { position: static; order: -1; }
  #map { height: 380px; min-height: 0; }
  .locator-results { max-height: none; overflow: visible; padding-right: 0; }
  .store-layout { grid-template-columns: 1fr; }
  .store-aside { position: static; }
}
@media (max-width: 640px) {
  .locator-controls { grid-template-columns: 1fr; }
  .locator-controls .btn { width: 100%; }
}

/* chip label + count need breathing room */
.chip > .muted { margin-left: .45em; font-size: var(--t-xs); }
.chip[aria-pressed="true"] > .muted { color: rgba(255,255,255,.75); }

/* ---------- Opening hours ---------- */
.hours { width: 100%; border-collapse: collapse; margin-top: var(--s-1); }
.hours th, .hours td {
  text-align: left;
  font-weight: 400;
  font-size: var(--t-sm);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--line);
}
.hours th { color: var(--ink-70); width: 45%; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours tr.is-today th, .hours tr.is-today td { font-family: var(--font-head); color: var(--ink); }
.hours tr.is-today th::after { content: " · today"; color: var(--red-text); font-size: var(--t-xs); }
.hours-note { font-size: var(--t-xs); margin: var(--s-3) 0 0; }
