/* ==========================================================================
   RUTAS — ATLAS DE RECORRIDOS

   Una única composición: cabecera breve, filtro horizontal y fichas técnicas
   con el perfil real del GPX. Todo queda contenido bajo .os-routes.
   ========================================================================== */

.os-routes {
    --routes: var(--os-capa-rutas, #276477);
    --routes-deep: var(--os-capa-rutas-deep, #183F4B);
    --routes-surface: var(--os-capa-rutas-surface, #E3EEF1);
    --routes-line: #B9CED4;
    --routes-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --routes-width: 1440px;
    --routes-gutter: clamp(20px, 4vw, 64px);
    overflow-x: clip;
    background: #F8FAFA;
    color: var(--color-antracita, #333333);
}

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

.os-routes__wrap {
    width: min(100%, var(--routes-width));
    margin-inline: auto;
    padding-inline: var(--routes-gutter);
}

.os-routes .os-listado {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Cabecera breve --------------------------------------------------------- */

.os-routes__hero {
    position: relative;
    isolation: isolate;
    padding-block: 34px 0;
    background: var(--routes-deep);
    color: #FFFFFF;
}

.os-routes__contours {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: #FFFFFF;
    opacity: 0.12;
    pointer-events: none;
    z-index: -1;
}

.os-routes__contours svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1;
}

.os-routes__contours .os-routes__contours-track {
    color: var(--routes-surface);
    stroke-width: 3;
}

.os-routes__contours circle {
    fill: var(--routes-deep);
    stroke-width: 3;
}

.os-routes__hero-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 36px;
    padding-bottom: 30px;
}

.os-routes__eyebrow,
.os-routes h1,
.os-routes__summary,
.os-routes__filterbar,
.os-routes .os-listado__count,
.os-routes .os-card {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-routes__eyebrow {
    margin: 0 0 8px;
    color: var(--routes-surface);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.os-routes__title-row {
    display: flex;
    align-items: center;
    gap: clamp(13px, 2vw, 24px);
}

.os-routes__route-mark {
    width: clamp(42px, 4vw, 58px);
    flex: 0 0 auto;
    fill: none;
    stroke: var(--routes-surface);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.os-routes__route-mark circle {
    fill: var(--routes-deep);
}

.os-routes h1 {
    margin: 0;
    padding: 0;
    color: #FFFFFF;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    font-weight: 820;
    letter-spacing: -0.05em;
    line-height: 0.92;
    text-wrap: balance;
}

.os-routes__lede {
    max-width: 62ch;
    margin: 13px 0 0 clamp(55px, 6vw, 82px);
    color: rgba(255, 255, 255, 0.82);
    font: 500 clamp(0.98rem, 1.35vw, 1.12rem)/1.45 'Source Serif 4', Georgia, serif;
    text-wrap: pretty;
}

.os-routes__summary {
    display: flex;
    align-items: center;
    gap: 22px;
}

.os-routes__count {
    display: grid;
    min-width: 82px;
    margin: 0;
    text-align: right;
}

.os-routes__count strong {
    color: #FFFFFF;
    font-size: 2.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: 820;
    letter-spacing: -0.05em;
    line-height: 0.85;
}

.os-routes__count span {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-transform: uppercase;
}

.os-routes__map-link {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 10px;
    padding: 0 17px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 4px 15px 15px 4px;
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-decoration: none;
    transition: background-color 180ms var(--routes-ease), border-color 180ms var(--routes-ease), transform 140ms var(--routes-ease);
}

.os-routes__map-link svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.os-routes__map-link:active {
    transform: scale(0.97);
}

/* Filtro horizontal ------------------------------------------------------ */

.os-routes__filter-wrap {
    position: relative;
    margin-bottom: -30px;
    z-index: 20;
}

.os-routes .os-routes__filterbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(170px, 0.38fr) minmax(210px, 0.48fr);
    min-height: 66px;
    margin: 0;
    padding: 0;
    background: #FFFFFF;
    border: 1px solid var(--routes-line);
    border-radius: 5px 22px 22px 5px;
    box-shadow: 0 20px 52px rgba(9, 37, 45, 0.2);
}

.os-routes .os-filters__search {
    display: grid;
    min-width: 0;
    margin: 0;
}

.os-routes .os-filters__search > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.os-routes .os-filters__search-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 62px;
    min-height: 64px;
    overflow: hidden;
    border: 0;
    border-radius: 4px 0 0 4px;
}

.os-routes .os-filters__search-control:focus-within {
    box-shadow: inset 0 0 0 3px rgba(39, 100, 119, 0.24);
}

.os-routes .os-filters__search input {
    width: 100%;
    min-width: 0;
    padding: 0 22px;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--color-negro, #1A1A1A);
    font: 700 clamp(0.92rem, 1.2vw, 1.02rem)/1 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-routes .os-filters__search input::placeholder {
    color: var(--color-gris-calido, #6B6B5E);
    opacity: 1;
}

.os-routes .os-filters__search button {
    position: relative;
    min-width: 62px;
    overflow: hidden;
    background: var(--color-negro, #1A1A1A);
    border: 0;
    color: transparent;
    cursor: pointer;
    font-size: 0;
    transition: background-color 180ms var(--routes-ease), transform 140ms var(--routes-ease);
}

.os-routes .os-filters__search button::before {
    display: block;
    width: 19px;
    height: 19px;
    margin: auto;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    content: '';
}

.os-routes .os-filters__search button::after {
    position: absolute;
    top: 34px;
    left: 34px;
    width: 8px;
    height: 2px;
    background: #FFFFFF;
    content: '';
    transform: rotate(45deg);
    transform-origin: left center;
}

.os-routes .os-filters__search button:active {
    transform: scale(0.96);
}

.os-routes .os-filters__group {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--routes-line);
}

.os-routes .os-filters__legend {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.os-routes .os-filters__toggle {
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    gap: 9px;
    padding: 0 19px;
    background: transparent;
    border: 0;
    color: var(--routes-deep);
    cursor: pointer;
    font: 800 0.82rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;
    transition: background-color 160ms var(--routes-ease), color 160ms var(--routes-ease);
}

.os-routes .os-filters__group:last-of-type .os-filters__toggle {
    border-radius: 0 21px 21px 0;
}

.os-routes .os-filters__toggle[aria-expanded='true'] {
    background: var(--routes-surface);
}

.os-routes .os-filters__count {
    display: grid;
    min-width: 21px;
    height: 21px;
    place-items: center;
    margin-left: auto;
    background: var(--routes-deep);
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
}

.os-routes .os-filters__count[hidden] {
    display: none;
}

.os-routes .os-filters__chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms var(--routes-ease);
}

.os-routes .os-filters__toggle[aria-expanded='true'] .os-filters__chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.os-routes .os-filters__region {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    width: max-content;
    min-width: 240px;
    max-width: min(340px, calc(100vw - 40px));
    max-height: none;
    gap: 2px;
    padding: 9px;
    overflow: visible;
    background: #FFFFFF;
    border: 1px solid var(--routes-line);
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 18px 46px rgba(24, 63, 75, 0.2);
    transform-origin: top right;
    z-index: 30;
}

.os-routes .os-filters__region[hidden] {
    display: none;
}

.os-routes .os-filters__opt {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 3px 10px 10px 3px;
    color: var(--color-antracita, #333333);
    cursor: pointer;
    font: 680 0.84rem/1.25 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-routes .os-filters__opt input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    accent-color: var(--routes-deep);
}

.os-routes .os-filters__opt-total {
    margin-left: auto;
    color: var(--color-gris-calido, #6B6B5E);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

.os-routes .os-listado:not(.os-has-js) .os-routes__filterbar {
    grid-template-columns: 1fr;
}

.os-routes .os-listado:not(.os-has-js) .os-filters__group {
    border-top: 1px solid var(--routes-line);
    border-left: 0;
}

.os-routes .os-listado:not(.os-has-js) .os-filters__region {
    position: static;
    width: 100%;
    max-width: none;
    padding: 0 14px 12px;
    border: 0;
    box-shadow: none;
}

/* Directorio ------------------------------------------------------------- */

.os-routes__directory {
    min-height: 420px;
    padding-block: 74px clamp(72px, 8vw, 116px);
    background:
        linear-gradient(90deg, rgba(39, 100, 119, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
        #F8FAFA;
}

.os-routes .os-listado__toolbar {
    display: flex;
    min-height: 42px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
}

.os-routes .os-listado__count {
    margin: 0;
    color: var(--routes-deep);
    font-size: 0.76rem;
    font-weight: 820;
    letter-spacing: 0.09em;
    line-height: 1.3;
    text-transform: uppercase;
}

.os-routes .os-active-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.os-routes .os-chip {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 7px;
    padding: 4px 6px 4px 11px;
    background: var(--routes-surface);
    border-radius: 3px 13px 13px 3px;
    color: var(--routes-deep);
    font: 750 0.72rem/1.1 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-routes .os-chip__remove {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: currentColor;
    cursor: pointer;
    font-size: 1rem;
}

.os-routes .os-active-filters__clear {
    min-height: 32px;
    padding: 0 5px;
    background: transparent;
    border: 0;
    color: var(--routes-deep);
    cursor: pointer;
    font: 800 0.72rem/1 'Bricolage Grotesque', system-ui, sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.os-routes .os-listado__grid {
    counter-reset: os-route;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: #FFFFFF;
    border-top: 1px solid var(--routes-line);
    border-bottom: 1px solid var(--routes-line);
    transition: opacity 180ms var(--routes-ease);
}

.os-routes .os-listado.is-loading .os-listado__grid {
    opacity: 0.5;
}

/* Ficha horizontal del atlas --------------------------------------------- */

.os-routes .os-card--ruta {
    counter-increment: os-route;
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.8fr);
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 228px;
    overflow: visible;
    background: #FFFFFF;
    border: 0;
    border-bottom: 1px solid var(--routes-line);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    transition: background-color 180ms var(--routes-ease);
}

.os-routes .os-card--ruta:last-child {
    border-bottom: 0;
}

.os-routes .os-card__visual {
    position: relative;
    min-width: 0;
    min-height: 228px;
    overflow: hidden;
    background: var(--routes-surface);
    border-right: 1px solid var(--routes-line);
}

.os-routes .os-card__image-link,
.os-routes .os-card__image,
.os-routes .os-card__profile-art,
.os-routes .os-card__route-art {
    display: block;
    width: 100%;
    height: 100%;
}

.os-routes .os-card__image {
    position: relative;
    min-height: 228px;
    overflow: hidden;
}

.os-routes .os-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms var(--routes-ease);
}

.os-routes .os-card__profile-art,
.os-routes .os-card__route-art {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 64%),
        var(--routes-surface);
}

.os-routes .os-card__profile-art svg,
.os-routes .os-card__route-art svg {
    width: 100%;
    height: 100%;
    fill: none;
}

.os-routes .os-card__profile-art line {
    stroke: rgba(39, 100, 119, 0.14);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.os-routes .os-card__profile-area {
    fill: rgba(39, 100, 119, 0.12);
    stroke: none;
}

.os-routes .os-card__profile-line {
    fill: none;
    stroke: var(--routes-deep);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
    vector-effect: non-scaling-stroke;
    transition: stroke-width 180ms var(--routes-ease);
}

.os-routes .os-card__profile-range {
    position: absolute;
    right: 62px;
    bottom: 13px;
    left: 15px;
    display: flex;
    justify-content: space-between;
    color: var(--routes-deep);
    font: 760 0.67rem/1 'Bricolage Grotesque', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
}

.os-routes .os-card__contour {
    stroke: var(--routes);
    stroke-width: 1.2;
    opacity: 0.22;
}

.os-routes .os-card__track {
    stroke: var(--routes-deep);
    stroke-width: 4;
    vector-effect: non-scaling-stroke;
}

.os-routes .os-card__start {
    fill: #FFFFFF;
    stroke: var(--routes-deep);
    stroke-width: 4;
    vector-effect: non-scaling-stroke;
}

.os-routes .os-card__index {
    position: absolute;
    top: 17px;
    left: 18px;
    z-index: 2;
    color: var(--routes-deep);
    font: 820 clamp(2.2rem, 3.2vw, 3.4rem)/0.85 'Bricolage Grotesque', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.07em;
}

.os-routes .os-card__index::before {
    content: counter(os-route, decimal-leading-zero);
}

.os-routes .os-card__track-badge {
    position: absolute;
    top: 21px;
    right: 18px;
    z-index: 2;
    padding: 6px 9px;
    background: rgba(24, 63, 75, 0.92);
    border-radius: 3px 10px 10px 3px;
    color: #FFFFFF;
    font: 800 0.63rem/1 'Bricolage Grotesque', system-ui, sans-serif;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.os-routes .os-card__favorite {
    position: absolute;
    right: 16px;
    bottom: 15px;
    z-index: 3;
}

.os-routes .os-card__favorite .os-favorito--card {
    position: static;
    background: rgba(255, 255, 255, 0.94);
    color: var(--routes-deep);
    box-shadow: 0 5px 18px rgba(24, 63, 75, 0.15);
}

.os-routes .os-card__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.52fr);
    grid-template-rows: auto auto auto 1fr;
    column-gap: clamp(24px, 3vw, 48px);
    min-width: 0;
    padding: clamp(22px, 2.6vw, 34px);
}

.os-routes .os-card__topline {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--routes);
    font-size: 0.7rem;
    font-weight: 820;
    letter-spacing: 0.07em;
    line-height: 1.2;
    text-transform: uppercase;
}

.os-routes .os-card__route-mark {
    width: 25px;
    height: 7px;
    border-top: 2px solid currentColor;
    border-bottom: 2px dotted currentColor;
}

.os-routes .os-card__separator {
    opacity: 0.65;
}

.os-routes .os-card__title {
    grid-column: 1;
    grid-row: 2;
    max-width: 29ch;
    margin: 10px 0 0;
    padding: 0;
    color: var(--color-negro, #1A1A1A);
    font: 810 clamp(1.35rem, 2.1vw, 2.15rem)/1.04 'Bricolage Grotesque', system-ui, sans-serif;
    letter-spacing: -0.038em;
    text-wrap: balance;
}

.os-routes .os-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 160ms var(--routes-ease);
}

.os-routes .os-card__zone {
    display: flex;
    grid-column: 1;
    grid-row: 3;
    align-items: center;
    gap: 7px;
    margin: 11px 0 0;
    color: var(--color-gris-calido, #6B6B5E);
    font-size: 0.82rem;
    font-weight: 680;
    line-height: 1.35;
}

.os-routes .os-card__zone svg {
    width: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--routes);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.os-routes .os-card__facts {
    display: grid;
    grid-column: 2;
    grid-row: 1 / 4;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-self: center;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--routes-line);
}

.os-routes .os-card__facts div {
    min-width: 0;
    padding: 5px 14px 7px;
}

.os-routes .os-card__facts div + div {
    border-left: 1px solid var(--routes-line);
}

.os-routes .os-card__facts dt,
.os-routes .os-card__facts dd {
    margin: 0;
    padding: 0;
}

.os-routes .os-card__facts dt {
    color: var(--color-gris-calido, #6B6B5E);
    font-size: 0.61rem;
    font-weight: 760;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-transform: uppercase;
}

.os-routes .os-card__facts dd {
    margin-top: 7px;
    color: var(--routes-deep);
    font-size: clamp(0.92rem, 1.25vw, 1.1rem);
    font-variant-numeric: tabular-nums;
    font-weight: 820;
    line-height: 1.15;
}

.os-routes .os-card__footer {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 4;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid rgba(39, 100, 119, 0.13);
}

.os-routes .os-card__technical {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin: 0;
    color: var(--color-gris-calido, #6B6B5E);
    font-size: 0.66rem;
    font-weight: 760;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
}

.os-routes .os-card__technical span + span::before {
    margin-right: 12px;
    color: var(--routes);
    content: '·';
}

.os-routes .os-card__cta {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    color: var(--routes-deep);
    font-size: 0.78rem;
    font-weight: 820;
    text-decoration: none;
    transition: color 160ms var(--routes-ease), transform 140ms var(--routes-ease);
}

.os-routes .os-card__cta svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: transform 160ms var(--routes-ease);
}

.os-routes .os-card__cta:active {
    transform: scale(0.97);
}

.os-routes .os-listado__vacio,
.os-routes .os-listado__error {
    min-height: 250px;
    place-content: center;
    padding: 46px 24px;
    background: var(--routes-surface);
    border: 1px dashed var(--routes);
    color: var(--routes-deep);
    font: 750 1rem/1.5 'Bricolage Grotesque', system-ui, sans-serif;
    text-align: center;
}

.os-routes .os-listado__footer {
    text-align: center;
}

.os-routes .os-listado__more {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    margin-top: 28px;
    padding: 0 20px;
    background: var(--color-negro, #1A1A1A);
    border-radius: 4px 15px 15px 4px;
    color: #FFFFFF;
    font: 800 0.8rem/1 'Bricolage Grotesque', system-ui, sans-serif;
    text-decoration: none;
}

.os-routes .os-listado__more[hidden],
.os-routes .os-filters-open {
    display: none !important;
}

/* Estados y foco --------------------------------------------------------- */

.os-routes a:focus-visible,
.os-routes button:focus-visible,
.os-routes input:focus-visible {
    outline: 3px solid var(--color-naranja-accion, #BF4B0A);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .os-routes__map-link:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: #FFFFFF;
    }

    .os-routes .os-filters__search button:hover {
        background: var(--routes);
    }

    .os-routes .os-filters__toggle:hover,
    .os-routes .os-filters__opt:hover {
        background: var(--routes-surface);
    }

    .os-routes .os-card--ruta:hover {
        background: #FDFEFE;
    }

    .os-routes .os-card--ruta:hover .os-card__profile-line {
        stroke-width: 7;
    }

    .os-routes .os-card__image-link:hover img {
        transform: scale(1.025);
    }

    .os-routes .os-card__title a:hover,
    .os-routes .os-card__cta:hover {
        color: var(--routes);
    }

    .os-routes .os-card__cta:hover svg {
        transform: translateX(4px);
    }
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1080px) {
    .os-routes .os-card--ruta {
        grid-template-columns: minmax(230px, 0.62fr) minmax(0, 1.5fr);
    }

    .os-routes .os-card__body {
        grid-template-columns: minmax(0, 1fr) minmax(250px, 0.55fr);
        column-gap: 24px;
    }

    .os-routes .os-card__facts div {
        padding-inline: 10px;
    }
}

@media (max-width: 860px) {
    .os-routes__hero-main {
        align-items: center;
    }

    .os-routes__count {
        display: none;
    }

    .os-routes .os-routes__filterbar {
        grid-template-columns: minmax(250px, 1fr) minmax(145px, 0.42fr) minmax(170px, 0.5fr);
    }

    .os-routes .os-card--ruta {
        grid-template-columns: minmax(220px, 0.56fr) minmax(0, 1fr);
    }

    .os-routes .os-card__body {
        grid-template-columns: 1fr;
    }

    .os-routes .os-card__facts {
        grid-column: 1;
        grid-row: 4;
        margin-top: 15px;
        padding-top: 13px;
        border-top: 1px solid rgba(39, 100, 119, 0.13);
        border-left: 0;
    }

    .os-routes .os-card__footer {
        grid-row: 5;
    }
}

@media (max-width: 680px) {
    .os-routes__hero {
        padding-top: 26px;
    }

    .os-routes__hero-main {
        grid-template-columns: 1fr;
        gap: 18px;
        padding-bottom: 22px;
    }

    .os-routes h1 {
        font-size: clamp(2.45rem, 11vw, 3.8rem);
    }

    .os-routes__lede {
        margin-left: 0;
    }

    .os-routes__summary {
        justify-content: space-between;
    }

    .os-routes__map-link {
        min-height: 44px;
    }

    .os-routes__filter-wrap {
        margin-bottom: -52px;
    }

    .os-routes .os-routes__filterbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: 0;
        border-radius: 4px 16px 16px 4px;
    }

    .os-routes .os-filters__search {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--routes-line);
    }

    .os-routes .os-filters__search-control {
        min-height: 56px;
        border-radius: 4px 15px 0 0;
    }

    .os-routes .os-filters__search button {
        min-width: 56px;
    }

    .os-routes .os-filters__search button::after {
        top: 30px;
        left: 31px;
    }

    .os-routes .os-filters__group {
        border-left: 0;
    }

    .os-routes .os-filters__group + .os-filters__group {
        border-left: 1px solid var(--routes-line);
    }

    .os-routes .os-filters__toggle {
        min-height: 52px;
        padding-inline: 14px;
        font-size: 0.74rem;
    }

    .os-routes .os-filters__region {
        right: auto;
        left: 0;
        min-width: min(290px, calc(100vw - 40px));
        transform-origin: top left;
    }

    .os-routes .os-filters__group:last-of-type .os-filters__region {
        right: 0;
        left: auto;
        transform-origin: top right;
    }

    .os-routes__directory {
        padding-top: 84px;
    }

    .os-routes .os-card--ruta {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .os-routes .os-card__visual,
    .os-routes .os-card__image {
        height: 168px;
        min-height: 168px;
        aspect-ratio: auto;
        border-right: 0;
    }

    .os-routes .os-card__body {
        padding: 18px 18px 20px;
    }

    .os-routes .os-card__title {
        max-width: none;
        font-size: clamp(1.45rem, 7vw, 1.9rem);
    }

    .os-routes .os-card__facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .os-routes__route-mark {
        width: 38px;
    }

    .os-routes h1 {
        font-size: clamp(2.2rem, 11.5vw, 3rem);
    }

    .os-routes__lede {
        font-size: 0.96rem;
    }

    .os-routes .os-filters__search input {
        padding-inline: 16px;
        font-size: 0.88rem;
    }

    .os-routes .os-card__facts dt {
        font-size: 0.57rem;
    }

    .os-routes .os-card__facts dd {
        font-size: 0.88rem;
    }

    .os-routes .os-card__footer {
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }

    .os-routes .os-card__cta {
        align-self: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .os-routes__map-link,
    .os-routes .os-filters__search button,
    .os-routes .os-filters__toggle,
    .os-routes .os-filters__chevron,
    .os-routes .os-listado__grid,
    .os-routes .os-card--ruta,
    .os-routes .os-card__image img,
    .os-routes .os-card__profile-line,
    .os-routes .os-card__title a,
    .os-routes .os-card__cta,
    .os-routes .os-card__cta svg {
        transition: none;
    }
}
