/* Radiotaxi Los Libertadores · loslibertadoresrt.cl
   Negro y blanco puros. El único color es el verde de WhatsApp. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --negro: #000;
  --blanco: #fff;
  --gris-claro: #c4c4c4;   /* texto secundario sobre negro */
  --gris-medio: #8a8a8a;   /* rótulos pequeños sobre negro */
  --linea: #2a2a2a;        /* filetes sobre negro */
  --campo: #f1f1f1;        /* campos del cotizador */
  --tinta-suave: #5c5c5c;  /* texto secundario sobre blanco */
  --whatsapp: #25d366;
  --error: #b3001b;

  --margen: clamp(18px, 4.2vw, 64px);
  --alto-barra: 64px;
  --alto-tira: 56px;                 /* barra superior del cotizador */
  --alto-panel: 33.334svh;           /* alto del cotizador abierto (lo ajusta sitio.js) */
  --alto-muelle: var(--alto-panel);  /* alto actual: abierto o minimizado */
  --radio: 8px;
  --ancho: 1200px;                   /* ancho máximo del contenido (columna centrada) */
  /* margen lateral de un bloque a todo el ancho de la pantalla, para que su contenido caiga dentro de la columna */
  --lado: max(var(--margen), calc((100% - var(--ancho)) / 2 + var(--margen)));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--negro);
  color: var(--blanco);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-barra) + 20px);
  scroll-padding-bottom: calc(var(--alto-muelle) + 20px);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  padding-bottom: var(--alto-muelle);
}

[hidden] { display: none !important; }

h1, h2, h3, p, ul, dl, dd, figure, table { margin: 0; padding: 0; }
ul { list-style: none; }
img, svg { display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--blanco); outline-offset: 3px; }
.cotizador :focus-visible { outline-color: var(--negro); }

.oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
svg.oculto { width: 0; height: 0; }

.saltar {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  background: var(--blanco); color: var(--negro);
  padding: 12px 16px; border-radius: var(--radio); font-weight: 600;
}
.saltar:focus { top: 12px; }

/* ───────── Botones ───────── */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 18px;
  border: 0; border-radius: var(--radio);
  font-weight: 600; font-size: 0.9375rem; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s;
}
.boton svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.boton--whatsapp { background: var(--whatsapp); color: var(--negro); }
.boton--whatsapp:hover { background: #1fbf5b; }
.boton--negro { background: var(--negro); color: var(--blanco); }
.boton--negro:hover { background: #2b2b2b; }
.boton--negro[disabled] { background: #6f6f6f; cursor: progress; }
.boton--grande { height: 60px; padding: 0 28px; font-size: 1.0625rem; }
.boton--grande svg { width: 24px; height: 24px; }

.enlace {
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; font-weight: 500;
}

/* ───────── Barra fija superior ───────── */

.barra {
  position: fixed; inset: 0 auto auto 50%; z-index: 40;
  width: min(100%, var(--ancho)); transform: translateX(-50%);
  height: var(--alto-barra);
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  padding: 0 var(--margen);
  background: var(--negro);
}

.marca { display: flex; align-items: center; margin-right: auto; text-decoration: none; }
.marca img { height: 52px; width: auto; }

.menu { display: flex; gap: clamp(18px, 2.4vw, 34px); }
.menu a {
  position: relative;
  padding: 8px 0;
  font-size: 0.9375rem; font-weight: 500;
  text-decoration: none;
}
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--blanco);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s;
}
.menu a:hover::after,
.menu a[aria-current="true"]::after { transform: scaleX(1); }

/* ───────── Portada ───────── */

.portada {
  position: relative;
  height: 100svh; min-height: 520px;
  padding-top: var(--alto-barra);
  padding-bottom: var(--alto-panel);
  display: flex;
  overflow: clip;
}

.portada__pista {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  padding: 0 var(--lado);
}

.portada__escena { position: relative; width: 100%; }

.portada__texto { width: fit-content; max-width: 100%; }

.portada h1 {
  font-size: clamp(2.4rem, 7.4vw, 6.5rem);
  font-weight: 720; font-stretch: 114%;
  line-height: 0.93; letter-spacing: -0.04em;
}
.portada h1 span { display: block; }

.portada__bajada {
  margin-top: clamp(16px, 2.2vw, 30px);
  max-width: 31ch;
  font-size: clamp(1.0625rem, 1.65vw, 1.5rem);
  line-height: 1.28; letter-spacing: -0.005em;
}

/* Línea segmentada de la calzada: separa la pista de ida (2/3) de la de vuelta (1/3) */
.portada__eje {
  position: absolute; left: 0; right: 0; bottom: calc(var(--alto-panel) - 34px);
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--blanco) 0 56px, transparent 56px 104px);
  opacity: 0.9;
}

