/* =========================================================
   3@1 Store Finder — layout + brand styling for Leaflet UI
   ========================================================= */

/* App layout: dashboard — list panel | (compact title over map) */
.finder {
  display: grid; grid-template-columns: 560px 1fr;
  height: calc(100vh - 64px); min-height: 540px; border-top: 4px solid var(--yellow);
}
.finder__panel { display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); min-height: 0; min-width: 0; }
.finder__mapcol { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.finder__title {
  background: radial-gradient(140% 260% at 50% 30%,
    #0d5aa8 0%, #0a4187 30%, #062c66 60%, #041d49 85%, #020e2b 100%);
  color: #fff; padding: .9rem 1.5rem;
}
.finder__title .eyebrow--light {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .76rem; letter-spacing: .22em; text-transform: uppercase;
  color: #FFC510; text-shadow: 0 0 14px rgba(255,197,16,.35);
}
.finder__title .eyebrow--light::before { content: "▸ "; color: #00AEEF; }
.finder__title .eyebrow { margin: 0 0 .15rem; }
.finder__title h1 {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem); margin: 0; line-height: 1.05;
}
.finder__map { flex: 1; min-height: 0; background: var(--tint); z-index: 1; }

/* Controls — single smart search bar + region chips */
.finder__controls { padding: 1rem 1.1rem .6rem; border-bottom: 1px solid var(--line); background: var(--tint); }
.btn--sm { padding: .6rem .9rem; font-size: .85rem; white-space: nowrap; }

.searchbar {
  position: relative; display: flex; align-items: center; gap: .35rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: .3rem .4rem .3rem .95rem; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.searchbar:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,49,121,.12); }
.searchbar__icon { flex: 0 0 auto; color: var(--grey-light); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; padding: .5rem .2rem; }
.searchbar input:focus { outline: 0; }
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.searchbar__clear {
  flex: 0 0 auto; display: flex; border: 0; background: none; color: var(--grey-light);
  cursor: pointer; padding: .35rem; border-radius: 50%;
}
.searchbar__clear:hover { color: var(--red); background: var(--tint); }
.searchbar__clear[hidden] { display: none; }
.searchbar__sep { flex: 0 0 auto; width: 1px; align-self: stretch; margin: .35rem .1rem; background: var(--line); }
.searchbar__gps {
  flex: 0 0 auto; display: flex; align-items: center; gap: .4rem; border: 0; cursor: pointer;
  background: var(--navy); color: #fff; font: inherit; font-size: .82rem; font-weight: 700;
  padding: .5rem .85rem; border-radius: 999px; white-space: nowrap; transition: background .12s ease;
}
.searchbar__gps:hover { background: var(--navy-deep); }
.searchbar__gps[disabled] { opacity: .6; cursor: wait; }

/* Typeahead suggestions */
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 900;
  margin: 0; padding: .35rem; list-style: none; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.16); max-height: 340px; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.sug { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 9px; cursor: pointer; }
