/* ==========================================================================
   RAHAZO · pages.css
   Paginas internas: cabecera de pagina, detalle de servicio, prosa legal,
   flota, requisitos, rastreo, noticias y 404
   Depende de: tokens.css, base.css, layout.css, components.css
   ========================================================================== */

/* --- CABECERA DE PAGINA INTERNA ---------------------------------------- */
.page-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(var(--sp-7), 8vw, var(--sp-9)) var(--sp-7);
  background: var(--bg-deep);
  border-bottom: var(--border-w) solid var(--border);
  overflow: hidden;
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.page-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--bg-deep) 20%, rgba(11, 12, 13, 0.6));
}

.page-hero__inner {
  display: grid;
  justify-items: start;
  gap: var(--sp-4);
  max-width: 820px;
}

.page-hero__title {
  font-size: var(--fs-3xl);
  text-transform: uppercase;
}

.page-hero__title span {
  color: var(--brand-on-dark);
}

/* --- DETALLE DE SERVICIO: contenido + aside de cotizacion -------------- */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(var(--sp-6), 5vw, var(--sp-8));
  align-items: start;
}

.detail__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-5));
  display: grid;
  gap: var(--sp-5);
}

@media (max-width: 999px) {
  .detail { grid-template-columns: 1fr; }
  .detail__aside { position: static; }
}

.spec-table {
  font-size: var(--fs-sm);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.spec-table th,
.spec-table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: var(--border-w) solid var(--border);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

.spec-table th {
  width: 42%;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  background: var(--surface);
}

.contact-box {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
}

.contact-box__title {
  font-size: var(--fs-md);
}

.contact-box__phone {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  color: var(--cta);
  text-decoration: none;
}

/* --- PROSA (legal, articulos, historia) -------------------------------- */
.prose {
  max-width: 72ch;
  color: var(--text-muted);
}

.prose > * + * {
  margin-top: var(--sp-4);
}

.prose h2,
.prose h3 {
  margin-top: var(--sp-7);
  color: var(--text);
}

.prose h2 { font-size: var(--fs-xl); }
.prose h3 { font-size: var(--fs-lg); }

.prose ul,
.prose ol {
  padding-left: var(--sp-5);
}

.prose li + li {
  margin-top: var(--sp-2);
}

.prose strong {
  color: var(--text);
}

.prose blockquote {
  padding: var(--sp-4) var(--sp-5);
  color: var(--text);
  background: var(--surface);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose img {
  border-radius: var(--radius);
}

.legal-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* --- FLOTA ------------------------------------------------------------- */
.fleet-card .card__media {
  aspect-ratio: 4 / 3;
}

.fleet-card .spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  padding: 0;
  list-style: none;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.fleet-card .spec-list strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text);
}

/* --- REQUISITOS (transportistas) --------------------------------------- */
.steps {
  display: grid;
  gap: var(--sp-4);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps__item {
  position: relative;
  padding: var(--sp-5) var(--sp-5) var(--sp-5) calc(var(--sp-8) + var(--sp-2));
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}

.steps__item::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: var(--sp-5);
  top: var(--sp-5);
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  line-height: 1;
  color: var(--brand-on-dark);
}

.steps__title {
  font-size: var(--fs-md);
  margin-bottom: var(--sp-1);
}

.steps__text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --- RASTREO ----------------------------------------------------------- */
.tracking {
  display: grid;
  gap: var(--sp-5);
  max-width: 640px;
  padding: var(--sp-6);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-top: 4px solid var(--warning);
  border-radius: var(--radius);
}

.tracking__form {
  display: flex;
  gap: var(--sp-3);
}

.tracking__form .field__control {
  flex: 1;
}

@media (max-width: 599px) {
  .tracking__form { flex-direction: column; }
}

.detail .tracking {
  max-width: none;
}

/* --- NOTICIAS ---------------------------------------------------------- */
.post-card .card__date {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.article__head {
  display: grid;
  gap: var(--sp-3);
  max-width: 72ch;
  margin-bottom: var(--sp-6);
}

.article__cover {
  margin-bottom: var(--sp-7);
  aspect-ratio: 21 / 9;
  border-radius: var(--radius);
  overflow: hidden;
}

.article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- 404 --------------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding-block: var(--sp-8);
  text-align: center;
}

.error-page__code {
  font-family: var(--font-heading);
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px var(--brand-on-dark);
}

.error-page__inner {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
}

/* ==========================================================================
   COBERTURA (cobertura/index.html) · esquema de corredores + tarjetas
   Modulo JS: assets/js/modules/route-map.js
   ========================================================================== */

/* --- Esquema SVG ------------------------------------------------------- */
.route-map {
  position: relative;
  padding: var(--sp-5);
  background: var(--bg-deep);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-lg);
}

.route-map__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.route-map__dot { fill: rgba(148, 152, 159, 0.16); }

.route-map__line {
  fill: none;
  stroke: var(--acero);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2 7;
  transition: stroke var(--dur) ease, stroke-width var(--dur) ease, opacity var(--dur) ease;
}

