/* =========================================================
   GASOLINA AVEPET — Main Stylesheet
   ========================================================= */

/* ---------- CSS Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:        #e85d04;
  --accent-dark:   #c44b00;
  --accent-light:  #fff3ec;
  --surface:       #ffffff;
  --surface-alt:   #f8f9fa;
  --border:        #e5e7eb;
  --text-primary:  #111827;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;
  --radius:        10px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.12);
  --font:          'Inter', system-ui, sans-serif;
  --header-h:      68px;
  --footer-h:      44px;
}

html {
  font-size: 15px;
  overflow-x: hidden; /* prevent horizontal scroll */
}
body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface-alt);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---------- DISCLAIMER BANNER ---------- */
.disclaimer-banner {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 50%, #7f1d1d 100%);
  border-bottom: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 2px 10px rgba(127,29,29,.35);
  position: relative;
  z-index: 50;
}
.disclaimer-banner.hidden { display: none; }

.disclaimer-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Red pill badge on the left */
.disclaimer-left { flex-shrink: 0; }
.disclaimer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Text body */
.disclaimer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.disclaimer-title {
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255,255,255,.97);
  line-height: 1.45;
  margin: 0;
}
.disclaimer-title strong {
  font-weight: 800;
  color: #fff;
}
.disclaimer-sub {
  font-size: .76rem;
  color: rgba(255,255,255,.78);
  line-height: 1.5;
  margin: 0;
}
.disclaimer-sub strong { color: rgba(255,255,255,.95); font-weight: 600; }
.disclaimer-sub a {
  color: #fca5a5;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid rgba(252,165,165,.5);
  padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.disclaimer-sub a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.7);
}
.disclaimer-sep {
  margin: 0 6px;
  color: rgba(255,255,255,.4);
}

@media (max-width: 700px) {
  .disclaimer-inner { flex-wrap: wrap; gap: 8px; }
  .disclaimer-left  { order: 1; }
  .disclaimer-body  { order: 2; width: 100%; }
}

/* ---------- HEADER ---------- */
.site-header {
  height: var(--header-h);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(232,93,4,.6));
}
.header-brand h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.header-brand p {
  font-size: .78rem;
  color: rgba(255,255,255,.6);
  margin-top: 1px;
}
.header-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ---------- FILTERS BAR ---------- */
.filters-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  /* Grid area — positioned between map and list on desktop via grid-template-areas */
  grid-area: filters;
}

/* Mobile toggle row — hidden on desktop */
.filter-mobile-bar {
  display: none;
}
.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: .84rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.filter-toggle-btn:hover,
.filter-toggle-btn.open {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}
.filter-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  font-size: .65rem;
  font-weight: 700;
}
.filter-active-badge.hidden { display: none; }
.filter-mobile-count {
  font-size: .78rem;
  color: var(--text-muted);
}

.filters-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-group label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
}
.search-group { flex: 1; min-width: 200px; }
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-icon-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface-alt);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input-icon-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,93,4,.12);
  background: #fff;
}
.clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .8rem;
  padding: 4px;
  border-radius: 4px;
  display: none;
  transition: color .15s;
}
.clear-btn:hover { color: var(--text-primary); }

select {
  height: 38px;
  padding: 0 30px 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 170px;
}
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,93,4,.12);
  background-color: #fff;
}

