.cursos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 4vw, 4rem);
    width: min(1320px, 92%);
    margin: auto;
    padding: 2rem 3rem;
    box-sizing: border-box;
}

/* Imagen de cursos activos */
.imagen {
    flex: 1 1 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imagen img {
    width: 100%;
    max-width: 600px;
    max-height: 60vh;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Imagen directa cuando no hay cursos activos */
.cursos > img {
    flex: 0 1 720px;
    width: min(100%, 720px);
    max-width: 58%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Texto de cursos activos */
.texto {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.texto h1 {
    margin: 0 0 2rem 0;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    line-height: 1.1;
}

.texto h2 {
    margin: 0.8rem 0 0.2rem 0;
    font-size: 1rem;
    text-transform: uppercase;
    color: #666;
}

.texto p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #222;
}

/* Texto directo cuando no hay cursos activos */
.cursos > p {
    flex: 1 1 380px;
    max-width: 34rem;
    min-width: 20rem;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.65;
    text-align: left;
    white-space: pre-line;
    color: #111;
}

.cursosext {
    display: grid;
    justify-items: center;
    width: min(1320px, 92%);
    margin: auto;
    padding: 2rem 3rem;
    box-sizing: border-box;
}

.cursosext img {
    width: min(100%, 720px);
    height: auto;
    padding: 0;
    display: block;
}

/* Quita el margen inferior del último elemento para que el padding del contenedor sea exacto */
.texto p:last-child {
    margin-bottom: 0;
}

/* =========================================
   RESPONSIVE: LAPTOP PEQUEÑO / TABLET HORIZONTAL
   ========================================= */
@media (max-width: 1200px) {
    .cursos {
        width: min(1120px, 94%);
        gap: 2.5rem;
        padding: 2rem;
    }

    .imagen img {
        max-width: 520px;
        max-height: 55vh;
    }

    .texto h1 {
        font-size: 1.8rem;
    }

    .cursos > img {
        flex-basis: 620px;
        width: min(100%, 620px);
        max-width: 56%;
    }

    .cursos > p {
        max-width: 32rem;
        min-width: 18rem;
        line-height: 1.6;
    }

    .cursosext img {
        width: min(100%, 620px);
    }
}

/* =========================================
   RESPONSIVE: TABLET VERTICAL
   ========================================= */
@media (max-width: 992px) {
    .cursos {
        width: min(760px, 92%);
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
        padding: 2rem 1.5rem;
    }

    .imagen {
        width: 100%;
        height: auto;
        flex: none;
    }

    .imagen img {
        width: min(100%, 520px);
        max-height: 50vh;
    }

    .texto {
        width: 100%;
        padding: 0;
        align-items: center;
    }

    .texto h1 {
        font-size: 1.6rem;
        text-align: center;
    }

    .texto h2,
    .texto p {
        text-align: center;
    }

    .cursos > img {
        width: min(100%, 560px);
        max-width: 100%;
    }

    .cursos > p {
        width: 100%;
        max-width: 42rem;
        min-width: 0;
        text-align: left;
        line-height: 1.6;
    }

    .cursosext {
        width: min(760px, 92%);
        padding: 2rem 1.5rem;
    }

    .cursosext img {
        width: min(100%, 560px);
    }
}

/* =========================================
   RESPONSIVE: MÓVILES
   ========================================= */
@media (max-width: 768px) {
    .cursos {
        width: min(35rem, 92%);
        max-width: 35rem;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }

    .imagen {
        width: 100%;
        height: auto;
        min-height: 0;
    }

    .imagen img {
        width: 100%;
        max-height: 55vh;
        object-fit: contain;
    }

    .texto {
        padding: 0;
    }

    .texto h1 {
        font-size: 1.35rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

    .texto h2 {
        font-size: 0.9rem;
    }

    .texto p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .cursos > img {
        width: min(100%, 360px);
    }

    .cursos > p {
        width: 100%;
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: left;
    }

    .cursosext {
        width: min(35rem, 92%);
        padding: 1.5rem 1rem;
    }

    .cursosext img {
        width: min(100%, 360px);
    }
}