/* ==========================================================================
   COBERTURA.CSS — solo para cobertura.html
   Requiere que base.css esté cargado antes (usa sus componentes de
   formulario: .form-field, .form-row, .btn-submit, .form-status).
   ========================================================================== */

/* --- Rutas destacadas: carrusel horizontal con flechas --- */
.routes {
  background: var(--bg-page);
  padding-block: 8px 64px;
}
.routes h2 {
  color: var(--maroon);
  font-size: 1.9rem;
  margin-bottom: 8px;
}
.routes-subtitle {
  color: var(--navy);
  font-weight: 500;
  margin: 0 0 32px;
}
.routes-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Flechas: blancas con borde; se llenan de navy al pasar el cursor */
.routes-arrow {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--bg-white);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(12, 33, 43, 0.08);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.routes-arrow:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  transform: scale(1.06);
}
.routes-arrow.is-disabled { opacity: 0.35; }
.routes-arrow.is-disabled:hover {
  background: var(--bg-white);
  border-color: var(--line);
  color: var(--navy);
  transform: none;
}
.routes-arrow svg { width: 20px; height: 20px; }

/* El viewport recorta horizontalmente; el padding vertical deja espacio
   para que la elevación y la sombra de las tarjetas no se corten. El
   margen negativo compensa ese padding para no mover el diseño. */
.routes-viewport {
  flex: 1;
  overflow: hidden;
  min-width: 0; /* evita que el flex item se resista a encogerse */
  padding-block: 10px 30px;
  margin-block: -10px -30px;
}
.routes-track {
  display: flex;
  gap: 24px;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Tarjeta de ruta --- */
.route-card {
  /* Ancho fijo en píxeles (no %), así el cálculo nunca depende del
     ancho del propio contenedor y el carrusel funciona siempre. */
  flex: 0 0 300px;
  width: 300px;
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 26px 24px;
  box-shadow: 0 4px 18px rgba(12, 33, 43, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.route-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(12, 33, 43, 0.12);
  border-color: rgba(12, 98, 145, 0.28);
}

/* Trayecto Altamira → destino */
.route-path {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.route-path-origin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.route-path-origin::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(246, 174, 45, 0.22);
}
.route-path-line {
  flex: 1;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--orange) 0 6px, transparent 6px 12px);
  background-size: 12px 2px;
}
/* Al pasar el cursor, la línea punteada "avanza" hacia el destino */
.route-card:hover .route-path-line {
  animation: route-dash 0.6s linear infinite;
}
@keyframes route-dash {
  to { background-position: 12px 0; }
}
.route-path-pin {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(166, 52, 70, 0.3);
}
.route-path-pin svg { width: 18px; height: 18px; }

.route-card h3 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.route-description {
  color: #4B5A66;
  margin: 0 0 20px;
  font-size: 0.92rem;
}

/* Parte inferior: ciudades o "Todo el estado", siempre alineada abajo */
.route-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed rgba(12, 98, 145, 0.22);
}
.route-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.route-cities li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: #F1F6F9;
  color: var(--navy);
}
.route-cities li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--maroon);
}
.route-statewide {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(246, 174, 45, 0.16);
  color: #8A5A00;
  font-size: 0.82rem;
  font-weight: 600;
}
.route-statewide svg {
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
}

/* --- Tarjeta "Entre otras": fondo navy.
   Estas reglas van DESPUÉS de las generales para ganar el empate de
   especificidad (texto blanco, no navy sobre navy). --- */
.route-card--more {
  background: var(--navy);
  border-color: var(--navy);
}
.route-card--more:hover { border-color: var(--navy-dark); }
.route-card--more h3 { color: #fff; }
.route-card--more .route-description { color: rgba(255, 255, 255, 0.85); }
.route-card--more .route-path-origin { color: #fff; }
.route-card--more .route-path-line {
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 6px, transparent 6px 12px);
}
.route-card--more .route-path-pin {
  background: var(--orange);
  color: var(--navy);
  box-shadow: none;
}
.route-card--more .route-foot { border-top-color: rgba(255, 255, 255, 0.22); }
.route-card--more .btn { align-self: flex-start; }

/* --- Rastreo de ruta + ingreso de datos --- */
.tracking {
  background: var(--bg-white);
  padding-block: 64px 88px;
}
.tracking-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: stretch;
}
.tracking-map {
  background: var(--bg-page);
  border-radius: 20px;
  padding: 36px;
}
.tracking-map h3 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.tracking-map p {
  color: #4B5A66;
  margin: 0 0 24px;
  max-width: 46ch;
}
.route-map {
  width: 100%;
  height: auto;
  border-radius: 16px;
}
.tracking-form-card {
  background: var(--bg-page);
  border-radius: 20px;
  padding: 36px;
}
.tracking-form-card h3 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.tracking-form-card > p {
  color: #4B5A66;
  margin: 0 0 24px;
}
.tracking-form .form-field input {
  background: var(--bg-white);
}

@media (prefers-reduced-motion: reduce) {
  .route-card:hover { transform: none; }
  .route-card:hover .route-path-line { animation: none; }
}

/* ==========================================================================
   RESPONSIVE — Cobertura
   ========================================================================== */
@media (max-width: 880px) {
  .tracking-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .route-card { flex-basis: 260px; width: 260px; padding: 22px 20px 20px; }
  .routes-carousel { gap: 8px; }
  .routes-arrow { width: 38px; height: 38px; }
}