.route-map__route {
  cursor: pointer;
}

/* Linea invisible mas gruesa para facilitar clic/hover */
.route-map__route:hover .route-map__line,
.route-map__route.is-active .route-map__line {
  stroke: var(--rojo-senal);
  stroke-width: 4;
  stroke-dasharray: none;
}

.route-map__svg[data-active]:not([data-active='']) .route-map__route:not(.is-active) .route-map__line {
  opacity: 0.25;
}

.route-map__city circle {
  fill: var(--bg-deep);
  stroke: var(--acero);
  stroke-width: 2;
  transition: fill var(--dur), stroke var(--dur);
}

.route-map__city text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  fill: var(--text-muted);
  paint-order: stroke;
  stroke: var(--bg-deep);
  stroke-width: 4px;
  stroke-linejoin: round;
  transition: fill var(--dur);
}

.route-map__city--via text { font-size: 11px; font-weight: var(--fw-medium); opacity: 0.75; }
.route-map__city--via circle { stroke-width: 1.5; }

.route-map__city--end text,
.route-map__city--hub text {
  font-size: 15px;
  font-weight: var(--fw-bold);
  fill: var(--text);
}

.route-map__city--hub circle {
  fill: var(--cta);
  stroke: var(--bg-deep);
  stroke-width: 3;
}

.route-map__city--hub text {
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  fill: var(--cta);
}

.route-map__city.is-active circle {
  fill: var(--rojo-senal);
  stroke: var(--rojo-senal);
}

.route-map__city.is-active text {
  fill: var(--text);
}

.route-map__pulse {
  fill: none;
  stroke: var(--cta);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: route-pulse 2.2s var(--ease-out) infinite;
  pointer-events: none;
}

@keyframes route-pulse {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(3.2); opacity: 0; }
}

.route-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.route-map__chip {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast);
}

.route-map__chip:hover,
.route-map__chip.is-active {
  color: var(--text);
  border-color: var(--rojo-senal);
  background: rgba(180, 21, 37, 0.18);
}

.route-map__note {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

@media (max-width: 599px) {
  .route-map { padding: var(--sp-3); }
  .route-map__city--via text { display: none; }
}

/* --- Tarjeta de corredor ----------------------------------------------- */
.corridors {
  display: grid;
  gap: var(--sp-5);
}

.corridor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-5) var(--sp-7);
  padding: var(--sp-6);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--header-h) + var(--sp-5));
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}

.corridor.is-active,
.corridor:target {
  border-left-color: var(--rojo-senal);
  box-shadow: var(--shadow-lg);
}

.corridor__head {
  display: grid;
  gap: var(--sp-2);
}

.corridor__code {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wider);
  color: var(--brand-on-dark);
}

.corridor__title {
  font-size: var(--fs-xl);
  text-transform: uppercase;
}

.corridor__title .arrow {
  color: var(--cta);
  margin-inline: 0.15em;
}

.corridor__via {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.corridor__specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, auto));
  gap: var(--sp-3) var(--sp-6);
  align-content: start;
  margin: 0;
}

.corridor__specs dt {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.corridor__specs dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
}

.corridor__body {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--sp-4);
}

.corridor__text {
  color: var(--text-muted);
  max-width: 70ch;
}

.corridor__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 0;
  list-style: none;
}

.corridor__foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  padding-top: var(--sp-4);
  border-top: var(--border-w) solid var(--border);
}

@media (max-width: 699px) {
  .corridor { grid-template-columns: 1fr; padding: var(--sp-5); }
}

/* --- Derivaciones del corredor Sureste --------------------------------- */
.derivations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--sp-2);
  padding: 0;
  list-style: none;
}

.derivations li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  background: var(--bg);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
}

.derivations strong {
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.derivations span {
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Layout de la pagina ----------------------------------------------- */
.coverage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(var(--sp-6), 4vw, var(--sp-8));
  align-items: start;
}

.coverage-layout__map {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-5));
}

@media (max-width: 1099px) {
  .coverage-layout { grid-template-columns: 1fr; }
  .coverage-layout__map { position: static; }
}

/* Dentro del layout de dos columnas la tarjeta va en una sola columna */
.coverage-layout .corridor {
  grid-template-columns: 1fr;
}

/* ==========================================================================
   SERVICIOS (servicios/*.html) · equipos, proceso y bloques de detalle
   ========================================================================== */
.detail__main {
  display: grid;
  gap: var(--sp-8);
  min-width: 0;
}

.block {
  display: grid;
  gap: var(--sp-4);
}

.block__title {
  font-size: var(--fs-xl);
}

/* --- Tarjeta de equipo (usa el sprite #veh-*) -------------------------- */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--sp-3);
}

.equip-card {
  position: relative;
  display: grid;
  gap: var(--sp-2);
  align-content: start;
  padding: var(--sp-5);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur) ease, transform var(--dur) var(--ease-out);
}

.equip-card:hover,
.equip-card:focus-within {
  border-color: var(--cta);
  transform: translateY(-3px);
}

