
:root {
    --ruta-primary-dark: #081633;
    --ruta-neutral: #6b7280;
    --ruta-radius: 16px;
    --ruta-radius-lg: 28px;
    --ruta-shadow-sm: 0 1px 3px rgba(13, 32, 84, 0.06), 0 8px 20px rgba(13, 32, 84, 0.06);
    --ruta-shadow-md: 0 8px 16px rgba(13, 32, 84, 0.1), 0 24px 48px rgba(13, 32, 84, 0.14);
}

/* Chips de modalidad: filtran las cards del recorrido por sync/async.
   Activo por defecto = incluido; al clickear se excluye (no se borra el
   chip, se apaga) */
.rutaFilters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rutaFilterChip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--ruta-border);
    background: #fff;
    color: var(--ruta-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

/* aro tipo radio-button: hueco cuando esta excluido, punto solido cuando esta incluido */
.rutaFilterChip::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: transparent;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.rutaFilterChip.is-active {
    border-color: var(--ruta-secondary);
    background: var(--ruta-secondary);
    color: #fff;
}
.rutaFilterChip.async {
    border-color: var(--ruta-primary);
    background: var(--ruta-primary);
    color: #fff;
}

 
.rutaFilterChip.is-active::before {
    background: radial-gradient(circle, currentColor 0 38%, transparent 40% 100%);
}

 
.rutaFilterChip:not(.is-active)::before {
    content: "\00d7";
}

.rutaFilterChip:not(.is-active) {
    opacity: 0.55;
    text-decoration: line-through;
}

.rutaFilterChip:not(.is-active):hover {
    opacity: 0.8;
}

.rutaFilterChip:focus-visible {
    outline: 2px solid var(--ruta-secondary);
    outline-offset: 2px;
}

/* Track */
.rutaTrack {
    max-width: 100%;
    padding-top: 12px;
    padding-bottom: 96px;
}

.rutaLevel {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    margin: 12px 0;
}

.rutaLevel.active {
    opacity: 1;
    transform: translateY(0);
}

/* al filtrar desde las etiquetas los niveles que no matchean quedan completamente ocultos */
.rutaLevel.-heroHidden {
    display: none;
}

.rutaLevel.-entry {
    display: flex;
    justify-content: center;
}

.rutaEntryGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 860px;
}

.rutaLevel.-hub {
    display: flex;
    justify-content: center;
}

.rutaLevel__label {
    margin: 0 0 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--ruta-text-muted);
}

.rutaLevel__scroller {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Carrusel circular */
.rutaLevel__grid {
    display: flex;
    flex: 1;
    min-width: 0;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    overflow: hidden;
    padding: 4px 2px;
}

/* deja lugar arriba de las cards para la burbuja de "punto de partida"
   (card.tip); solo se agrega esta clase cuando el nivel la necesita  */
.rutaLevel__grid.-hasTags {
    padding-top: 52px;
}

.rutaLevel__grid .rutaCard.-peek {
    overflow: hidden;
    pointer-events: none;
}

.rutaLevel__grid .rutaCard.-hidden {
    display: none;
}

.rutaLevel__arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--ruta-border);
    background: #fff;
    color: var(--ruta-primary);
    cursor: pointer;
    transition: 0.25s;
}

.rutaLevel__arrow svg {
    width: 16px;
    height: 16px;
}

.rutaLevel__arrow:hover {
    border-color: var(--ruta-secondary);
    color: var(--ruta-secondary);
}

.rutaLevel__arrow:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.rutaLevel__arrow.-hidden {
    display: none;
}

.rutaLevel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.rutaLevel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: var(--ruta-border);
    cursor: pointer;
    transition: 0.25s;
}

.rutaLevel__dot.is-active {
    width: 22px;
    background: var(--ruta-secondary);
}

.rutaLevel__dots.-hidden {
    display: none;
}

/* Conector — se "dibuja" al entrar en viewport */
.rutaConnector {
    display: flex;
    justify-content: center;
    height: 32px;
    opacity: .48;
}

.rutaConnector::before {
    content: "";
    width: 2px;
    height: 100%;
    background: var(--ruta-neutral);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.6s ease;
}

.rutaConnector.is-drawn::before {
    background: var(--ruta-neutral);
    transform: scaleY(1);
}

/* Cards */
.rutaCard {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid var(--ruta-border);
    border-radius: var(--ruta-radius);
    background: #fff;
    color: var(--ruta-primary);
    text-align: left;
    line-height: 1.3;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.rutaLevel__grid .rutaCard {
    flex: 0 0 240px;
    height: 190px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--ruta-radius-lg);
    perspective: 1200px;
    transition: flex-basis 0.35s ease, opacity 0.35s ease, transform 0.2s ease;
}

.rutaCard:hover,
.rutaCard:focus-visible,
.rutaCard:focus-within {
    box-shadow: var(--ruta-shadow-sm);
    transform: translateY(-3px);
    color: var(--ruta-primary);
}

.rutaCard:focus-visible {
    outline: 2px solid var(--ruta-secondary);
    outline-offset: 2px;
}

/* las cards con flip no se levantan: el giro 3D ya es el efecto de hover */
.rutaLevel__grid .rutaCard:hover,
.rutaLevel__grid .rutaCard:focus-visible,
.rutaLevel__grid .rutaCard:focus-within {
    transform: none;
}

.rutaCard.curso {
    /* border-top: 3px solid var(--ruta-secondary); */
}

.rutaCard.programa {
    min-width: auto;
    box-shadow: none;
    /* border-top: 3px solid var(--ruta-primary); */
}

