/* ── Variables ── */
:root {
  --bg:       #f5f5f0;
  --surface:  #ffffff;
  --border:   #e2e2da;
  --text:     #1a1a1a;
  --text-dim: #777770;
  --accent:   #2563eb;
  --green:    #16a34a;
  --yellow:   #ca8a04;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.site-logo span { color: var(--accent); }
.site-near-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .38rem .85rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.site-near-btn:hover { background: #1d4ed8; text-decoration: none; }

/* ── Map ── */
#map {
  width: 100%;
  height: 260px;          /* compact on mobile */
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) { #map { height: 380px; } }
@media (min-width: 960px) { #map { height: 460px; } }

/* ── Wash card — desktop scale back to original ── */
@media (min-width: 640px) {
  .wash-card-top   { padding: .85rem 1rem .6rem; gap: .75rem; }
  .wash-name       { font-size: .95rem; }
  .wash-address    { font-size: .8rem; margin-top: .25rem; }
  .wash-badges     { gap: .3rem; }
  .badge-dist      { font-size: .72rem; padding: .15rem .55rem; }
  .rating          { font-size: .8rem; }
  .wash-actions    { gap: .4rem; padding: .5rem .75rem .7rem; }
  .act-btn         { min-width: 80px; padding: .5rem .6rem; font-size: .8rem; border-radius: 7px; }
}

/* ── Page wrap ── */
.page-wrap {
  padding: 1rem 1rem 5rem;
  max-width: 720px;
  margin: 0 auto;
}

/* ── City heading ── */
.city-heading { margin-bottom: 1rem; }
.city-heading h1 { font-size: 1.25rem; font-weight: 700; }
.city-heading .meta { font-size: .85rem; color: var(--text-dim); margin-top: .2rem; }
.city-heading .meta strong { color: var(--accent); }

/* ── Wash list ── */
.wash-list { display: flex; flex-direction: column; gap: .6rem; }

/* ── Wash card ── */
.wash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .15s;
}
.wash-card:hover { border-color: #aac4f8; }

.wash-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.05rem;
  padding: 1.2rem 1.4rem .85rem;
}

.wash-info { flex: 1; min-width: 0; }

.wash-name {
  font-weight: 600;
  font-size: 1.33rem;
  line-height: 1.3;
  word-break: break-word;
}
.wash-address {
  font-size: 1.12rem;
  color: var(--text-dim);
  margin-top: .35rem;
  line-height: 1.35;
}

.wash-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .42rem;
  flex-shrink: 0;
}

.badge-dist {
  display: inline-block;
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 600;
  padding: .21rem .77rem;
  white-space: nowrap;
}
.rating {
  font-size: 1.12rem;
  color: var(--yellow);
  font-weight: 600;
  white-space: nowrap;
}
.rating .reviews { color: var(--text-dim); font-weight: 400; }

/* ── Action buttons row ── */
.wash-actions {
  display: flex;
  gap: .56rem;
  padding: .7rem 1.05rem 1rem;
  border-top: 1px solid var(--border);
  background: #fafaf8;
  flex-wrap: wrap;
}

.act-btn {
  flex: 1;
  min-width: 112px;
  padding: .7rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.12rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.act-btn:hover  { background: #f0f0ea; border-color: #c0c0b8; }
.act-btn:active { background: #e4e4dc; }

.act-center { color: var(--accent); border-color: #bfdbfe; background: #eff6ff; }
.act-center:hover { background: #dbeafe; }

.act-route  { color: var(--green); border-color: #bbf7d0; background: #f0fdf4; }
.act-route:hover { background: #dcfce7; }

/* ── Route dropdown ── */
.route-wrap { position: relative; flex: 1; min-width: 80px; }
.route-wrap .act-btn { width: 100%; }

.route-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  top: auto;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 150px;
  z-index: 50;
  overflow: hidden;
}
.route-menu.open { display: block; }
.route-menu.open-down { bottom: auto; top: calc(100% + 6px); }

.route-opt {
  display: block;
  padding: .7rem 1rem;
  font-size: .85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.route-opt:last-child { border-bottom: none; }
.route-opt:hover { background: #f0f0ea; text-decoration: none; }

/* ── Related cities ── */
.related-wrap {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}
.related-title {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .75rem;
}
.related-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
}
.related-list li a {
  font-size: .85rem;
  color: var(--text-dim);
}
.related-list li a:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  background: var(--bg-dark, #eeeee8);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  font-size: .82rem;
  color: var(--text-dim);
}
.site-footer .page-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* ── Empty ── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-dim); }
.empty-icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }

/* ── Detail bottom sheet ── */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.detail-overlay.active { display: block; }

.detail-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  z-index: 201;
  padding: 1.25rem 1.25rem 2rem;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s .3s;
  max-height: 85vh;
  overflow-y: auto;
}
.detail-sheet.active {
  transform: translateY(0);
  visibility: visible;
  transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
}

/* On wider screens — centered modal */
@media (min-width: 640px) {
  .detail-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(.95);
    border-radius: 16px;
    width: 560px;
    max-height: min(80vh, 680px);
  }
  .detail-sheet.active {
    transform: translate(-50%, -50%) scale(1);
  }
  .detail-sheet:not(.active) {
    transform: translate(-50%, -50%) scale(.95);
  }
}

.detail-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
  margin: 0 auto .75rem;
}
@media (min-width: 640px) { .detail-handle { display: none; } }

.detail-close {
  position: absolute;
  top: .85rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: .25rem .4rem;
  border-radius: 6px;
  line-height: 1;
}
.detail-close:hover { background: #f0f0ea; color: var(--text); }

/* ── Detail content ── */
.d-thumb-wrap {
  margin: -.25rem -1.25rem .75rem;
  overflow: hidden;
  max-height: 180px;
}
@media (min-width: 640px) { .d-thumb-wrap { border-radius: 10px 10px 0 0; margin: -.25rem -1.25rem .75rem; } }
.d-thumb {
  width: 100%;
  object-fit: cover;
  max-height: 180px;
  display: block;
}

.d-header {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .4rem;
  padding-right: 1.75rem;
  flex-wrap: wrap;
}
.d-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.d-type-badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .6rem;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: .2rem;
}

.d-open-state {
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .5rem;
}
.d-open-state.is-open   { color: var(--green); }
.d-open-state.is-closed { color: var(--red, #dc2626); }

.d-rating {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .9rem;
  margin-bottom: .75rem;
}
.star-on  { color: var(--yellow); }
.star-off { color: var(--border); }
.d-reviews { color: var(--text-dim); font-size: .82rem; }

.d-section {
  border-top: 1px solid var(--border);
  padding-top: .75rem;
  margin-top: .75rem;
}
.d-section-title {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .5rem;
}

.d-row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: .45rem;
  line-height: 1.4;
  word-break: break-word;
}
.d-row a { color: var(--accent); }
.d-icon { flex-shrink: 0; width: 1.2rem; text-align: center; }

/* Schedule table */
.d-schedule { width: 100%; border-collapse: collapse; font-size: .85rem; }
.d-schedule tr { border-bottom: 1px solid var(--border); }
.d-schedule tr:last-child { border-bottom: none; }
.d-schedule tr.today { background: #fffbeb; font-weight: 600; }
.sched-day   { padding: .35rem .5rem .35rem 0; color: var(--text-dim); width: 2.5rem; }
.sched-hours { padding: .35rem 0; }
.d-schedule tr.today .sched-day   { color: var(--yellow); }
.d-schedule tr.today .sched-hours { color: var(--text); }

/* Route buttons inside detail sheet */
.d-route-btns {
  display: flex;
  gap: .6rem;
}
.d-route-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.d-route-btn:hover { background: #eeeee8; border-color: #bbbbb0; text-decoration: none; }
.d-route-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Chips */
.d-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.d-chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: .78rem;
  padding: .25rem .7rem;
  color: var(--text);
}

/* ── Leaflet popup ── */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  font-family: inherit;
  font-size: .82rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.popup-name { font-weight: 600; margin-bottom: .2rem; }
.popup-dist { color: var(--accent); font-size: .75rem; }
.popup-addr { color: var(--text-dim); font-size: .75rem; margin-top: .15rem; }

/* ── Near me button on index ── */
.near-me-index-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .75rem;
  padding: .6rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.near-me-index-btn:hover { background: #1d4ed8; text-decoration: none; }

/* ── Catalog (index page) ── */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.catalog-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem 1.1rem;
}
.catalog-city {
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .6rem;
  color: var(--text);
}
.catalog-city-link {
  font-size: .85rem;
  color: var(--accent);
  text-decoration: none;
}
.catalog-city-link:hover { text-decoration: underline; }
.catalog-districts {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.catalog-districts li a {
  font-size: .83rem;
  color: var(--text-dim);
  text-decoration: none;
  display: block;
  padding: .15rem 0;
}
.catalog-districts li a:hover { color: var(--accent); }

/* ── Near me page ── */
.near-me-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
}
.near-me-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: nm-spin .8s linear infinite;
}
@keyframes nm-spin { to { transform: rotate(360deg); } }
.near-me-msg {
  font-size: .95rem;
  color: var(--text-dim);
}
.near-me-back {
  font-size: .88rem;
  color: var(--accent);
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.08);
  padding: 1rem 1.25rem;
}
.cookie-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cookie-text { flex: 1; min-width: 220px; }
.cookie-text strong { display: block; margin-bottom: .25rem; font-size: .95rem; }
.cookie-text p { margin: 0; font-size: .82rem; color: var(--text-dim); line-height: 1.5; }
.cookie-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.cookie-btn {
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.cookie-btn-accept { background: var(--accent); color: #fff; border-color: var(--accent); }
.cookie-btn-reject { color: var(--text-dim); }
.cookie-btn-settings { color: var(--text-dim); font-size: .78rem; }

/* ── Legal pages ── */
.legal-page { max-width: 720px; padding-top: 2rem; padding-bottom: 3rem; }
.legal-meta { color: var(--text-dim); font-size: .85rem; margin-bottom: 2rem; }
.legal-body h2 { font-size: 1.05rem; margin: 1.75rem 0 .5rem; color: var(--text); }
.legal-body p, .legal-body li { font-size: .92rem; line-height: 1.7; color: var(--text-dim); }
.legal-body ul { padding-left: 1.4rem; margin: .5rem 0; }
.legal-body a { color: var(--accent); }
.contact-block p { font-size: .92rem; line-height: 1.8; color: var(--text-dim); }
.cookie-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 1rem 0; }
.cookie-table th, .cookie-table td { padding: .5rem .75rem; border: 1px solid var(--border); text-align: left; }
.cookie-table th { background: var(--surface); font-weight: 600; }
.cookie-table code { font-size: .8rem; }
.legal-footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.legal-footer-links a { font-size: .78rem; color: var(--text-dim); text-decoration: none; }
.legal-footer-links a:hover { color: var(--accent); }
