/* The /map page. Shares the shell and card styles with listing.css; this file
   only adds the map itself, the search bar above it and the pin/cluster look. */

main.wide { max-width: 1180px; }

.maphead h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 14px; }

.mapbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
}

/* Input, button and .mapopt styles are shared with the /parts filter bar and
   live in listing.css, which this page loads too. */
.mapbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: var(--card);
}

.mapbar .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-sizing: border-box;
}

.dot-part { background: var(--coral); }
.dot-shop { background: var(--navy); }

#status { margin: 0 0 14px; }

#map {
  height: 62vh;
  min-height: 380px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #e9edf2;
}

/* Every pin is a circle: coral for parts, navy for shops — matching their
   clusters. box-sizing and the fixed square sizes are explicit so a border
   can never squash a dot into an oval. */
.pin-part,
.pin-shop {
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pin-part { background: var(--coral); }
.pin-shop { background: var(--navy); }

.cluster {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cluster-parts { background: var(--coral); }
.cluster-shops { background: var(--navy); }

/* Sizes as classes because the CSP allows no inline styles. */
.cluster-s { width: 30px; height: 30px; }
.cluster-m { width: 36px; height: 36px; }
.cluster-l { width: 42px; height: 42px; }

.leaflet-popup-content { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.leaflet-popup-content img { width: 100%; border-radius: 8px; display: block; margin: 0 0 8px; }
.leaflet-popup-content .p-price { color: var(--coral); font-weight: 800; margin: 0; }
.leaflet-popup-content .p-title { font-weight: 600; margin: 2px 0; }
.leaflet-popup-content .p-sub { color: var(--muted); margin: 0 0 6px; }

.mapresults { margin-top: 28px; }
.mapresults h2 { font-size: 1.2rem; margin: 0 0 14px; }

.shoprow {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.shoprow a { color: var(--ink); font-weight: 600; text-decoration: none; }
.shoprow a:hover { color: var(--coral); }
.shoprow span { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.dist { color: var(--muted); font-weight: 400; }

@media (max-width: 760px) {
  .maphead h1 { font-size: 1.5rem; }
  #map { height: 55vh; min-height: 320px; }
}