/* ---------- COMPLIANCE BADGES (cards) ---------- */
.compliance-row {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.cbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 2px 7px 2px 5px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.cbadge-pass {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.cbadge-fail {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.cbadge-noproduct {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.cbadge-unknown {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
}
/* compliance dot on map pins */
/* (rendered via SVG — see script.js) */

/* ---------- NEARBY BUTTON ---------- */
.btn-nearby {
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid #4285f4;
  border-radius: var(--radius);
  background: #eef4ff;
  color: #1a5fb4;
  font-size: .84rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-nearby:hover {
  background: #d4e3fd;
  border-color: #1a5fb4;
}
.btn-nearby.active {
  background: #4285f4;
  color: #fff;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66,133,244,.25);
}
.btn-nearby.loading {
  opacity: .7;
  cursor: wait;
}

/* Pulsing dot inside active nearby button */
.btn-nearby.active svg circle:first-child {
  animation: pulse-dot .9s ease-in-out infinite alternate;
}
@keyframes pulse-dot {
  from { r: 3; opacity: 1; }
  to   { r: 4; opacity: .7; }
}

/* ---------- NEARBY BANNER ---------- */
.nearby-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #eef4ff;
  border-bottom: 1px solid #c5d9f8;
  padding: 8px 14px;
  flex-shrink: 0;
}
.nearby-banner.hidden { display: none; }
.nearby-banner-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: #1a5fb4;
}
.nearby-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: .8rem;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: background .15s, color .15s;
}
.nearby-close:hover { background: #dce8fc; color: #1a5fb4; }

/* ---------- DISTANCE BADGE (on cards in nearby mode) ---------- */
.card-distance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  color: #1a5fb4;
  background: #eef4ff;
  border: 1px solid #c5d9f8;
  border-radius: 20px;
  padding: 2px 7px;
  margin-top: 6px;
  width: fit-content;
}

.filter-reset { justify-content: flex-end; }
.btn-reset {
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: .84rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-reset:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ---------- MAIN LAYOUT ---------- */
.main-layout {
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 380px;
  /* Row 1: filters bar (auto height). Row 2: map + list (fill remaining). */
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "filters filters"
    "map     list";
  column-gap: 16px;
  /* Fixed total height so the map and list can fill row 2 */
  height: calc(100vh - var(--header-h) - var(--footer-h));
}

/* ---------- MAP SECTION ---------- */
.map-section {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #e8ecef;
  grid-area: map;
  margin: 16px 0 16px 20px;
  min-height: 0; /* allow grid row to constrain height */
}
#map {
  width: 100%;
  height: 100%;
  min-height: 500px; /* safety net */
}
.map-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: .9rem;
  color: var(--text-secondary);
  z-index: 10;
}
.map-overlay.hidden { display: none; }

/* ---------- MAP LEGEND ---------- */
.map-legend {
  position: absolute;
  bottom: 28px;
  left: 12px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  box-shadow: var(--shadow-md);
  z-index: 5;
  backdrop-filter: blur(4px);
}
.legend-title {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.legend-item:last-child { margin-bottom: 0; }
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.15);
  flex-shrink: 0;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Google Maps InfoWindow overrides */
.gm-style .gm-style-iw-c { border-radius: 10px !important; padding: 0 !important; }
.gm-style .gm-style-iw-d { overflow: hidden !important; padding: 0 !important; }
.gm-style .gm-style-iw-chr { display: none !important; }

/* ---------- INFO WINDOW ---------- */
.info-window {
  min-width: 260px;
  max-width: 300px;
  font-family: var(--font);
  overflow: hidden;
}

/* Street View photo */
.iw-photo-wrap {
  position: relative;
  width: 100%;
  height: 155px;
  overflow: hidden;
  background: #e8ecef;
  border-radius: 10px 10px 0 0;
}
.iw-photo-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #e8ecef 25%, #d1d5db 50%, #e8ecef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.iw-photo-pano {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.iw-photo-badge {
  position: absolute;
  bottom: 7px;
  right: 8px;
  background: rgba(0,0,0,.52);
  color: rgba(255,255,255,.92);
  font-family: var(--font);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 3px 7px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
}

/* Body below the photo */
.iw-body {
  padding: 12px 14px 12px;
}
.iw-brand {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.iw-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 7px;
}
.iw-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 4px;
  font-size: .78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.iw-row svg { flex-shrink: 0; margin-top: 1px; }
/* compliance section inside InfoWindow */
.iw-compliance {
  margin: 7px 0 2px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* ---------- LIST SECTION ---------- */
.list-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  grid-area: list;
  margin: 16px 20px 16px 0;
  min-height: 0; /* allow grid row to constrain height */
}
.list-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.list-header h2 {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 7px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
}
.list-hint {
  font-size: .72rem;
  color: var(--text-muted);
}
.stations-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
  overscroll-behavior: contain;      /* prevent scroll chaining to parent */
}
.stations-list::-webkit-scrollbar { width: 5px; }
.stations-list::-webkit-scrollbar-track { background: transparent; }
.stations-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
.stations-list::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---------- STATION CARD ---------- */
.station-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
  background: var(--surface);
  position: relative;
  /* Skip layout/paint for off-screen cards — CSS virtual scroll */
  content-visibility: auto;
  contain-intrinsic-size: auto 100px;
}
.station-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.station-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(232,93,4,.15);
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.card-name {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
}
.card-brand {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  color: #fff;
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: .76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
/* CSS-only icons replace inline SVGs — one fewer element per row */
.card-meta-row::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
  margin-top: 4px;
}
.card-meta-row.card-address::before {
  border-radius: 2px;
}

