/* Buses al encuentro — misma identidad que el sitio principal (styles.css / identity.css) */
:root {
  --blue: #0657bf;
  --blue-bright: #1598e7;
  --navy: #041f49;
  --orange: #ff5a18;
  --orange-light: #ff8a24;
  --yellow: #ffc423;
  --sand: #f8f1e6;
  --paper: #fffdf8;
  --ink: #092b5f;
  --muted: #5d6980;
  --line: rgba(9, 43, 95, .14);
  --display: "Montserrat", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); line-height: 1.55; }
img { display: block; max-width: 100%; height: auto; }
.bh-shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.bh-eyebrow { margin: 0 0 12px; color: var(--yellow); font: 800 12px/1.3 var(--display); text-transform: uppercase; letter-spacing: .22em; }
.bh-eyebrow--dark { color: var(--orange); }
.bh-eyebrow::before { content: ""; display: block; width: 42px; height: 4px; margin-bottom: 14px; background: linear-gradient(90deg, var(--orange), var(--yellow)); }

/* Encabezado */
.bh-hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; padding-block: 34px 44px; }
.bh-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--orange), var(--orange-light), var(--yellow)); }
.bh-hero__inner { display: grid; gap: 26px; }
.bh-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bh-back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; color: #fff; text-decoration: none; font: 800 12px/1 var(--display); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; transition: background .2s ease, color .2s ease; }
.bh-back:hover, .bh-back:focus-visible { background: #fff; color: var(--navy); }
.bh-brand { width: 170px; }
.bh-brand img { width: 170px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.bh-hero h1 { margin: 0; font: 900 clamp(38px, 6vw, 68px)/.98 var(--display); letter-spacing: -.04em; }
.bh-lead { max-width: 60ch; margin: 16px 0 0; color: #c9d6ea; font-size: 17px; }
.bh-facts { display: flex; flex-wrap: wrap; gap: 18px 0; margin-top: 30px; }
.bh-fact { display: flex; align-items: center; gap: 12px; padding: 0 26px; border-left: 1px solid rgba(255,255,255,.3); }
.bh-fact:first-child { padding-left: 0; border-left: 0; }
.bh-fact__big { color: var(--orange-light); font: 900 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.bh-fact span:last-child { display: grid; gap: 3px; }
.bh-fact strong { font: 800 13px/1.2 var(--display); text-transform: uppercase; }
.bh-fact small { opacity: .72; font: 700 10px/1 var(--display); text-transform: uppercase; letter-spacing: .16em; }

/* Contenido */
.bh-main { padding-block: 56px 64px; }
.bh-heading h2 { margin: 0 0 32px; font: 800 clamp(26px, 3.4vw, 40px)/1.1 var(--display); letter-spacing: -.02em; text-wrap: balance; }

.bh-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.bh-line { --c: var(--blue); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(4, 31, 73, .08); }
.bh-line--orange { --c: var(--orange); }
.bh-line--purple { --c: #6335b1; }
.bh-line--green { --c: #12a57a; }
.bh-line__head { padding: 22px 24px 18px; border-top: 8px solid var(--c); }
.bh-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--c); color: #fff; font: 800 10px/1.4 var(--display); text-transform: uppercase; letter-spacing: .12em; }
.bh-line__head h3 { margin: 10px 0 2px; font: 800 26px/1.15 var(--display); }
.bh-line__head p { margin: 0; color: var(--muted); font-size: 15px; }

.bh-stops { list-style: none; margin: 0; padding: 6px 24px 8px; }
.bh-stop { display: grid; grid-template-columns: 62px 26px minmax(0, 1fr); column-gap: 10px; position: relative; padding-bottom: 18px; }
.bh-stop time { padding-top: 1px; color: var(--c); font: 800 19px/1.2 var(--display); font-variant-numeric: tabular-nums; }
/* raíl y punto */
.bh-stop::before { content: ""; position: absolute; left: 82px; top: 8px; bottom: -8px; width: 6px; background: var(--c); border-radius: 3px; }
.bh-stop:last-child::before { display: none; }
.bh-stop::after { content: ""; grid-column: 2; grid-row: 1; justify-self: center; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: #fff; border: 4px solid var(--c); position: relative; z-index: 1; box-sizing: border-box; }
.bh-stop > div { grid-column: 3; grid-row: 1; display: grid; gap: 1px; min-width: 0; }
.bh-stop strong { font: 800 17px/1.25 var(--display); }
.bh-stop span { color: var(--muted); font-size: 15px; }
.bh-stop em { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 4px; background: var(--sand); color: var(--ink); font: 700 12px/1.5 var(--body); font-style: normal; }
.bh-stop--end::after { width: 26px; height: 23px; margin-top: 0; border: 0; border-radius: 0; background: url("../logos/chacana_cruz.webp") center / contain no-repeat; }
.bh-stop--end time { color: var(--ink); }

.bh-line__note { margin: auto 0 0; padding: 14px 24px; background: var(--sand); color: var(--ink); font-size: 14px; border-top: 1px solid var(--line); }

/* Unión de las dos líneas */
.bh-merge { display: block; width: 100%; height: 70px; overflow: visible; }
.bh-merge path { fill: none; stroke-width: 6; vector-effect: non-scaling-stroke; stroke-linecap: round; }

/* Destino */
.bh-dest { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; padding: 26px 30px; border-radius: 14px; background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.bh-dest::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.bh-dest__mark { width: 84px; }
.bh-dest h2 { margin: 0; font: 900 clamp(26px, 3.4vw, 38px)/1.05 var(--display); }
.bh-dest__copy p:last-child { margin: 6px 0 0; color: #c9d6ea; }
.bh-dest__time { display: grid; justify-items: end; text-align: right; }
.bh-dest__time span { font: 700 11px/1 var(--display); text-transform: uppercase; letter-spacing: .16em; opacity: .75; }
.bh-dest__time b { color: var(--yellow); font: 900 52px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.bh-dest__time small { color: #c9d6ea; font-size: 13px; }

.bh-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 36px; }
.bh-button { min-height: 52px; padding: 0 26px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; text-decoration: none; font: 800 13px/1 var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--ink); border: 2px solid var(--ink); transition: transform .2s ease; }
.bh-button--primary { color: #fff; background: var(--orange); border-color: var(--orange); box-shadow: 0 16px 35px rgba(255, 90, 24, .32); }
.bh-button:hover, .bh-button:focus-visible { transform: translateY(-3px); }
a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.bh-foot { background: var(--navy); padding-block: 20px; }
.bh-foot a { color: #fff; text-decoration: none; font: 700 13px/1 var(--display); }
.bh-foot a:hover { text-decoration: underline; }

@media (max-width: 1000px) {
  .bh-lines { grid-template-columns: 1fr 1fr; }
  .bh-merge { display: none; }
  .bh-dest { margin-top: 28px; }
}
@media (max-width: 820px) {
  .bh-lines { grid-template-columns: 1fr; }
  .bh-merge { display: none; }
  .bh-dest { margin-top: 28px; grid-template-columns: auto minmax(0, 1fr); }
  .bh-dest__time { grid-column: 1 / -1; justify-items: start; text-align: left; }
}
@media (max-width: 560px) {
  .bh-shell { width: calc(100% - 32px); }
  .bh-brand, .bh-brand img { width: 120px; }
  .bh-back { min-height: 40px; padding: 0 14px; font-size: 11px; }
  .bh-fact { padding: 0; border-left: 0; flex-basis: 100%; }
  .bh-fact__big { min-width: 74px; }
  .bh-fact__big { font-size: 22px; }
  .bh-line__head, .bh-line__note { padding-inline: 18px; }
  .bh-stops { padding-inline: 18px; }
  .bh-stop { grid-template-columns: 54px 22px minmax(0, 1fr); column-gap: 8px; }
  .bh-stop time { font-size: 17px; }
  .bh-stop::before { left: 70px; }
  .bh-dest { padding: 22px 20px; }
  .bh-dest__mark { width: 60px; }
  .bh-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .bh-button { transition: none; } }

/* Foto del punto de salida dentro de la parada. */
.bh-stop__photo { margin: 10px 0 2px; max-width: 320px; }
.bh-stop__photo img { display: block; width: 100%; height: auto; aspect-ratio: 450 / 613; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 10px 24px rgba(4, 31, 73, .12); }
.bh-stop__photo figcaption { margin-top: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; }

/* Grilla 2x2: cada tarjeta estira su recorrido hasta abajo. La línea de color une la
   última parada con la llegada, así Huasco no queda con un espacio vacío y todas las
   llegadas (Casino Antay) quedan alineadas en la misma fila. */
.bh-stops { flex: 1; display: flex; flex-direction: column; }
.bh-stop:nth-last-child(2) { flex: 1; }
.bh-stop:nth-last-child(2)::before { bottom: -18px; }
.bh-stop > div { align-content: start; }
@media (min-width: 821px) { .bh-line__note { min-height: 74px; } }