.sug:hover, .sug.is-hot { background: var(--tint); }
.sug__mark { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sug__ico {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; background: var(--tint); color: var(--navy);
}
.sug--geo .sug__ico { background: var(--yellow); }
.sug__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sug__txt b { color: var(--navy); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug__txt small { color: var(--grey); font-size: .76rem; }

/* Region chips */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0 .15rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  font: inherit; font-size: .8rem; font-weight: 700; padding: .35rem .75rem; border-radius: 999px;
  cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.chip:hover { border-color: var(--navy); }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip__n { font-size: .7rem; font-weight: 800; background: var(--tint); color: var(--grey); padding: .05rem .4rem; border-radius: 999px; }
.chip.is-on .chip__n { background: rgba(255,255,255,.18); color: #fff; }

.finder__meta { display: flex; justify-content: flex-end; padding: .3rem 0 0; }
.finder__count { font-size: .8rem; font-weight: 700; color: var(--grey); white-space: nowrap; }

/* "Your nearest" banner */
.finder__nearest[hidden] { display: none; }
.finder__nearest {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1.1rem; background: #fff7e0; border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--red); cursor: pointer;
}
.nearest__mark { border-radius: 50%; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.nearest__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nearest__label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--red); }
.nearest__txt strong { color: var(--navy); font-size: 1.05rem; }
.nearest__d { font-size: .82rem; color: var(--grey); }
.finder__nearest .btn { flex: 0 0 auto; }

/* Results list */
.finder__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.store {
  padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); cursor: pointer;
  border-left: 4px solid transparent; transition: background .12s ease, border-color .12s ease;
}
.store:hover { background: var(--tint); }
.store.is-active { background: #fff7e0; border-left-color: var(--red); }
.store__head { display: flex; align-items: center; gap: .55rem; }
.store__mark { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.store__name { flex: 1; min-width: 0; font-size: 1rem; color: var(--navy); margin: 0; line-height: 1.2; }
.store__name a { color: inherit; text-decoration: none; }
.store__name a:hover { color: var(--red); text-decoration: underline; }
.store__ext { font-size: .72em; color: var(--grey-light); font-weight: 700; }
.store__dist {
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 800;
  padding: .15rem .5rem; border-radius: 999px; white-space: nowrap;
}
/* address + hours + actions indent under the name (past the 34px logo) */
.store__addr { margin: .25rem 0 .25rem calc(34px + .55rem); font-size: .86rem; color: var(--grey); line-height: 1.3; }
.store__hours { margin: 0 0 .4rem calc(34px + .55rem); padding: 0; font-size: .8rem; color: var(--grey); line-height: 1.5; }
.store__hours-row { white-space: nowrap; }
.store__hours-row b { color: var(--ink); font-weight: 700; }
.store__hours-sep { color: var(--grey-light); margin: 0 .35rem; }
.pop__hours { font-size: .8rem; color: var(--grey); line-height: 1.45; }
.store__region { display: inline-block; margin-left: .4rem; font-size: .72rem; font-weight: 700; color: var(--grey-light); }
.store__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: calc(34px + .55rem); }
.store__btn {
  font-size: .8rem; font-weight: 700; padding: .35rem .7rem; border-radius: 999px;
  background: var(--tint); color: var(--navy); border: 1px solid var(--line);
}
.store__btn:hover { background: var(--navy); color: #fff; }
.store__btn--dir { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.store__btn--dir:hover { background: var(--orange); color: #fff; }
.finder__empty { padding: 2rem 1.1rem; color: var(--grey); text-align: center; }

/* Custom brand pin — 3@1 roundel badge (Leaflet divIcon) */
.pin3 { background: none; border: 0; }
.pin3__badge {
  width: 40px; height: 40px; border-radius: 50%; background: #fff;
  border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.35);
  overflow: hidden; display: block;
}
.pin3__badge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin3__tail {
  display: block; width: 0; height: 0; margin: -1px auto 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 11px solid #fff; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3));
}
.pin3--active { z-index: 1000 !important; }
.pin3--active .pin3__badge { width: 50px; height: 50px; border-color: var(--navy); box-shadow: 0 7px 18px rgba(0,0,0,.5); }
.pin3--active .pin3__tail { border-top-color: var(--navy); }

/* Cluster = roundel pin + app-style notification badge (top-right) */
.cluster-badge {
  position: absolute; top: -5px; right: -7px;
  min-width: 21px; height: 21px; padding: 0 5px; box-sizing: border-box;
  background: var(--red); color: #fff; border: 2px solid #fff; border-radius: 999px;
  font-family: var(--font-body); font-weight: 800; font-size: .74rem; line-height: 17px;
  text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
.cluster-pin:hover .pin3__badge { box-shadow: 0 6px 14px rgba(0,0,0,.5); }

/* Leaflet popup brand */
.leaflet-popup-content-wrapper { border-radius: 12px; }
.pop { display: flex; flex-direction: column; gap: .25rem; font-family: var(--font-body); }
.pop strong { color: var(--navy); font-size: 1rem; display: flex; align-items: center; gap: .4rem; }
.pop__mark { border-radius: 50%; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.pop span { color: var(--grey); font-size: .85rem; }
.pop a { font-weight: 700; font-size: .85rem; }
.pop__dir { color: var(--red); }

/* Responsive: stack map (with title) over list */
@media (max-width: 820px) {
  .finder { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .finder__mapcol { order: -1; }
  .finder__map { flex: 0 0 300px; height: 300px; }
  .finder__panel { border-right: 0; }
  .finder__list { max-height: 60vh; }
  #gps-label { display: none; }                 /* GPS icon-only on small screens */
  .searchbar__gps { padding: .5rem .6rem; }
}

/* ===== stark pass (2026-07-06) ===== */


/* radial halftone over the map header band */
.finder__title { position: relative; overflow: hidden; }
.finder__title::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: #bfe6ff; opacity: .08;
  -webkit-mask-image: url(../assets/textures/halftone-03.svg);
          mask-image: url(../assets/textures/halftone-03.svg);
  -webkit-mask-size: 120% auto; mask-size: 120% auto;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.finder__title .eyebrow, .finder__title h1 { position: relative; z-index: 1; }

/* store list: navy tint gradient cards (10% -> 20%), darker on hover, white when selected */
.store { background: linear-gradient(90deg, rgba(13,90,168,.15), rgba(13,90,168,.06)); border-bottom-color: rgba(0,49,121,.15); }
.store:hover { background: linear-gradient(90deg, rgba(13,90,168,.23), rgba(13,90,168,.14)); }
.store .store__btn { background: #fff; color: var(--navy); border-color: #fff; }
.store .store__btn--dir { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.store .store__btn, .store .store__btn--dir { transition: transform .15s ease, box-shadow .15s ease; }
.store .store__btn:hover, .store .store__btn--dir:hover {
  background: inherit; /* no colour shift */
  transform: translateY(-1.5px);
  box-shadow: 0 5px 12px rgba(0,20,50,.22);
}
.store .store__btn:hover { background: #fff; color: var(--navy); border-color: #fff; }
.store .store__btn--dir:hover { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }

.store.is-active, .store.is-active:hover { background: #fff; border-left-color: var(--red); }
.store.is-active .store__btn { background: var(--tint); color: var(--navy); border-color: var(--line); }

/* mobile: let hours wrap instead of clipping */
@media (max-width: 680px) {
  .store__hours-row { white-space: normal; }
}

/* WhatsApp pill (provisional — confirm per-store WhatsApp numbers with Chris) */
.store__btn--wa { background: #25D366; border-color: #25D366; color: #fff; display: inline-flex; align-items: center; gap: .35em; }
.store__btn--wa svg { width: 16px; height: 16px; }
.store .store__btn--wa { background: #25D366; border-color: #25D366; color: #fff; }
.store .store__btn--wa:hover { background: #1fbd5a; border-color: #1fbd5a; color: #fff; }
.store__btn--site { display: inline-flex; align-items: center; gap: .35em; }
.store__btn--site svg { width: 15px; height: 15px; }

/* ===== mobile app frame (2026-07-06 v2): sticky stack, page scrolls the list ===== */
@media (max-width: 820px) {
  .finder { display: flex; flex-direction: column; height: auto; min-height: 0; overflow: visible; }
  .finder__mapcol { display: contents; }
  .finder__title { order: -3; }
  .finder__map { order: -2; }
  /* slim sticky heading under the nav */
  .finder__title { position: sticky; top: 66px; z-index: 60; padding: .55rem 1rem .5rem; }
  .finder__title .eyebrow { display: none; }
  .finder__title h1 { font-size: 1.65rem; text-align: center; }
  /* sticky map below it */
  .finder__map {
    position: sticky; top: calc(66px + 44px); z-index: 50;
    height: clamp(140px, 23vh, 220px); min-height: 0; flex: none;
  }
  /* sticky search + slim chip strip below the map */
  .finder__controls {
    position: sticky; top: calc(66px + 44px + clamp(140px, 23vh, 220px) - 1px); z-index: 55;
    background: #fff; padding: .45rem .8rem .4rem; gap: .35rem;
    box-shadow: 0 8px 14px -12px rgba(2,14,43,.35);
  }
  .searchbar input { font-size: .95rem; }
  .chips { padding-bottom: .1rem; }
  .chip { font-size: .74rem; padding: .24rem .6rem; }
  .finder__meta { display: none; }
  .finder__nearest { margin: 0; }
  /* list flows with the page — at least two cards visible */
  .finder__panel { display: block; border-right: 0; min-height: 0; }
  .finder__list { max-height: none; overflow: visible; }
  .store { padding: .6rem .9rem; }
  .store__name { font-size: .95rem; }
  .store__addr { font-size: .8rem; margin-bottom: .2rem; }
  .store__hours { font-size: .74rem; margin-bottom: .3rem; }
  .store__btn { font-size: .76rem; padding: .3rem .6rem; }
}

/* footer seam: body shows through in the 3rem band above .pbar — navy so the bar sits on dark like every other page */
body { background: var(--abyss); }

/* --- 4-button action row: keep on one line; shrink then go icon-only as the panel tightens --- */
.store__btn { white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
@media (max-width: 1180px) {
  .store__btn { font-size: .7rem; padding: .32rem .55rem; }
}
@media (max-width: 1000px) and (min-width: 821px) {
  .store__btn-label { display: none; }
  .store__btn { padding: .38rem .6rem; }
}
