/* Diseño: mapa a pantalla completa + hoja inferior (celular) / panel lateral (compu) */
:root {
  color-scheme: light;
  --tinta: #0f1728;
  --suave: #667085;
  --tenue: #98a2b3;
  --linea: #eaecf0;
  --fondo: #ffffff;
  --gris: #f4f6f9;
  --avion: #ff5a36;
  --tren: #2747c7;
  --verde: #0e8a62;
  --hielo: #eef4ff;
  --radio: 20px;
  --asoma: 50dvh;              /* cuánto ocupa la hoja al abrir en el celular */
  --sombra: 0 -8px 30px rgba(15, 23, 40, .12);
}
* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font: 15px/1.5 "Plus Jakarta Sans", system-ui, sans-serif; color: var(--tinta); background: #dfe7ee; overflow-x: clip; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; }
h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }

/* ---------- Mapa ---------- */
#mapa { position: fixed; inset: 0; z-index: 0; background: #dfe7ee; }
.leaflet-tile-pane { filter: saturate(.55) brightness(1.05) contrast(.96); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75) !important; }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 4px 14px rgba(15,23,40,.15) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--tinta) !important; }

/* ---------- Barra superior flotante ---------- */
.top { position: fixed; z-index: 30; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.top > * { pointer-events: auto; }
.marca { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.96); border-radius: 18px; padding: 7px 14px 7px 7px; box-shadow: 0 4px 18px rgba(15,23,40,.14); }
.marca-icono { width: 36px; height: 36px; border-radius: 12px; background: var(--tinta); color: #fff; display: grid; place-items: center; }
.marca-icono svg { width: 19px; height: 19px; }
.marca b { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.marca small { display: block; font-size: 12px; color: var(--suave); font-weight: 600; }
.play { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px 0 12px; border-radius: 23px; background: var(--avion); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 6px 18px rgba(255,90,54,.4); }
.play svg { width: 20px; height: 20px; }
.play:active { transform: scale(.97); }
.play.parar { background: var(--tinta); box-shadow: 0 6px 18px rgba(15,23,40,.3); }

.cartel { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(var(--asoma) + 14px); max-width: calc(100% - 32px); width: max-content;
  background: var(--tinta); color: #fff; border-radius: 16px; padding: 9px 16px; font-weight: 700; font-size: 14px; text-align: center; box-shadow: 0 8px 24px rgba(15,23,40,.3); }

/* ---------- Hoja inferior ---------- */
.hoja { position: relative; z-index: 10; margin-top: calc(100dvh - var(--asoma)); min-height: 100dvh; background: var(--fondo); border-radius: 26px 26px 0 0; box-shadow: var(--sombra); padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.hoja-cabeza { position: sticky; top: 0; z-index: 5; background: var(--fondo); border-radius: 26px 26px 0 0; padding-top: 8px; border-bottom: 1px solid var(--linea); }
.tirador { width: 40px; height: 5px; border-radius: 3px; background: #d0d5dd; margin: 0 auto 8px; }

/* Selector de días tipo calendario */
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dia { flex: 0 0 auto; width: 72px; border-radius: 16px; background: var(--gris); padding: 7px 0 8px; text-align: center; scroll-snap-align: center; transition: background .2s, color .2s; }
.dia small { display: block; font-size: 11px; font-weight: 700; color: var(--suave); text-transform: capitalize; }
.dia b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.dia i { display: block; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.dia .punto { width: 6px; height: 6px; border-radius: 50%; margin: 3px auto 0; background: transparent; }
.dia .punto.avion { background: var(--avion); }
.dia .punto.tren { background: var(--tren); }
.dia.todo { width: 72px; background: var(--hielo); }
.dia.todo b { font-size: 15px; padding: 4px 0 2px; }
.dia[aria-pressed="true"] { background: var(--tinta); color: #fff; }
.dia[aria-pressed="true"] small, .dia[aria-pressed="true"] i { color: rgba(255,255,255,.7); }
.dia:focus-visible, .btn:focus-visible, .ico:focus-visible { outline: 3px solid var(--avion); outline-offset: 2px; }

.contenido { padding: 18px 16px 0; }

/* Encabezado del día */
.kicker { font-size: 13px; font-weight: 700; color: var(--avion); margin: 0 0 4px; }
.titulo { font-size: 27px; font-weight: 800; }
.datos { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.datos li { display: flex; align-items: center; gap: 6px; background: var(--gris); border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: #344054; }
.datos svg { width: 15px; height: 15px; color: var(--suave); }
.plan { margin: 14px 0 0; color: #344054; font-size: 15px; }

/* Tarjeta de embarque */
.ticket { position: relative; margin-top: 18px; border-radius: var(--radio); background: var(--fondo); border: 1px solid var(--linea); box-shadow: 0 6px 20px rgba(15,23,40,.06); }
.ticket-ruta { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 10px; padding: 16px 16px 6px; }
.ticket-ruta small { display: block; font-size: 11px; font-weight: 700; color: var(--tenue); }
.ticket-ruta b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ticket-ruta .hasta { text-align: right; }
.ticket-medio { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 80px; }
.ticket-medio .linea { display: flex; align-items: center; gap: 6px; width: 100%; }
.ticket-medio .linea::before, .ticket-medio .linea::after { content: ""; flex: 1; border-top: 2px dashed currentColor; opacity: .35; }
.ticket-medio svg { width: 22px; height: 22px; }
.ticket-medio span { font-size: 12px; font-weight: 700; color: var(--suave); white-space: nowrap; }
.ticket.avion .ticket-medio { color: var(--avion); }
.ticket.tren .ticket-medio { color: var(--tren); }
.ticket-nota { margin: 6px 16px 14px; font-size: 13px; color: var(--suave); }
.ticket-corte { position: relative; height: 0; border-top: 2px dashed var(--linea); margin: 0 14px; }
.ticket-corte::before, .ticket-corte::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--fondo); border: 1px solid var(--linea); }
.ticket-corte::before { left: -25px; clip-path: inset(0 0 0 50%); }
.ticket-corte::after { right: -25px; clip-path: inset(0 50% 0 0); }
.ticket-compra { padding: 14px 16px 16px; }
.ticket-compra > small { display: block; font-size: 12px; font-weight: 700; color: var(--suave); margin-bottom: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 13px; font-weight: 700; font-size: 13.5px; text-decoration: none; background: var(--gris); color: var(--tinta); white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn.primario { background: var(--tinta); color: #fff; }
.btn.acento { background: var(--avion); color: #fff; }
.btn.ancho { width: 100%; min-height: 50px; font-size: 15px; border-radius: 16px; }
.btn:active, .ico:active { transform: scale(.97); }

/* Carrusel de lugares */
.seccion { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.seccion h3 { font-size: 19px; font-weight: 800; }
.seccion span { font-size: 13px; color: var(--suave); font-weight: 600; }
.carrusel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 10px; scroll-padding: 0 16px; scrollbar-width: none; }
.carrusel::-webkit-scrollbar { display: none; }
.lugar { flex: 0 0 min(80%, 300px); scroll-snap-align: start; border-radius: var(--radio); background: var(--fondo); border: 1px solid var(--linea); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.lugar.activo { border-color: var(--tinta); box-shadow: 0 0 0 1px var(--tinta); }
.lugar-foto { position: relative; height: 150px; background: var(--gris); }
.lugar-foto img { width: 100%; height: 100%; object-fit: cover; }
.lugar-foto.rota { background: linear-gradient(135deg, #2747c7, #ff5a36); }
.num { position: absolute; left: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--fondo); color: var(--tinta); font-weight: 800; font-size: 14px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.etq { position: absolute; right: 10px; top: 10px; font-size: 11.5px; font-weight: 800; padding: 4px 9px; border-radius: 10px; background: var(--fondo); color: var(--tinta); }
.etq.Gratis { color: var(--verde); }
.etq.Reservar { background: var(--avion); color: #fff; }
.etq.Imperdible { background: var(--tinta); color: #fff; }
.lugar-txt { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lugar-txt b { font-size: 16px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.lugar-txt p { margin: 0; font-size: 13.5px; color: var(--suave); flex: 1; }
.lugar-acc { display: flex; gap: 6px; margin-top: 10px; }
.lugar-acc .btn { flex: 1; }
.ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 13px; background: var(--gris); display: grid; place-items: center; color: var(--tinta); text-decoration: none; }
.ico svg { width: 18px; height: 18px; }

/* Notas */
.nota { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radio); padding: 14px; margin-top: 12px; font-size: 14px; }
.nota .nota-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.nota .nota-ico svg { width: 18px; height: 18px; }
.nota b { display: block; font-size: 14px; margin-bottom: 1px; }
.nota p { margin: 0; color: #344054; }
.nota .btn { margin-top: 10px; }
.nota.invierno { background: var(--hielo); }
.nota.invierno .nota-ico { background: #d9e6ff; color: var(--tren); }
.nota.comida { background: #fff4ef; }
.nota.comida .nota-ico { background: #ffe2d6; color: var(--avion); }
.siguiente { margin-top: 22px; }

/* Vista general: línea de tiempo */
.intro { font-size: 14px; color: var(--suave); margin: 6px 0 0; }
.cifras { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-top: 16px; }
.cifras div { background: var(--gris); border-radius: 14px; padding: 10px 6px; text-align: center; }
.cifras b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.cifras span { font-size: 11.5px; color: var(--suave); font-weight: 600; }
.linea-tiempo { list-style: none; margin: 18px 0 0; padding: 0; }
.parada button { display: grid; grid-template-columns: 56px minmax(0,1fr) 20px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 6px 0; }
.parada img, .parada .sin-foto { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: var(--gris); }
.parada .sin-foto { display: grid; place-items: center; font-weight: 800; color: var(--suave); }
.parada b { display: block; font-size: 16px; font-weight: 800; color: var(--tinta); }
.parada span { display: block; font-size: 13px; color: var(--suave); }
.parada .flecha { width: 18px; height: 18px; color: var(--tenue); }
.tramo-tl { display: flex; align-items: center; gap: 10px; margin-left: 27px; padding: 4px 0 4px 18px; border-left: 2px dashed var(--linea); font-size: 12.5px; font-weight: 700; color: var(--suave); }
.tramo-tl svg { width: 16px; height: 16px; }
.tramo-tl.avion svg { color: var(--avion); }
.tramo-tl.tren svg { color: var(--tren); }
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.check label { display: flex; gap: 12px; align-items: center; min-height: 50px; padding: 6px 8px 6px 14px; border-radius: 15px; background: var(--gris); cursor: pointer; font-weight: 600; font-size: 14px; }
.check input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c4cad4; background: var(--fondo); display: grid; place-items: center; margin: 0; }
.check input:checked { background: var(--verde); border-color: var(--verde); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check input:checked + span { text-decoration: line-through; color: var(--tenue); }
.check span { flex: 1; }
.check .btn { min-height: 36px; background: var(--fondo); }

/* Precios y presupuesto */
.lugar-txt p.aviso { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--avion); }
.ticket-precio { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 16px 0; padding: 10px 12px; border-radius: 14px; background: var(--gris); }
.ticket-precio small { font-size: 12px; font-weight: 700; color: var(--suave); }
.ticket-precio b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.presu { margin-top: 18px; border: 1px solid var(--linea); border-radius: var(--radio); padding: 14px 16px; }
.presu-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.presu-cab h3 { font-size: 16px; font-weight: 800; }
.presu-cab b { font-size: 20px; font-weight: 800; color: var(--verde); letter-spacing: -.02em; white-space: nowrap; }
.presu ul { list-style: none; margin: 0; padding: 0; }
.presu li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--linea); font-size: 13.5px; }
.presu li span { color: #344054; }
.presu li b { font-weight: 700; white-space: nowrap; }
.presu-total { border-radius: var(--radio); padding: 16px 18px; background: var(--tinta); color: #fff; }
.presu-total small { display: block; font-size: 12.5px; font-weight: 600; opacity: .7; }
.presu-total b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.presu-total span { font-size: 13px; opacity: .8; }
.presu-dias { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.presu-dias button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 0; border-radius: 15px; background: var(--gris); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pd-fecha { flex: 0 0 42px; height: 42px; border-radius: 11px; background: var(--fondo); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.pd-fecha small { font-size: 10px; font-weight: 700; color: var(--suave); text-transform: capitalize; }
.pd-fecha b { font-size: 16px; font-weight: 800; }
.pd-txt { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 700; }
.pd-txt i { display: block; height: 5px; border-radius: 3px; background: var(--verde); opacity: .75; }
.presu-dias button > b { font-weight: 800; white-space: nowrap; }
.presu-cats { list-style: none; margin: 14px 0 0; padding: 0; }
.presu-cats li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--linea); font-size: 14px; }
.presu-cats li b { font-weight: 800; }
.presu-cats li i { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: var(--tren); opacity: .6; }
.presu-nota { margin: 10px 0 0; font-size: 12.5px; color: var(--suave); }
.pie { color: var(--tenue); font-size: 12px; margin: 24px 0 0; }

/* ---------- Marcadores del mapa ---------- */
.pin-ciudad { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pin-ciudad i { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3.5px solid var(--tinta); flex: 0 0 auto; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pin-ciudad span { font-weight: 800; font-size: 13px; color: var(--tinta); background: rgba(255,255,255,.92); padding: 2px 8px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pin-ciudad.activa i { background: var(--avion); border-color: #fff; box-shadow: 0 0 0 3px var(--avion); }
.zoom-cerca .pin-ciudad { display: none; }
.pin-lugar { width: 32px; height: 32px; border-radius: 50%; background: var(--tinta); color: #fff; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); display: grid; place-items: center; font-weight: 800; font-size: 14px; transition: transform .15s, background .15s; }
.pin-lugar.activo { background: var(--avion); transform: scale(1.25); }
.ficha-viaje { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 3px 12px rgba(0,0,0,.3); }
.ficha-viaje.avion { color: var(--avion); }
.ficha-viaje.tren { color: var(--tren); }
.ficha-viaje svg { width: 24px; height: 24px; }

/* ---------- Compu: panel lateral flotante ---------- */
@media (min-width: 900px) {
  :root { --panel: 420px; }
  .hoja { position: fixed; left: 16px; top: 16px; bottom: 16px; width: var(--panel); margin: 0; min-height: 0; border-radius: 26px; overflow-y: auto; box-shadow: 0 12px 40px rgba(15,23,40,.18); }
  .hoja-cabeza { padding-top: 14px; }
  .tirador { display: none; }
  .top { left: calc(var(--panel) + 16px); padding-left: 16px; padding-right: 16px; }
  .cartel { bottom: 28px; left: calc(50% + var(--panel) / 2 + 8px); }
}
@media (max-width: 899px) { .leaflet-control-zoom { display: none; } }
@media (max-width: 360px) { .titulo { font-size: 24px; } .cifras b { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