/* ───────── Autos de la portada ───────── */

.auto {
  display: none;
  position: absolute; left: 0; top: 50%; z-index: 5;
  transform: translate3d(var(--x, -200vw), -50%, 0);
  pointer-events: none;
}
.auto img { height: 100%; width: auto; max-width: none; position: relative; }

.auto--sedan { height: min(120%, 21vw, 300px); aspect-ratio: 1600 / 727; }
.auto--suv   { height: min(82%, 17.5vw, 250px); aspect-ratio: 1600 / 782; }

/* Haz de los focos, por delante del auto */
.auto__luces {
  position: absolute; top: 50%;
  width: 150%; height: 210%;
  transform: translateY(-50%);
  filter: blur(14px);
}
.auto--sedan .auto__luces {
  left: 93%;
  background: linear-gradient(90deg, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0) 84%);
  clip-path: polygon(0 39%, 100% 0, 100% 100%, 0 61%);
  -webkit-mask-image: radial-gradient(ellipse 100% 50% at 0 50%, #000 12%, transparent 100%);
          mask-image: radial-gradient(ellipse 100% 50% at 0 50%, #000 12%, transparent 100%);
}
.auto--suv .auto__luces {
  right: 93%;
  background: linear-gradient(270deg, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0) 84%);
  clip-path: polygon(100% 39%, 0 0, 0 100%, 100% 61%);
  -webkit-mask-image: radial-gradient(ellipse 100% 50% at 100% 50%, #000 12%, transparent 100%);
          mask-image: radial-gradient(ellipse 100% 50% at 100% 50%, #000 12%, transparent 100%);
}

/* Estado de entrada: pre.js pone .anim en <html> y sitio.js mueve los autos.
   Sin JavaScript o con "reducir movimiento", todo se ve desde el inicio. */
.anim .auto { display: block; will-change: transform; }
.anim .portada__texto {
  clip-path: inset(-0.6em calc(100% - var(--corte, 0px)) -0.6em -0.6em);
}
.anim .cotizador { clip-path: inset(0 0 0 var(--corte-panel, 100%)); }

/* ───────── Cotizador (fijo abajo) ───────── */

/* El muelle ocupa todo el ancho para que el SUV cruce la pantalla entera; el cotizador blanco va en la columna */
.muelle { position: fixed; inset: auto 0 0 0; z-index: 30; pointer-events: none; }

.cotizador {
  width: min(100%, var(--ancho)); margin-inline: auto; pointer-events: auto;
  background: var(--blanco); color: var(--negro); border-radius: 18px 18px 0 0; overflow: hidden;
}

.cotizador__barra {
  width: 100%; height: var(--alto-tira);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--margen);
  background: var(--blanco);
  border: 0; border-bottom: 1px solid #dedede;
  text-align: left; cursor: pointer;
}
.cotizador__flecha {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  background: var(--negro); color: var(--blanco);
  border-radius: var(--radio);
}
.cotizador__flecha svg { width: 18px; height: 18px; transition: transform 0.3s; }
.cotizador__titulo { font-size: 1.125rem; font-weight: 720; font-stretch: 110%; letter-spacing: -0.015em; }
.cotizador__nota { margin-left: auto; font-size: 0.875rem; color: var(--tinta-suave); }

.cotizador__cuerpo {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows 0.38s cubic-bezier(0.3, 0, 0.1, 1);
}
.cotizador__interior { min-height: 0; overflow: hidden; }

.cotizador[data-estado="minimizado"] .cotizador__cuerpo { grid-template-rows: 0fr; }
.cotizador[data-estado="minimizado"] .cotizador__barra { border-bottom-color: transparent; }
.cotizador[data-estado="minimizado"] .cotizador__flecha svg { transform: rotate(180deg); }

.formulario, .resultado {
  min-height: calc(33.334svh - var(--alto-tira));
  padding: 20px var(--margen) 22px;
}

.formulario {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-content: center; align-items: end;
  gap: 12px 14px;
}

.campo label {
  display: block; margin-bottom: 7px;
  font-size: 0.8125rem; font-weight: 600; line-height: 1.2;
}
.campo input {
  width: 100%; height: 54px; padding: 0 14px;
  background: var(--campo); color: var(--negro);
  border: 2px solid var(--campo); border-radius: var(--radio);
  font-size: 1rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.campo input::placeholder { color: #8d8d8d; }
.campo input:hover { border-color: #cfcfcf; }
.campo input:focus { outline: 0; border-color: var(--negro); background: var(--blanco); }
.campo input[aria-invalid="true"] { border-color: var(--error); background: #fff5f6; }

.campo--trampa { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }

.formulario .boton { height: 54px; padding: 0 22px; font-size: 1rem; }

.formulario__aviso, .formulario__legal { grid-column: 1 / -1; }
.formulario__aviso { color: var(--error); font-size: 0.875rem; font-weight: 600; }
.formulario__aviso:empty { display: none; }
.formulario__aviso a { color: inherit; }
.formulario__legal { font-size: 0.75rem; line-height: 1.4; color: var(--tinta-suave); }

.resultado { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.resultado[hidden] { display: none; }
.resultado:focus { outline: 0; }
.resultado__titulo { font-size: clamp(1.25rem, 2.2vw, 1.875rem); font-weight: 720; font-stretch: 110%; letter-spacing: -0.02em; line-height: 1.1; }
.resultado__texto { color: var(--tinta-suave); max-width: 60ch; }
.resultado__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 12px; }

/* ───────── Secciones ───────── */

.seccion {
  position: relative;
  padding: clamp(72px, 10.5vw, 136px) var(--lado);
}
.seccion::before, .pie::before {
  content: ""; position: absolute; top: 0; left: var(--lado); right: var(--lado);
  height: 1px; background: var(--linea);
}

.seccion h2 {
  font-size: clamp(2rem, 4.9vw, 4.6rem);
  font-weight: 720; font-stretch: 112%;
  line-height: 0.98; letter-spacing: -0.035em;
  text-wrap: balance;
}

/* Servicio */

.servicio__cabeza {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 88px); align-items: end;
}
.servicio__intro { font-size: clamp(1.0625rem, 1.35vw, 1.25rem); line-height: 1.45; }
.reloj {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--linea);
  font-weight: 600; font-variant-numeric: tabular-nums;
}

.pizarra { margin-top: clamp(56px, 8vw, 120px); }
.pizarra__titulo {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-bottom: 14px;
  font-weight: 600;
}
.pizarra__titulo span { font-weight: 400; font-size: 0.875rem; color: var(--gris-medio); }
.pizarra table { width: 100%; border-collapse: collapse; }
.pizarra thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pizarra td {
  padding: clamp(14px, 2vw, 26px) 0;
  border-top: 1px solid var(--linea);
  vertical-align: baseline;
  font-size: clamp(1rem, 1.7vw, 1.5rem);
}
.pizarra tr:last-child td { border-bottom: 1px solid var(--linea); }
.pizarra td:first-child {
  width: 22%;
  font-size: clamp(1.75rem, 4.4vw, 4rem);
  font-weight: 300; font-stretch: 118%;
  letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pizarra td:nth-child(2) { width: 38%; font-weight: 600; }
.pizarra td:last-child { color: var(--gris-claro); text-align: right; }
.pizarra td i { font-style: normal; padding: 0 0.2em; color: var(--blanco); }

.preguntas {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(56px, 8vw, 120px);
}
.preguntas dt { font-size: 1.125rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.preguntas dd { margin-top: 10px; color: var(--gris-claro); }

/* Trayectoria */

.cifras { margin-top: clamp(40px, 6vw, 96px); }
.cifras li {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 5vw, 88px); align-items: end;
  padding: clamp(22px, 3vw, 44px) 0;
  border-top: 1px solid var(--linea);
}
.cifras li:last-child { border-bottom: 1px solid var(--linea); }
.cifras strong {
  display: block;
  font-size: clamp(5.25rem, 17vw, 12rem);
  font-weight: 800; font-stretch: 125%;
  line-height: 0.8; letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.cifras__mas { font-weight: 250; letter-spacing: 0; margin-right: 0.03em; }
.cifras p { max-width: 30ch; padding-bottom: 0.4em; font-size: clamp(1.0625rem, 1.5vw, 1.375rem); line-height: 1.3; color: var(--gris-claro); }
.cifras p b { color: var(--blanco); font-weight: 650; }

/* Cobertura */

.cobertura__cabeza {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 88px); align-items: end;
}
.cobertura__cabeza p { font-size: clamp(1.0625rem, 1.35vw, 1.25rem); line-height: 1.45; }

.cobertura__cuerpo {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 88px);
  margin-top: clamp(40px, 6vw, 96px);
}

.cobertura__mapas {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 40px); align-items: end; align-content: start;
}
.cobertura__rotulo {
  grid-column: 1 / -1;
  min-height: 1.1em;
  font-size: clamp(1.5rem, 3.2vw, 2.75rem);
  font-weight: 720; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1.1;
}

.mapa svg { width: 100%; height: auto; overflow: hidden; }
.mapa figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--gris-medio); }
.mapa__comunas path {
  fill: var(--negro);
  stroke: #7d7d7d; stroke-width: 0.9; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.12s;
}
.mapa__comunas path:hover,
.mapa__comunas path.activa { fill: var(--blanco); stroke: var(--blanco); }
.mapa__marco { fill: none; stroke: var(--blanco); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; pointer-events: none; }

