:root {
  --kymco-red: #e30613;
  --kymco-red-dark: #ba0010;
  --ink: #17191d;
  --muted: #61656d;
  --line: #e4e6ea;
  --soft: #f5f6f8;
  --gold: #b98918;
  --shadow: 0 12px 32px rgba(20, 24, 31, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: #fff;
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.dealer-locator { min-height: 100vh; display: flex; flex-direction: column; }
.locator-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(460px, 760px);
  align-items: center;
  gap: 34px;
  min-height: 112px;
  padding: 20px clamp(22px, 4vw, 64px);
  color: #fff;
  background: linear-gradient(120deg, #11141a 0%, #232832 70%, #171a20 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.locator-header::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--kymco-red); }
.brand-block { display: flex; align-items: center; gap: 15px; min-width: 285px; }
.brand-logo { width: 98px; height: auto; display: block; filter: brightness(0) invert(1); }
.eyebrow { margin: 0 0 3px; color: #cfd2d8; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(22px, 2.2vw, 31px); line-height: 1.2; letter-spacing: .04em; }

.search-panel { display: grid; grid-template-columns: minmax(240px, 1fr) 170px auto; gap: 10px; align-items: center; }
.search-field, .select-field {
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.search-field:focus-within, .select-field:focus-within { outline: 3px solid rgba(227, 6, 19, .35); border-color: var(--kymco-red); }
.search-field svg { width: 21px; margin-left: 15px; fill: none; stroke: #70757d; stroke-linecap: round; stroke-width: 2; }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0 10px; background: transparent; }
.clear-search { width: 38px; border: 0; color: #777; background: transparent; font-size: 25px; cursor: pointer; }
.select-field select { width: 100%; min-height: 48px; padding: 0 34px 0 13px; border: 0; outline: 0; color: var(--ink); background: transparent; cursor: pointer; }
.showroom-filter { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border: 1px solid rgba(255,255,255,.26); border-radius: 8px; white-space: nowrap; cursor: pointer; }
.showroom-filter input { width: 18px; height: 18px; accent-color: var(--kymco-red); }
.showroom-filter span { font-size: 13px; font-weight: 700; }

.locator-body { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 430px; }
.map-column { position: relative; min-height: 620px; background: #e8eaed; }
#map { position: absolute; inset: 0; }
.map-legend {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 24px;
  display: flex;
  gap: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend img { width: 25px; height: 25px; object-fit: contain; }
.map-error { position: absolute; z-index: 3; inset: 24px 24px auto; margin: 0; padding: 14px 16px; border-radius: 8px; background: #fff; color: #9b0010; box-shadow: var(--shadow); }

.results-column { min-height: 0; border-left: 1px solid var(--line); background: var(--soft); }
.results-summary { display: flex; align-items: end; justify-content: space-between; height: 82px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.results-summary p { margin: 0; }
.results-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.results-summary strong { margin-right: 4px; color: var(--kymco-red); font-size: 28px; }
.results-summary span { font-size: 13px; }
.results-summary button, .empty-state button { padding: 7px 9px; border: 0; color: var(--muted); background: transparent; text-decoration: underline; cursor: pointer; }
.store-list { height: calc(100vh - 194px); min-height: 538px; padding: 12px; overflow-y: auto; overscroll-behavior: contain; }
.store-card { margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }
.store-card:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(23, 25, 29, .08); }
.store-card.is-selected { border-color: var(--kymco-red); box-shadow: 0 0 0 2px rgba(227, 6, 19, .12); }
.store-main { display: block; width: 100%; padding: 15px 16px 12px; border: 0; background: #fff; text-align: left; cursor: pointer; }
.store-badge { display: inline-block; margin-bottom: 7px; padding: 3px 7px; border: 1px solid #d2ae58; border-radius: 999px; color: #76530a; background: #fff8df; font-size: 10px; font-weight: 800; }
.store-name { display: block; font-size: 15px; font-weight: 800; line-height: 1.5; }
.store-address { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.store-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.action-button { display: flex; align-items: center; justify-content: center; min-height: 42px; border-right: 1px solid var(--line); color: #34373c; font-size: 12px; font-weight: 700; text-decoration: none; }
.action-button:last-child { border-right: 0; }
.action-button:hover { color: #fff; background: var(--kymco-red); }
.action-button.is-disabled { color: #a9acb1; background: #f5f5f5; pointer-events: none; }
.empty-state { padding: 52px 24px; color: var(--muted); text-align: center; }

.dealer-pin { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); transition: transform .15s; }
.dealer-pin:hover, .dealer-pin.is-selected { transform: scale(1.2); }
.gm-style-iw-chr { padding-top: 4px; }
.info-card { min-width: 230px; padding: 2px 2px 8px; }
.info-card strong { display: block; margin-bottom: 6px; font-size: 14px; }
.info-card p { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 1050px) {
  .locator-header { grid-template-columns: 1fr; gap: 15px; }
  .search-panel { grid-template-columns: minmax(220px, 1fr) 170px auto; }
  .locator-body { grid-template-columns: minmax(0, 1fr) 370px; }
}

@media (max-width: 760px) {
  html, body { height: 100%; overflow: hidden; }
  .dealer-locator { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .locator-header { min-height: 0; padding: 16px; }
  .brand-logo { width: 80px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 21px; }
  .search-panel { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .showroom-filter { justify-content: center; }
  .locator-body {
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.1fr) minmax(0, .9fr);
  }
  .map-column { min-height: 0; }
  .map-legend { left: 10px; bottom: 10px; gap: 8px; }
  .results-column {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .results-summary { flex: 0 0 auto; height: 70px; }
  .store-list {
    flex: 1;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 430px) {
  .search-panel { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .map-legend { font-size: 10px; }
  .map-legend img { width: 21px; height: 21px; }
}
