/* ==========================================================================
   Dealer locator – the live map and list (template-parts/dealer-finder.php).
   Hand-written for WordPress (not synced from site/): the design's map box,
   pins and rows are in pages/dealers.css; this adds the Leaflet map in that
   box, the region bar and the selected dealer's contact details.
   Leaflet's own stylesheet (schaffer-core) loads first.
   ========================================================================== */

/* Region bar: menu, "Use my location", status line ----------------------- */
.dealers-search--map { grid-template-columns: minmax(0, 340px) auto minmax(0, 1fr); }
.dealers-search__status { margin: 0; min-height: 52px; display: flex; align-items: center; font: 400 var(--fs-small)/1.5 var(--font); color: var(--muted); }
@media (max-width: 719px) {
  .dealers-search--map { grid-template-columns: 1fr; }
  .dealers-search__status { min-height: 0; }
}

/* Map: Leaflet inside the design's box, tiles faded like the design's map image. */
.dealers-map__canvas { position: absolute; inset: 0; z-index: 0; background: #e9ecef; font: 400 .75rem/1.5 var(--font); }
.dealers-map__canvas:focus-visible { outline-offset: -3px; }
.dealers-map__canvas .leaflet-tile-pane { filter: saturate(.35); opacity: .9; }
.dealers-map__zoom { z-index: 1; }
.dealers-map .leaflet-control-attribution { padding: 2px 6px; background: rgba(255, 255, 255, .85); color: var(--text); font: inherit; }
.dealers-map .leaflet-control-attribution a { color: var(--ink); }

/* Pins: the design's teardrop marker (.dealers-pin__marker) in a Leaflet icon. */
.dealers-marker { display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.dealers-marker.is-selected .dealers-pin__marker { width: 32px; height: 32px; background: var(--red); }
.dealers-you { width: 18px; height: 18px; border: 3px solid var(--white); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 6px rgba(17, 17, 17, .2); }

/* "Use two fingers" / "Click the map" hint over the map. */
.dealers-map__hint {
  position: absolute; inset: 0; z-index: 1; margin: 0; padding: 24px;
  display: grid; place-items: center; text-align: center; pointer-events: none;
  background: rgba(17, 17, 17, .55); color: var(--white); font: 700 var(--fs-ui)/1.3 var(--font);
}
.dealers-map__hint[hidden] { display: none; }

/* List ------------------------------------------------------------------- */
.dealers-row[hidden] { display: none; }
.dealers-row__dist:empty { display: none; }
.dealers-row__contact { flex-basis: 100%; list-style: none; margin: 0 0 6px; padding: 0; font: 400 var(--fs-small)/1.6 var(--font); color: var(--text); }
.dealers-row__contact a { color: var(--ink); }
.dealers-results__empty { margin: 0; padding: 20px 22px; font: 400 var(--fs-small)/1.5 var(--font); color: var(--muted); }
.dealers-results__empty[hidden] { display: none; }
.dealers-results__reset { display: inline-block; min-height: 24px; padding: 0; border: 0; background: none; color: var(--ink); font: 700 var(--fs-small)/1.5 var(--font); text-decoration: underline; cursor: pointer; }

/* Popup on the map for the selected dealer. */
.dealers-popup .leaflet-popup-content-wrapper { border-radius: 0; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.dealers-popup .leaflet-popup-content { margin: 14px 28px 14px 16px; font: 400 var(--fs-small)/1.5 var(--font); color: var(--text); }
.dealers-popup__name { display: block; margin-bottom: 2px; font: 700 1rem/1.25 var(--font); color: var(--ink); }
.dealers-popup__addr { display: block; }
.dealers-popup__links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.dealers-popup__links a { color: var(--ink); font-weight: 700; }
.dealers-popup .leaflet-popup-close-button { width: 32px; height: 32px; font: 400 1.25rem/32px var(--font); color: var(--ink); }
