/* ==========================================================================
   Ruta Gastronómica UAM
   Dirección: landing limpia y cálida. Un acento (terracota), paleta neutra
   (piedra) y un único radio de esquina en todo el sitio.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --tint: #ebe9e3;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #d6d3cd;
  --accent: #b4472b;
  --accent-hover: #963a22;
  --accent-soft: #f3e1da;
  --focus: #1c1917;

  --radius: 12px;
  --shadow: 0 1px 2px rgb(28 25 23 / 0.06), 0 8px 24px rgb(28 25 23 / 0.06);

  --font-sans: "Geist", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1200px;
  --header-h: 68px;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- 3. Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(245 244 240 / 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  white-space: nowrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- 4. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* ---------- 5. Hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 16ch;
}

.hero-sub {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 44ch;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  max-width: 480px;
}

.hero-facts > div {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-facts dt {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hero-facts dd {
  margin: 0;
}

.fact-price {
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--accent);
  margin-top: 0.25rem !important;
}

.fact-note {
  font-size: 0.9375rem;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 6 / 5;
  background: var(--tint);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 6. Secciones ---------- */
.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section-tint {
  background: var(--tint);
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
}

.section-head p {
  margin-top: 0.75rem;
  color: var(--muted);
}

/* ---------- 7. Tarifas ---------- */
.tariff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.tariff-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.tariff-size {
  font-weight: 600;
  color: var(--muted);
}

.tariff-price {
  margin-top: 0.5rem;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tariff-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.breakdown {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: 0.9375rem;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.breakdown li:first-child {
  border-top: 0;
}

.breakdown span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tariff-note {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- 8. Filtros y alerta de hora punta ---------- */
.filters {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.filter-group legend {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
  padding: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.peak-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.125rem;
  margin-bottom: 2rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.9375rem;
}

/* ---------- 9. Paradas ---------- */
.stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  counter-reset: stop;
}

.stop {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stop:hover {
  border-color: var(--ink);
}

.stop.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.stop-media {
  margin: 0;
  aspect-ratio: 16 / 10;
  background: var(--tint);
}

.stop-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stop-body {
  padding: 1.25rem 1.375rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.stop-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
}

.stop h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.stop-body > p:not(.stop-num):not(.stop-tags) {
  color: var(--muted);
  font-size: 0.975rem;
}

.stop-body strong {
  color: var(--ink);
}

.stop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.stop-tags span {
  font-size: 0.8125rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--tint);
  color: var(--ink);
}

.empty-state {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------- 10. Mapa ---------- */
.map-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

.map-copy h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
}

.map-copy > p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.qr-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qr-box img {
  width: 140px;
  height: 140px;
  flex: none;
  background: #fff;
}

.qr-box p {
  font-size: 0.9375rem;
  color: var(--muted);
}

.map-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.map-frame svg {
  width: 100%;
  height: auto;
  display: block;
}

.map-bg {
  fill: #faf9f6;
  stroke: var(--line);
}

.map-block {
  fill: var(--tint);
  stroke: var(--line);
}

.map-route {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
}

.map-label {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--muted);
}

.pin {
  cursor: pointer;
  outline: none;
}

.pin circle {
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 3;
  transition: fill 0.2s ease;
}

.pin text {
  fill: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  text-anchor: middle;
  pointer-events: none;
}

.pin:hover circle,
.pin.is-active circle {
  fill: var(--accent);
}

.pin:focus-visible circle {
  stroke: var(--accent);
  stroke-width: 4;
}

.map-caption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- 11. Reserva y pago ---------- */
.reserva-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

.reserva-copy h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
}

.reserva-copy > p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.reserva-total {
  margin-top: 1.75rem;
  font-size: 1.125rem;
  font-weight: 600;
}

#precio-persona {
  font-size: 2.25rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.reserva-detalle {
  display: block;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
}

.reserva-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.25rem;
}

.reserva-form .field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
}

.reserva-form legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 0.5rem;
}

.field label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
}

.field input:focus,
.field select:focus {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.field input[aria-invalid="true"] {
  border-color: var(--accent);
  border-width: 2px;
}

.error {
  font-size: 0.875rem;
  color: var(--accent-hover);
  font-weight: 600;
}

.radio-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card:has(input:checked) {
  border: 2px solid var(--ink);
  background: var(--tint);
  font-weight: 600;
}

.radio-card:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.form-status {
  min-height: 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink);
  font-weight: 500;
}

/* ---------- 12. Opiniones y contenido ---------- */
.links-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.link-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.link-panel h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.plain-list a {
  display: inline-block;
  padding: 0.4rem 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.plain-list a:hover {
  color: var(--accent);
}

.video-slot {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 1.5rem;
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- 13. Justificación estratégica ---------- */
.persona-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.persona {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.persona-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
}

.persona h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.persona p:not(.persona-meta) {
  font-size: 0.975rem;
  color: var(--muted);
}

.persona strong {
  color: var(--ink);
}

.persona-need {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- 14. Pie ---------- */
.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

/* ---------- 15. Responsive ---------- */
@media (min-width: 640px) {
  .tariff-grid,
  .persona-grid,
  .links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .stop:first-child {
    grid-column: 1 / -1;
  }

  .stop:first-child {
    flex-direction: row;
  }

  .stop:first-child .stop-media {
    width: 45%;
    aspect-ratio: auto;
  }
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .map-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .reserva-grid {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .radio-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tariff-grid,
  .persona-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stops {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stop:first-child {
    grid-column: auto;
    flex-direction: column;
  }

  .stop:first-child .stop-media {
    width: auto;
    aspect-ratio: 16 / 10;
  }

  .links-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  .nav-links {
    gap: 0.9rem;
    font-size: 0.9375rem;
  }

  .nav-links li:nth-child(n + 4) {
    display: none;
  }

  .brand {
    font-size: 0.95rem;
  }

  .cta-row .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 420px) {
  .nav-links li:nth-child(2) {
    display: none;
  }
}

/* ---------- 16. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
