/*
 * USG AULA KIDS MAP V4.5
 * Mapa de aventuras visual.
 * Curso piloto 1703 exclusivamente.
 */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map {
    position: relative;
    overflow: visible;
    padding: 24px 16px !important;
    border-radius: 26px !important;
    background: linear-gradient(
        165deg,
        #123b99 0%,
        #1e55cb 55%,
        #3679f5 100%
    ) !important;
}

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map > strong {
    display: block;
    margin-bottom: 24px !important;
    font-size: 16px !important;
    color: #ffffff !important;
}

/* Estaciones */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link {
    position: relative;
    z-index: 1;
    display: flex !important;
    align-items: center;
    min-height: 68px;
    margin-bottom: 14px !important;
    padding: 12px 10px !important;
    border: 2px solid rgba(255,255,255,.28) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.12) !important;
    color: #ffffff !important;
    transition:
        transform .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

/* Identidad visual de cada misión */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link:nth-of-type(1) {
    border-left: 5px solid #fbbf24 !important;
}

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link:nth-of-type(2) {
    border-left: 5px solid #fb7185 !important;
}

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link:nth-of-type(3) {
    border-left: 5px solid #34d399 !important;
}

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link:nth-of-type(4) {
    border-left: 5px solid #c4b5fd !important;
}

/* Misión seleccionada */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link.is-current {
    background: #ecfdf5 !important;
    border-color: #86efac !important;
    color: #14532d !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
    transform: translateX(2px);
}

/* Misión completada: conservar el icono existente */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link.is-complete:not(.is-current) {
    background: rgba(16,185,129,.16) !important;
    border-color: #6ee7b7 !important;
}

/* Interacciones */

@media (hover: hover) {
    .usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
    .usg-open-adventure-map .usg-stage-link:hover {
        transform: translateX(3px);
        box-shadow: 0 6px 18px rgba(0,0,0,.14);
    }
}

/* Accesibilidad */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link:focus-visible {
    outline: 3px solid #fbbf24 !important;
    outline-offset: 3px;
}

/* Responsive */

@media (max-width: 768px) {
    .usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
    .usg-open-adventure-map {
        padding: 18px 14px !important;
    }

    .usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
    .usg-open-adventure-map .usg-stage-link {
        min-height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
    .usg-open-adventure-map .usg-stage-link {
        transition: none !important;
        transform: none !important;
    }
}

/* ==================================================
   USG_MAP_TEXT_FIX_V451
   Corrección de textos cortados en las misiones.
   Exclusivo microcurso infantil 1703.
   ================================================== */

.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link {
    box-sizing: border-box !important;
    min-height: 64px !important;
    height: auto !important;

    padding-right: 32px !important;

    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;

    line-height: 1.4 !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Permitir que el texto utilice varias líneas */
.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link {
    flex-wrap: nowrap !important;
}

/* Mantener espacio para el icono de completado */
.usg-course-shell.is-kids:is([data-progress-mode="open"],[data-progress-mode="preview"])
.usg-open-adventure-map .usg-stage-link::after {
    flex-shrink: 0 !important;
}


/* =====================================================
   USG_KIDS_HERO_FIX_V452
   Evitar superposición de texto sobre ilustración
   Exclusivo microcurso infantil 1703
   ===================================================== */

.usg-course-shell.is-kids
.usg-course-hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}

.usg-course-shell.is-kids
.usg-course-hero-grid > * {
    min-width: 0;
}

.usg-course-shell.is-kids
.usg-course-cover {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.usg-course-shell.is-kids
.usg-course-cover img {
    max-width: 100%;
}

@media (max-width: 980px) {
    .usg-course-shell.is-kids
    .usg-course-hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* =====================================================
   USG_KIDS_HERO_FIX_V453
   Evitar texto desbordado sobre imagen de portada
   Exclusivo microcurso 1703
   ===================================================== */

.usg-course-shell.is-kids
.usg-course-hero-grid > :first-child {
    min-width: 0 !important;
    overflow: hidden !important;
}

.usg-course-shell.is-kids
.usg-course-hero h1 {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}


/* =====================================================
   USG KIDS CUSTOM COVER FIX V4.5.2
   Curso piloto 1703 - Portada personalizada
   Mantiene la proporcion original de la imagen
   ===================================================== */

@media (min-width: 981px) {

    .usg-course-shell.is-kids
    .usg-course-cover {
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        overflow: hidden !important;
        border-radius: 24px !important;
    }

    .usg-course-shell.is-kids
    .usg-course-cover-img.usg-course-cover-custom {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        transform: none !important;
        clip-path: none !important;
    }
}