.rutaCard__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.rutaCard__dot.-curso {
    background: var(--ruta-secondary);
}

.rutaCard__dot.-programa {
    background: var(--ruta-neutral);
}

.rutaCard__title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ruta-primary);
    max-height: 4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rutaCard__category {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ruta-bg-soft);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ruta-text-muted);
}

/* Flip 3D — la card gira sobre su eje para revelar el resumen del curso */
.rutaCard__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.15, 0.2, 1);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.rutaCard.-flip:hover .rutaCard__inner,
.rutaCard.-flip:focus-within .rutaCard__inner,
.rutaCard.-flip.is-open .rutaCard__inner {
    transform: rotateY(180deg);
}

.rutaCard__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    border-radius: var(--ruta-radius-lg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.rutaCard__face.-front {
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--ruta-border);
    background: #fff;
    color: var(--ruta-primary);
}

 
.rutaCard.curso .rutaCard__face.-front {
    background: linear-gradient(160deg, #ffffff 0%, #ffffff 55%, rgba(0, 163, 227, 0.08) 100%);
}

.rutaCard.programa .rutaCard__face.-front {
    background: linear-gradient(160deg, #ffffff 0%, #ffffff 55%, rgba(13, 32, 84, 0.08) 100%);
}

 
.rutaCard__face.-front.-withCta {
    padding-right: 54px;
}

.rutaCard__face.-back {
    justify-content: flex-end;
    background: linear-gradient(135deg, var(--ruta-primary) 0%, var(--ruta-primary-dark) 100%);
    color: #fff;
    transform: rotateY(180deg);
}

.rutaCard__excerpt {
    margin: 0;
    padding-right: 40px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rutaCard__cta {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    color: var(--ruta-primary);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.rutaCard__cta svg {
    width: 16px;
    height: 16px;
}

.rutaCard__cta:hover,
.rutaCard__cta:focus-visible {
    background: var(--ruta-secondary);
    color: #fff;
    transform: scale(1.08);
}

.rutaCard__cta.-static {
    background: var(--ruta-bg-soft);
    border: 1px solid var(--ruta-border);
    color: var(--ruta-primary);
}

.rutaCard__cta.-static:hover,
.rutaCard__cta.-static:focus-visible {
    background: var(--ruta-secondary);
    border-color: var(--ruta-secondary);
    color: #fff;
}

.rutaCard.-entry {
    min-height: 64px;
    width: 100%;
    background: var(--ruta-bg-soft);
    color: var(--ruta-text-muted);
    font-weight: 700;
}

.rutaCard.-entry:hover {
    color: var(--ruta-primary);
}

.rutaCard__tip {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ruta-secondary);
}

/* Burbuja "punto de partida" arriba de una card puntual del recorrido —
   mismo ancho que la card, flotando por fuera de su borde superior */
.rutaCard__flag {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--ruta-border);
    box-shadow: var(--ruta-shadow-sm);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.25;
    text-align: center;
    color: var(--ruta-secondary);
}

.rutaCard__flag.-strong {
    background: linear-gradient(135deg, var(--ruta-primary) 0%, var(--ruta-primary-dark) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(13, 32, 84, 0.25);
}

/* flecha/viñeta: la burbuja "apunta" hacia la card que etiqueta.
   Dos triángulos apilados simulan el borde de 1px de la burbuja (el de
   abajo, mas grande, hace de contorno; el de arriba lo tapa por dentro) */
.rutaCard__flag::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 8px solid var(--ruta-border);
}

.rutaCard__flag::after {
    content: "";
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #fff;
}

.rutaCard__flag.-strong::before {
    display: none;
}

.rutaCard__flag.-strong::after {
    border-top-color: var(--ruta-primary-dark);
}

/* borde inferior de color segun modalidad, para distinguir de un vistazo
   las cards sincronicas (clases en vivo) de las asincronicas (a tu ritmo) */
.rutaLevel__grid .rutaCard[data-modality="sync"] .rutaCard__face.-front {
    border-bottom: 2px solid var(--ruta-secondary);
}

.rutaLevel__grid .rutaCard[data-modality="async"] .rutaCard__face.-front {
    border-bottom: 2px solid var(--ruta-primary);
}

/* Hub — el único acento oscuro, mismo tratamiento que el CTA de /empresas */
.rutaHub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 280px;
    padding: 20px 32px;
    border-radius: var(--ruta-radius-lg);
    background: linear-gradient(135deg, var(--ruta-primary) 0%, var(--ruta-primary-dark) 100%);
    box-shadow: var(--ruta-shadow-md);
    color: #fff;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rutaHub:hover,
.rutaHub:focus-visible {
    transform: translateY(-3px);
    color: #fff;
}

.rutaHub__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.rutaHub__title {
    font-size: 1.15rem;
    font-weight: 800;
}

@media only screen and (max-width: 600px) {
    .rutaEntryGrid {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 768px) {
    .rutaTrack {
        padding-top: 40px;
    }

    /* las flechas se superponen a la card (como en el home-slider) en
         vez de quedar estiradas a los bordes de la pantalla */
    .rutaLevel__scroller {
        position: relative;
        gap: 0;
    }

    .rutaLevel__arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 3;
        background: hsla(0, 0%, 100%, 0.75);
        backdrop-filter: blur(4px);
    }

    .rutaLevel__arrow.-prev {
        left: 4px;
    }

    .rutaLevel__arrow.-next {
        right: 4px;
    }
}
