/* ==========================================================================
   Rutas de confianza — estilos específicos de /rutas/
   Se apoya en las variables y componentes de css/style.css.
   ========================================================================== */

.rutas-page {
  --rt-line: #e1ecda;
  --rt-muted: #646464;
  --rt-accent: #2f8f00;
  --rt-warn: #b42318;
  --rt-bg: #f7f8f6;
}

/* Portada de la sección ---------------------------------------------------- */
.rt-hero {
  background: linear-gradient(135deg, #fff 55%, #e8f9d9);
  border-bottom: 1px solid #e5eee0;
  padding: 56px 0 38px;
}
.rt-hero h1 {
  max-width: 20ch;
  margin-bottom: .35em;
}
.rt-hero .lead {
  max-width: 78ch;
  margin: .5em 0 0;
  font-size: 1.08rem;
}
.rt-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}
.rt-stats > div {
  flex: 0 1 180px;
  background: #fff;
  border: 1px solid var(--rt-line);
  border-radius: var(--r);
  padding: 12px 18px;
  box-shadow: 0 8px 24px #0d2e2108;
}
.rt-stats b {
  display: block;
  color: var(--d);
  font-size: 1.65rem;
  line-height: 1.2;
}
.rt-stats span {
  color: var(--rt-muted);
  font-size: .82rem;
}

/* Contenido ---------------------------------------------------------------- */
.rt-main {
  padding: 52px 0 100px;
}
.rt-main h2 {
  margin: 1.7em 0 .55em;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
}
.rt-main h2:first-child {
  margin-top: 0;
}
.rt-main h2 small {
  margin-left: .45em;
  color: var(--rt-muted);
  font-size: .78rem;
  font-weight: 400;
}
.rt-main h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}
.rt-main .lead {
  max-width: 82ch;
  color: var(--rt-muted);
  font-size: 1.03rem;
}
.rt-main a {
  color: var(--d);
  text-decoration-color: #9bd35a;
  text-underline-offset: 2px;
}
.rt-main a:hover {
  color: var(--rt-accent);
}
.rt-main section {
  margin-top: 34px;
}
.rt-main section:first-of-type {
  margin-top: 0;
}
.rt-pais {
  margin-top: 42px;
}

/* Mapa --------------------------------------------------------------------- */
.rt-map {
  max-width: 620px;
  margin: 18px auto 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--rt-line);
  border-radius: var(--r);
  box-shadow: 0 12px 34px #0d2e2110;
}
.rt-map svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
}
.rt-map .land {
  fill: #dde5df;
  stroke: #fff;
  stroke-width: 1.2;
}
.rt-map .land.on {
  fill: #c9f2a8;
  cursor: pointer;
}
.rt-map .land.on:hover,
.rt-map .land.sel {
  fill: var(--g);
  stroke: var(--d);
  stroke-width: 1.5;
}
.rt-map .tl rect {
  fill: #fff;
  stroke: var(--rt-line);
  stroke-width: 1.5;
}
.rt-map .tl text {
  fill: var(--rt-muted);
  pointer-events: none;
  text-anchor: middle;
}
.rt-map .tc {
  font: 700 17px Rubik, system-ui, sans-serif;
}
.rt-map .tn {
  font: 12.5px Rubik, system-ui, sans-serif;
}
.rt-map .tl.on rect {
  fill: var(--d);
  stroke: var(--d);
}
.rt-map .tl.on text {
  fill: #fff;
}
.rt-map a:hover .tl.on rect {
  filter: brightness(1.15);
}
.rt-chips {
  margin: 12px 0 0;
  font-size: .9rem;
}

/* Filtros ------------------------------------------------------------------ */
.rt-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 6px;
}
.rt-tools input,
.rt-tools select {
  padding: 11px 14px;
  border: 2px solid #cfe0c6;
  border-radius: 12px;
  background: #fff;
  color: var(--d);
  font: inherit;
}
.rt-tools input {
  flex: 1 1 320px;
  max-width: 460px;
}
.rt-tools select {
  max-width: 100%;
}
.rt-tools input:focus,
.rt-tools select:focus {
  outline: 3px solid var(--g);
  border-color: var(--d);
}