.equip-card__icon {
  width: 100%;
  max-width: 170px;
  height: 52px;
  margin-bottom: var(--sp-2);
  color: var(--acero);
  transition: color var(--dur) ease;
}

.equip-card:hover .equip-card__icon,
.equip-card:focus-within .equip-card__icon {
  color: var(--cta);
}

.equip-card__name {
  font-size: var(--fs-md);
}

.equip-card__name a {
  color: inherit;
  text-decoration: none;
}

.equip-card__name a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.equip-card__meta {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--cta);
}

.equip-card__text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --- Proceso en fila (4 pasos) ----------------------------------------- */
.steps--row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 999px) {
  .steps--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  .steps--row { grid-template-columns: 1fr; }
}

/* --- Nota informativa --------------------------------------------------- */
.info-note {
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: rgba(23, 58, 106, 0.25);
  border-left: 4px solid var(--azul-senal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.info-note strong {
  color: var(--text);
}

/* --- Enlaces a otros servicios ----------------------------------------- */
.related {
  display: grid;
  gap: var(--sp-2);
  padding: 0;
  list-style: none;
}

.related a {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  font-weight: var(--fw-semibold);
  color: var(--text);
  text-decoration: none;
  border-bottom: var(--border-w) solid var(--border);
}

.related a::after {
  content: '\2192';
  color: var(--text-muted);
}

.related a:hover::after {
  color: var(--brand-on-dark);
}

/* ==========================================================================
   NOSOTROS (nosotros/*.html) · inventario, mision/vision, valores
   ========================================================================== */
.equip-card__count {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  min-width: 44px;
  padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  line-height: 1.2;
  text-align: center;
  color: var(--on-cta);
  background: var(--cta);
  border-radius: var(--radius-sm);
}

.equip-card--support .equip-card__count {
  color: var(--text);
  background: var(--corporate);
}

.inventory-total {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-7);
}

/* --- Mision y vision --------------------------------------------------- */
.purpose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
}

@media (max-width: 799px) {
  .purpose { grid-template-columns: 1fr; }
}

.purpose__item {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  padding: var(--sp-7) var(--sp-6);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
}

.purpose__item:nth-child(2) {
  border-top-color: var(--azul-senal);
}

.purpose__text {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

/* --- Valores ----------------------------------------------------------- */
.values {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-4);
  padding: 0;
  list-style: none;
  counter-reset: value;
}

@media (max-width: 1099px) {
  .values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 699px) {
  .values { grid-template-columns: 1fr; }
}

.values__item {
  display: grid;
  gap: var(--sp-2);
  align-content: start;
  padding: var(--sp-5);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  counter-increment: value;
}

.values__item::before {
  content: counter(value, decimal-leading-zero);
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  color: var(--cta);
}

.values__title {
  font-size: var(--fs-md);
}

.values__text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.eyebrow[data-tone='azul'] {
  color: var(--azul-senal);
}

.equip-card:has(.equip-card__count) .equip-card__icon {
  max-width: calc(100% - 64px);
}

/* ==========================================================================
   PROYECTOS Y NOTICIAS · estado vacio y articulo
   ========================================================================== */
.empty-state {
  display: grid;
  justify-items: start;
  gap: var(--sp-4);
  padding: var(--sp-7) var(--sp-6);
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-state__title {
  font-size: var(--fs-xl);
}

.article {
  padding-block: var(--section-y);
}

.article .prose {
  max-width: none;
}

.article .prose h2 {
  margin-top: var(--sp-7);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.article__foot {
  display: grid;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
  padding: var(--sp-6);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-top: 4px solid var(--cta);
  border-radius: var(--radius);
}

.template-banner {
  padding: var(--sp-3) var(--gutter);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-align: center;
  color: var(--on-cta);
  background: var(--cta);
}

/* --- LEGAL ------------------------------------------------------------- */
.legal .prose section + section { margin-top: var(--sp-8); }
.legal .prose blockquote { border-left-color: var(--cta); }
.legal-mail a {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--rojo-senal);
}

.contact-box__sub { margin: var(--sp-4, 16px) 0 var(--sp-2, 8px); font-size: 1rem; font-weight: 700; }
.footer__contact a, .contact-box a[href^="mailto:"] { overflow-wrap: anywhere; }

/* ===== Calificación de atención (estrellas) ===== */
.rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; border: 0; padding: 0; margin: 0; }
.rating__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating__star { cursor: pointer; font-size: clamp(2.2rem, 7vw, 3rem); line-height: 1; color: rgba(255, 255, 255, 0.22); transition: color .18s ease, transform .18s ease; }
.rating__star:hover, .rating__star:hover ~ .rating__star, .rating__input:checked ~ .rating__star { color: #ffc531; }
.rating__star:hover { transform: scale(1.12); }
.rating__input:focus-visible + .rating__star { outline: 3px solid var(--cta, #ff4a3d); outline-offset: 3px; border-radius: 6px; }
.rating__text { min-height: 1.5em; margin-top: 6px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .rating__star { transition: none; } .rating__star:hover { transform: none; } }
