/* Store locator — theme-aware (site tokens), matches section-block chrome */

.store-locator-block {
  width: 100%;
}

.store-locator {
  --store-locator-border: var(--border-color, #494e4e);
  --store-locator-border-strong: var(--border-color-strong, var(--border-color, #5c6363));
  --store-locator-surface: var(--surface-bg, #2f3232);
  --store-locator-surface-hover: var(--surface-bg-hover, color-mix(in srgb, var(--accent-primary, #f5b335) 12%, var(--surface-bg, #2f3232)));
  --store-locator-page: var(--page-bg-elevated, var(--page-bg, transparent));
  --store-locator-text: var(--text-primary, inherit);
  --store-locator-muted: var(--text-muted, #b5b2ad);
  --store-locator-accent: var(--accent-primary, var(--accent-gold, #f5b335));
  --store-locator-on-accent: var(--accent-on-primary, var(--btn-primary-text, #1a1a1b));
  --store-locator-radius: var(--radius-md, 12px);
  --store-locator-radius-sm: var(--radius-sm, 8px);
  color: var(--store-locator-text);
}

.store-locator-shell {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: var(--store-map-height, 480px);
}

.store-locator-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--store-locator-border);
  border-radius: var(--store-locator-radius);
  background: var(--store-locator-page);
  overflow: hidden;
  box-shadow: var(--shadow-sm, none);
}

.store-locator-toolbar {
  padding: 0.85rem 0.9rem 0.65rem;
  border-bottom: 1px solid var(--store-locator-border);
  display: grid;
  gap: 0.55rem;
  background: color-mix(in srgb, var(--store-locator-surface) 55%, transparent);
}

.store-locator-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.store-locator .store-locator-search,
.store-locator .store-locator-region {
  background: var(--input-bg, var(--store-locator-surface));
  border-color: var(--input-border, var(--store-locator-border));
  color: var(--input-text, var(--store-locator-text));
}

.store-locator .store-locator-search::placeholder {
  color: var(--input-placeholder, var(--store-locator-muted));
}

.store-locator .store-locator-search:focus,
.store-locator .store-locator-region:focus {
  border-color: color-mix(in srgb, var(--store-locator-accent) 65%, var(--store-locator-border));
  box-shadow: var(--focus-ring, 0 0 0 3px color-mix(in srgb, var(--store-locator-accent) 35%, transparent));
}

.store-locator-region {
  flex: 1 1 8rem;
  min-width: 0;
}

.store-locator-locate {
  white-space: nowrap;
  background: var(--btn-primary-bg, var(--store-locator-accent));
  border-color: var(--btn-primary-border, var(--store-locator-accent));
  color: var(--btn-primary-text, var(--store-locator-on-accent));
}

.store-locator-locate:hover:not(:disabled),
.store-locator-locate:focus-visible:not(:disabled) {
  background: var(--btn-primary-hover-bg, color-mix(in srgb, var(--btn-primary-bg, var(--store-locator-accent)) 88%, #fff));
  border-color: var(--btn-primary-border, var(--store-locator-accent));
  color: var(--btn-primary-text, var(--store-locator-on-accent));
}

.store-locator-locate:disabled {
  opacity: 0.65;
}

.store-locator-hint {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--store-locator-muted);
}

.store-locator-hint.is-error {
  color: var(--accent-rust, #d4633f);
}

.store-locator-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: calc(var(--store-map-height, 480px) - 7.5rem);
}

.store-locator-card {
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--store-locator-radius-sm);
  background: transparent;
  padding: 0.7rem 0.75rem;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.store-locator-card:hover,
.store-locator-card:focus-visible {
  background: var(--store-locator-surface-hover);
  border-color: color-mix(in srgb, var(--store-locator-accent) 30%, var(--store-locator-border));
  outline: none;
}

.store-locator-card.is-selected {
  background: color-mix(in srgb, var(--store-locator-accent) 14%, var(--store-locator-surface));
  border-color: color-mix(in srgb, var(--store-locator-accent) 55%, var(--store-locator-border));
  box-shadow: inset 3px 0 0 var(--store-locator-accent);
}

.store-locator-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.store-locator-card-name {
  font-weight: 650;
  line-height: 1.3;
  color: var(--heading-color, var(--store-locator-text));
}

.store-locator-card-distance {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--store-locator-accent);
  letter-spacing: 0.01em;
}

.store-locator-card-address,
.store-locator-card-meta {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: var(--store-locator-muted);
  line-height: 1.35;
}

.store-locator-count {
  padding: 0.45rem 0.9rem 0.65rem;
  font-size: 0.78rem;
  color: var(--store-locator-muted);
  border-top: 1px solid var(--store-locator-border);
}

.store-locator-empty {
  padding: 1.25rem 0.85rem;
  color: var(--store-locator-muted);
}

.store-locator-map-wrap {
  min-height: var(--store-map-height, 480px);
  border: 1px solid var(--store-locator-border);
  border-radius: var(--store-locator-radius);
  overflow: hidden;
  background: var(--store-locator-surface);
  box-shadow: var(--shadow-sm, none);
}

.store-locator-map {
  width: 100%;
  height: var(--store-map-height, 480px);
  background: var(--store-locator-surface);
}

/* Leaflet chrome: match site surfaces in light/dark */
.store-locator .leaflet-container {
  font: inherit;
  background: var(--store-locator-surface);
  /* Wheel zoom stays on the map instead of scrolling the page/modal. */
  overscroll-behavior: contain;
}

.store-locator .leaflet-control-attribution {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 0.35rem 0.15rem !important;
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--store-locator-muted);
  opacity: 0.45;
  max-width: 9rem;
  text-align: right;
}

.store-locator .leaflet-control-attribution:hover {
  opacity: 0.9;
}

.store-locator .leaflet-control-attribution a {
  color: inherit;
  text-decoration: none;
}

.store-locator .leaflet-control-attribution a:hover {
  text-decoration: underline;
}

.store-locator .leaflet-control-zoom a {
  background: var(--store-locator-page) !important;
  color: var(--store-locator-text) !important;
  border-color: var(--store-locator-border) !important;
}

.store-locator .leaflet-control-zoom a:hover {
  background: var(--store-locator-surface-hover) !important;
  color: var(--store-locator-accent) !important;
}

.store-locator .leaflet-popup-content-wrapper,
.store-locator .leaflet-popup-tip {
  background: var(--store-locator-page);
  color: var(--store-locator-text);
  box-shadow: var(--shadow-md, 0 12px 32px rgba(0, 0, 0, 0.2));
}

.store-locator .leaflet-popup-content-wrapper {
  border: 1px solid var(--store-locator-border);
  border-radius: var(--store-locator-radius-sm);
}

.store-locator .leaflet-popup-content {
  margin: 0.75rem 0.85rem;
  color: var(--store-locator-text);
}

.store-locator .leaflet-container a.leaflet-popup-close-button {
  color: var(--store-locator-muted);
}

.store-locator-popup {
  font-size: 0.9rem;
  line-height: 1.35;
  max-width: 16rem;
}

.store-locator-popup strong {
  color: var(--heading-color, var(--store-locator-text));
}

.store-locator-popup-dist {
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--store-locator-accent);
}

.store-admin-table {
  max-height: 70vh;
  overflow: auto;
}

@media (max-width: 991.98px) {
  .store-locator-shell {
    grid-template-columns: 1fr;
  }

  .store-locator-list {
    max-height: 22rem;
  }

  .store-locator-map-wrap,
  .store-locator-map {
    min-height: 18rem;
    height: 18rem;
  }
}
