:root {
  --brand: #d21f1f;
  --brand-dark: #a91717;
  --text: #222;
  --muted: #6b6b6b;
  --border: #e6e6e6;
  --bg-soft: #f5f5f5;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #fff;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}
.header-inner { max-width: 1400px; margin: 0 auto; }
.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brand);
  text-decoration: none;
}
.logo-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
}
.logo-img {
  height: 50px;
  width: auto;
  display: block;
}

/* ---------- Main layout ---------- */
/* The list+map section has a bounded height so the showroom list gets
   its own internal scrollbar (instead of stretching the whole page to
   fit 80+ cards) — but the page itself still scrolls normally, so the
   footer etc. below it are reachable with a regular page scroll. */
.locator {
  display: grid;
  grid-template-columns: 420px 1fr;
  height: 1130px; /* tall enough that ~5 showroom cards show in the list
                     before it needs its own scroll; the page scrolls if
                     the viewport is shorter than this. */
}
@media (max-width: 900px) {
  .locator {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .locator-map { height: 420px; order: -1; }
}

.locator-panel {
  padding: 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.locator-title {
  font-size: 1.7rem;
  font-weight: 400;
  margin: 0 0 18px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 12px;
}

/* ---------- Search ---------- */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  gap: 10px;
  margin-bottom: 16px;
}
.search-box .icon-search { width: 18px; height: 18px; fill: #999; flex-shrink: 0; }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
}
.locate-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.locate-btn svg { width: 20px; height: 20px; fill: var(--muted); }
.locate-btn:hover svg { fill: var(--brand); }

/* ---------- Filters ---------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- Download button ---------- */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}
.download-btn svg { width: 18px; height: 18px; fill: #fff; }
.download-btn:hover { background: var(--brand-dark); }

/* ---------- Showroom list ---------- */
.showroom-list {
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
  padding-right: 4px;
}
.showroom-card {
  display: flex;
  gap: 14px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  scroll-margin-top: 8px;
}
.showroom-card:hover, .showroom-card.active { background: var(--bg-soft); }

.showroom-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.showroom-info { flex: 1; min-width: 0; }
.showroom-name {
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.showroom-name .pin { width: 14px; height: 14px; fill: var(--brand); flex-shrink: 0; }

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: .4px;
}
.badge.own { background: #fdecec; color: var(--brand-dark); }
.badge.dealer { background: #eef3ee; color: #3a6b3a; }

.showroom-address {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 6px;
  line-height: 1.4;
}
.showroom-area {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 6px;
}
.showroom-link {
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.showroom-link svg { width: 13px; height: 13px; fill: var(--brand); }
.showroom-link:hover { text-decoration: underline; }

.no-results {
  padding: 30px 6px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Map ---------- */
.locator-map { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }

.leaflet-popup-content { font-size: 0.85rem; line-height: 1.4; }
.leaflet-popup-content b { font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fafafa;
  padding: 28px 24px;
  text-align: center;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-logo {
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brand);
  margin-bottom: 8px;
}
.site-footer address {
  font-style: normal;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.footer-copy {
  margin-top: 12px;
  font-size: 0.78rem;
  color: #aaa;
}
