/* Viaje a Bilbao — móvil primero */
:root {
  --bg: #f3efe6;
  --bg-2: #e9e3d6;
  --ink: #172226;
  --muted: #5b676c;
  --card: #fffcf7;
  --line: #e2d9cb;
  --teal: #0f3d45;
  --teal-2: #1a5c66;
  --teal-soft: #e6f0f1;
  --clay: #c0562a;
  --clay-soft: #f8e6dc;
  --gold: #b8860b;
  --ok: #1f6b45;
  --ok-soft: #e5f4eb;
  --shadow: 0 8px 24px rgba(23, 34, 38, 0.08);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dfe9ea 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(118px + var(--safe-b));
}
img { max-width: 100%; display: block; }
button, select { font: inherit; color: inherit; }
a { color: var(--teal-2); }

.wrap { width: min(760px, calc(100% - 28px)); margin: 0 auto; }

header.app {
  padding: 22px 0 8px;
}
header.app .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-2);
  font-weight: 600;
}
header.app h1 {
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 2px 0 4px;
}
header.app p { color: var(--muted); font-size: 0.98rem; }

/* Vuelos */
.vuelo {
  background: var(--teal);
  color: #f7f3ea;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin: 16px 0 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.vuelo::after {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 160px; height: 160px;
  border: 18px solid rgba(255,255,255,0.06);
  border-radius: 50%;
}
.vuelo-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  position: relative; z-index: 1;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #c9a227;
  color: #1a1608;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 999px;
}
.vuelo h2 { font-size: 1.15rem; margin: 8px 0 2px; font-weight: 650; }
.vuelo .precio-grande {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 650;
  text-align: right;
  line-height: 1;
}
.vuelo .precio-grande small {
  display: block;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  margin-top: 4px;
}
.tramos { margin: 14px 0 10px; position: relative; z-index: 1; }
.tramo {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.95rem;
}
.tramo .dia { color: rgba(247,243,234,0.75); font-size: 0.82rem; }
.tramo .ruta { font-weight: 650; }
.tramo .ruta span { font-weight: 500; opacity: 0.8; margin: 0 4px; }
.tramo .horas { font-variant-numeric: tabular-nums; font-weight: 600; }
.vuelo .acciones {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  position: relative; z-index: 1; margin-top: 6px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  background: #f7f3ea;
  color: var(--teal);
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  border: 0;
  cursor: pointer;
}
.btn:hover { filter: brightness(0.97); }
.btn-ghost {
  background: transparent;
  color: #f7f3ea;
  border: 1px solid rgba(247,243,234,0.35);
}
details.alts { width: 100%; margin-top: 4px; color: rgba(247,243,234,0.85); font-size: 0.88rem; }
details.alts summary { cursor: pointer; }
details.alts li { margin: 4px 0 0 18px; }

/* Tabs */
.tabs {
  display: flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  position: sticky;
  top: 8px;
  z-index: 20;
  box-shadow: 0 6px 16px rgba(23,34,38,0.06);
}
.tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  min-height: 44px;
  font-weight: 650;
  cursor: pointer;
  color: var(--muted);
}
.tabs button[aria-selected="true"] {
  background: var(--teal);
  color: #f7f3ea;
}

.panel { margin-top: 16px; }
.panel[hidden] { display: none; }

.intro {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 2px 12px;
}

/* Filtros */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.filtros label.sel {
  display: flex; align-items: center; gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 14px;
  font-size: 0.9rem;
}
.filtros select {
  border: 0;
  background: transparent;
  font-weight: 650;
  outline: none;
  max-width: 58vw;
}
.toggle {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.toggle input { accent-color: var(--teal); width: 16px; height: 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--teal-soft);
  border-color: var(--teal-2);
  color: var(--teal);
}

.vacio {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

/* Cards */
.lista { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,217,203,0.8);
}
.card.elegida { outline: 2px solid var(--teal-2); }
.foto {
  position: relative;
  height: 200px;
  background: #d5d0c6;
}
.foto img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.foto .badge-rec {
  position: absolute;
  left: 12px; top: 12px;
  background: #c9a227;
  color: #1a1608;
  font-weight: 750;
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.foto .tamano-tag {
  position: absolute;
  right: 12px; top: 12px;
  background: rgba(15,61,69,0.88);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 5px 9px;
  border-radius: 999px;
}
.cuerpo { padding: 14px 16px 16px; }
.cuerpo h3 {
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 2px;
}
.meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.meta strong { color: var(--ink); font-weight: 650; }
.precio-linea {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
  margin: 8px 0 10px;
}
.precio-linea .total {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 650;
  line-height: 1;
  color: var(--teal);
}
.precio-linea .total .approx { font-size: 1rem; font-weight: 600; }
.estimado-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clay);
  vertical-align: middle;
}
.badge-sec {
  background: #e6f0f1 !important;
  color: #0f3d45 !important;
}
.precio-linea .desglose {
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
}
.pendiente {
  color: var(--clay);
  font-weight: 700;
  font-size: 1.05rem;
}
.chips-info { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chips-info span {
  background: var(--bg-2);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
}
.chips-info .ok { background: var(--ok-soft); color: var(--ok); }
.chips-info .warn { background: var(--clay-soft); color: #8a3a16; }
.card .acciones { display: flex; gap: 8px; }
.card .acciones .btn { flex: 1; }
.btn-sec {
  background: var(--teal-soft);
  color: var(--teal);
}
.btn-sec[aria-pressed="true"] {
  background: var(--teal);
  color: #f7f3ea;
}

.descartados {
  margin: 22px 0 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.descartados summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--teal);
}
.descartados ul { margin: 10px 0 4px 18px; color: var(--muted); font-size: 0.92rem; }
.descartados li { margin: 6px 0; }

footer.nota {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 24px 0 8px;
  line-height: 1.5;
}

/* Mi selección */
.seleccion {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,252,247,0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + var(--safe-b));
  z-index: 30;
}
.seleccion .inner {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: end;
}
.seleccion h2 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}
.partes {
  font-size: 0.82rem;
  color: var(--muted);
  grid-column: 1 / -1;
  grid-row: 2;
  line-height: 1.35;
}
.partes b { color: var(--ink); font-weight: 650; white-space: nowrap; }
.suma {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 650;
  color: var(--teal);
  text-align: right;
  line-height: 1;
  grid-column: 2;
  grid-row: 1;
}
.suma span { display: block; font-family: var(--font); font-size: 0.7rem; color: var(--muted); font-weight: 500; margin-top: 3px; }

@media (min-width: 800px) {
  .foto { height: 230px; }
}