/* Tarjetas de ruta --------------------------------------------------------- */
.rt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 20px;
  margin-top: 18px;
}
.rt-card {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--rt-line);
  border-radius: var(--r);
  box-shadow: 0 10px 30px #0d2e2108;
}
.rt-card:target,
.rt-pais:target > h2 {
  outline: 3px solid var(--g);
  outline-offset: 4px;
  border-radius: 8px;
}
.rt-veh {
  margin: .3em 0 0;
  color: var(--rt-muted);
  font-size: .86rem;
}
.rt-bars {
  flex: 1;
  min-width: 220px;
  margin-top: 14px;
}
.rt-cap {
  margin: 0 0 7px;
  color: var(--rt-muted);
  font-size: .8rem;
}
.rt-bar {
  display: grid;
  grid-template-columns: 68px 1fr 56px;
  gap: 9px;
  align-items: center;
  margin: 6px 0;
  font-size: .85rem;
}
.rt-bar div {
  height: 14px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 7px;
}
.rt-bar b {
  display: block;
  height: 100%;
  background: var(--d);
}
.rt-bar.p b {
  background: var(--g);
}
.rt-bar em {
  font-style: normal;
  font-weight: 600;
  text-align: right;
}
.rt-err {
  margin: 9px 0 0;
  font-size: .85rem;
}
.rt-err strong {
  color: var(--d);
}

/* Ficha desplegable -------------------------------------------------------- */
.rt-main details {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--rt-line);
  font-size: .88rem;
}
.rt-main summary {
  color: var(--rt-accent);
  cursor: pointer;
  font-weight: 600;
}
.rt-main dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  margin: 12px 0;
}
.rt-main dt {
  color: var(--rt-muted);
}
.rt-main dd {
  margin: 0;
}
.rt-main dd ul {
  margin: 0;
  padding-left: 18px;
}
.rt-dl {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 18px;
  border: 2px solid var(--g);
  border-radius: 999px;
  background: var(--g);
  color: var(--d);
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s;
}
.rt-dl:hover {
  color: var(--d);
  transform: translateY(-2px);
}

/* Tabla resumen ------------------------------------------------------------ */
.rt-tw {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--rt-line);
  border-radius: var(--r);
  background: #fff;
}
.rt-main table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: .85rem;
}
.rt-main th,
.rt-main td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rt-line);
  text-align: left;
}
.rt-main th {
  color: var(--rt-muted);
  font-weight: 600;
}
.rt-main tbody tr:last-child td {
  border-bottom: 0;
}
.rt-main tbody tr:hover {
  background: #f8fbf5;
}
.rt-main .hide {
  display: none;
}

/* Formulario de sugerencias ------------------------------------------------ */
.rt-main .rt-sug {
  max-width: 680px;
  margin-top: 18px;
}
.rt-main .rt-sug label {
  display: grid;
  gap: 6px;
  color: var(--rt-muted);
  font-size: .9rem;
}
.rt-main .rt-sug label.ck {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--d);
}
.rt-main .rt-sug label.ck input {
  width: auto;
  margin-top: 4px;
}
.rt-main .rt-sug .rt-hp {
  position: absolute;
  left: -9999px;
}
.rt-main .sug-msg {
  margin: 0;
  font-size: .9rem;
}
.rt-main .sug-msg.ok {
  color: var(--rt-accent);
}
.rt-main .sug-msg.ko {
  color: var(--rt-warn);
}

.rt-source {
  margin: 48px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--rt-line);
  color: var(--rt-muted);
  font-size: .85rem;
}

/* Ajustes móviles ---------------------------------------------------------- */
@media (max-width: 820px) {
  .rt-hero {
    padding: 40px 0 30px;
  }
  .rt-main {
    padding: 34px 0 84px;
  }
  .rt-grid {
    grid-template-columns: 1fr;
  }
  .rt-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .rt-tools input,
  .rt-tools select {
    width: 100%;
    max-width: none;
  }
  .rt-main dl {
    grid-template-columns: 1fr;
  }
  .rt-main dt {
    margin-top: 8px;
    font-weight: 600;
  }
  .rt-bar {
    grid-template-columns: 62px 1fr 52px;
    font-size: .8rem;
  }
  .rt-dl {
    display: block;
    text-align: center;
  }
}