/* Focus button (shown on hover via CSS) */
.card-focus-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
  font-family: var(--font);
}
.station-card:hover .card-focus-btn,
.station-card.active .card-focus-btn {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ---------- BRAND COLORS ---------- */
.brand-SHELL       { background: #e8a020; }
.brand-TOTAL       { background: #e82020; }
.brand-TEXACO      { background: #c81414; }
.brand-ECOPETRÓLEO { background: #2ecc71; }
.brand-PETRONAN    { background: #1a73e8; }
.brand-NEXT        { background: #6c3483; }
.brand-SIGMA       { background: #0d6efd; }
.brand-PETROMÓVIL  { background: #17a2b8; }
.brand-NATIVA      { background: #20c997; }
.brand-RILIX       { background: #fd7e14; }
.brand-SOL         { background: #f0c040; color: #333 !important; }
.brand-PETROCOMBISA{ background: #495057; }
.brand-ATLANTIC    { background: #0077b6; }
.brand-AXXON       { background: #b5179e; }
.brand-ESSO        { background: #003f88; }
.brand-GULF        { background: #ff6700; }
.brand-default     { background: #6b7280; }

/* ---------- NO RESULTS ---------- */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: .88rem;
  text-align: center;
}
.no-results.hidden { display: none; }

/* ---------- FOOTER ---------- */
.site-footer {
  height: var(--footer-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-footer p {
  font-size: .76rem;
  color: var(--text-muted);
}

/* =========================================================
   RESPONSIVE — Tablet / Mobile
   ========================================================= */
@media (max-width: 900px) {
  /* Single-column layout: map → filters → list */
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas: "map" "filters" "list";
    column-gap: 0;
    height: auto;
    padding: 0;
  }
  .map-section  { margin: 12px 12px 10px; height: 55vw; min-height: 300px; }
  #map          { height: 100%; min-height: 300px; }
  .list-section { margin: 0 12px 12px; height: auto; max-height: 60vh; }

  /* Show mobile filter toggle, hide desktop filters by default */
  .filter-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
  }
  .filters-inner {
    display: none;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filters-inner.open { display: flex; }

  /* Make selects and inputs full-width on mobile */
  .filter-group { width: 100%; }
  .search-group { min-width: unset; }
  select { min-width: unset; width: 100%; }
  .filter-reset { align-items: stretch; }
  .btn-reset, .btn-nearby { width: 100%; justify-content: center; }
  #radiusGroup { width: 100%; }
}

@media (max-width: 600px) {
  :root { --header-h: 58px; }
  .header-brand h1 { font-size: .88rem; }
  .header-badge { display: none; }
  .main-layout { grid-template-rows: auto auto auto; }
  .map-section  { height: 60vw; min-height: 260px; margin: 10px 10px 10px; }
  #map          { height: 100%; min-height: 260px; }
  .list-section { margin: 0 10px 10px; }

  /* Disclaimer banner stacks vertically */
  .disclaimer-inner { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .disclaimer-left  { order: 1; }
  .disclaimer-body  { order: 2; width: 100%; }
}

/* ── Touch device optimizations ─────────────────────────── */
/* On touch screens hover states never fire — skip the transitions
   so the browser doesn't keep compositing layers for each card. */
@media (hover: none) {
  .station-card {
    transition: none;
    box-shadow: none;
  }
  .station-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
    background: var(--surface);
  }
  /* Hide desktop-only hover button on touch screens */
  .card-focus-btn { display: none; }
  /* backdrop-filter is GPU-expensive on mobile */
  .map-legend     { backdrop-filter: none; }
  .iw-photo-badge { backdrop-filter: none; }
}


/* ---------- PAGINATION ---------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.page-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: border-color .15s, background .15s, color .15s;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-info {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 52px;
  text-align: center;
}

/* ---------- ISOLATION MODE (desktop single-station view) --- */
.isolation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--accent-light);
  border: 1.5px solid rgba(232,93,4,.25);
  border-radius: 8px;
  margin-bottom: 8px;
}
.isolation-label {
  font-size: .74rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.isolation-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.isolation-back:hover { background: var(--accent-dark); }
