/* =========================================================
   Páginas de estaciones: g500.html · megasur.html · pemex.html
   Se carga DESPUÉS de Bootstrap 5.3.
   El color de cada marca se define con variables en .theme-*
   ========================================================= */

:root {
  --line: #dcdcdc;
  --muted: #555;
  --focus: #0d6efd;

  /* Valores por defecto (se sobrescriben por tema) */
  --header-bg: #fff;
  --header-fg: #212529;
  --header-border: transparent;
  --accent: #0d6efd;
  --accent-fg: #fff;
}

.theme-g500 {
  --header-bg: #0d6efd;
  --header-fg: #fff;
  --accent: #0d6efd;
}
.theme-megasur {
  --header-bg: #fff;
  --header-fg: #008000;
  --header-border: #ffc107;
  --accent: #008000;
}
.theme-pemex {
  --header-bg: #000;
  --header-fg: #fff;
  --accent: #dc3545;   /* rojo con contraste AA sobre texto blanco */
}

/* ---------- Base ---------- */
body { color: #000; background: #fff; overflow-x: hidden; }
img, iframe { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 2000;
  background: #fff; color: #000; padding: .6rem 1rem; border-radius: .5rem; text-decoration: none;
}
.skip-link:focus { top: .5rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* ---------- Encabezado ---------- */
.page-header {
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
}
.page-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1600px; margin-inline: auto;
  padding: .75rem clamp(1rem, 3vw, 2rem);
  min-height: 64px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: auto; width: clamp(110px, 38vw, 200px); }
.home-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem;
  border-radius: .5rem; color: var(--header-fg); font-weight: 600; text-decoration: none;
}
.home-link:hover { text-decoration: underline; color: var(--header-fg); }
.theme-megasur .page-header :focus-visible,
.theme-g500 .page-header :focus-visible,
.theme-pemex .page-header :focus-visible { outline-color: #fff; }
.theme-megasur .page-header :focus-visible { outline-color: #0d6efd; }

/* ---------- Layout ---------- */
.wrap { max-width: 1600px; margin-inline: auto; padding: clamp(1rem, 3vw, 2rem); }

.stations-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.stations-list, .stations-side { min-width: 0; }   /* evita desbordes por direcciones largas */

@media (min-width: 992px) {
  .stations-layout { grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: 2rem; align-items: start; }
}

/* ---------- Acordeón ---------- */
.accordion-button { font-weight: 600; }
.accordion-button:not(.collapsed) { background-color: var(--accent); color: var(--accent-fg); box-shadow: none; }
.accordion-button:not(.collapsed)::after { filter: brightness(0) invert(1); }
/* G500 siempre azul, como antes */
.theme-g500 .accordion-button { background-color: var(--accent); color: var(--accent-fg); }
.theme-g500 .accordion-button.collapsed::after { filter: brightness(0) invert(1); }
.conteo { margin-left: .35rem; font-weight: 400; opacity: .85; }

.accordion-body { padding: 1rem 1.25rem; }

.estacion { padding: .9rem 0; border-top: 1px solid var(--line); }
.estacion:first-child { padding-top: 0; border-top: 0; }
.estacion:last-child { padding-bottom: 0; }
.estacion h3 { margin: 0 0 .2rem; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.combustibles { margin: 0 0 .35rem; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.direccion { margin: 0; font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; }

/* ---------- Mapa e imagen ---------- */
.map-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #f2f4f6; border-radius: .5rem; overflow: hidden; }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (min-width: 768px) { .map-frame { aspect-ratio: 16 / 9; } }

.product-img { display: block; width: 100%; height: auto; margin-top: 1.5rem; border-radius: .5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