.cobertura__lista { display: grid; gap: 22px; align-content: start; }
.cobertura__lista h3 { margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; color: var(--gris-medio); }
.cobertura__lista p { font-size: 1rem; line-height: 1.75; }
.cobertura__lista span {
  display: inline-block; margin: 0 2px 0 -5px; padding: 0 5px;
  border-radius: 4px; cursor: default; white-space: nowrap;
}
.cobertura__lista span:hover,
.cobertura__lista span.activa { background: var(--blanco); color: var(--negro); }

/* Empresas (se muestra solo si empresas.json trae nombres) */

.empresas__lista {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  margin-top: clamp(40px, 6vw, 96px);
  border-top: 1px solid var(--linea); border-left: 1px solid var(--linea);
}
.empresas__lista li {
  display: grid; place-items: center;
  min-height: 132px; padding: 24px;
  border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea);
  font-size: 1.125rem; font-weight: 650; text-align: center; line-height: 1.2;
}
.empresas__lista img { max-width: 150px; max-height: 64px; width: auto; height: auto; }

/* Cierre y pie */

.cierre { display: grid; gap: clamp(28px, 4vw, 56px); }
.cierre__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.cierre__telefono {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300; font-stretch: 118%; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.cierre__telefono:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.pie {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
  position: relative; align-items: center;
  padding: 36px var(--lado) 40px;
  font-size: 0.875rem; color: var(--gris-claro);
}
.pie__logo { height: 92px; width: auto; }

/* Páginas de texto (privacidad, 404) */

.texto { max-width: var(--ancho); margin-inline: auto; padding: calc(var(--alto-barra) + clamp(48px, 8vw, 110px)) var(--margen) clamp(64px, 9vw, 120px); }
.texto > * { max-width: 70ch; }
.texto h1 { font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 720; font-stretch: 112%; line-height: 1; letter-spacing: -0.035em; }
.texto h2 { margin-top: 40px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.texto p, .texto ul { margin-top: 14px; color: var(--gris-claro); }
.texto ul { list-style: disc; padding-left: 1.2em; }
.texto li + li { margin-top: 6px; }
.texto a { color: var(--blanco); text-underline-offset: 3px; }
.cuerpo-simple { padding-bottom: 0; }

/* ───────── Pantallas angostas ───────── */

@media (max-width: 899px) {
  :root { --alto-barra: 92px; --alto-tira: 52px; --alto-panel: 46svh; }

  .barra {
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: 52px 39px;
    align-items: center; gap: 0 12px;
  }
  .marca img { height: 44px; }
  .barra .boton { height: 38px; padding: 0 13px; font-size: 0.875rem; }
  .barra .boton svg { width: 18px; height: 18px; }
  .menu {
    grid-column: 1 / -1; grid-row: 2;
    gap: 22px; align-self: stretch; align-items: center;
    margin: 0 calc(var(--margen) * -1); padding: 0 var(--margen);
    border-top: 1px solid var(--linea);
  }
  .menu a { padding: 6px 0; font-size: 0.875rem; }
  .menu a::after { bottom: 0; }

  .portada h1 { font-size: clamp(2.1rem, 11.3vw, 4.25rem); font-stretch: 104%; }
  .portada__bajada { max-width: 26ch; }
  .portada__eje { background: repeating-linear-gradient(90deg, var(--blanco) 0 34px, transparent 34px 62px); height: 2px; }

  .auto--sedan { height: min(112%, 38vw); }
  .auto--suv { height: min(70%, 34vw); }

  .cotizador__nota { display: none; }
  .cotizador__flecha { width: 32px; height: 32px; }

  .formulario, .resultado { min-height: 0; padding: 14px var(--margen) 16px; }
  .formulario { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .campo label { margin-bottom: 5px; font-size: 0.75rem; }
  .campo input { height: 46px; padding: 0 11px; }
  .formulario .boton { grid-column: 1 / -1; height: 48px; }
  .formulario__legal { font-size: 0.6875rem; }

  .servicio__cabeza, .cobertura__cabeza, .cobertura__cuerpo, .cifras li { grid-template-columns: minmax(0, 1fr); }
  .cifras li { gap: 14px; }
  .cifras p { padding-bottom: 0; }

  .pizarra td { display: block; width: auto !important; padding: 0; border-top: 0; text-align: left !important; }
  .pizarra tr { display: block; padding: 16px 0; border-top: 1px solid var(--linea); }
  .pizarra tr:last-child { border-bottom: 1px solid var(--linea); }
  .pizarra tr:last-child td { border-bottom: 0; }
  .pizarra td:first-child { margin-bottom: 8px; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
