/* =========================================================
   Niveles educativos — cards overlapping hero
========================================================= */

.ie-levels-bar {
    /* position: relative;
    z-index: 20; */
    margin-top: 4rem;
    /* 
    padding: 0 0 56px;
    background: transparent; */
}

/* Fondo blanco debajo de los cards (no tapa el solape con el hero) */
.ie-levels-bar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 140px;
    bottom: 0;
    background: #fff;
    z-index: 0;
}

.ie-levels-bar > .container {
    position: relative;
    z-index: 2;
}

/* Título centrado ENCIMA de los cards, sin solaparse */
.ie-levels-header {
    text-align: center;
    padding: 0 16px 28px;
    margin: 0;
    position: relative;
    z-index: 5;
}

.ie-levels-label {
    display: inline-block;
    font-family: "Josefin Sans", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(47, 111, 237, .85);
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(10, 26, 58, .25);
}

.ie-levels-title {
    font-family: "Josefin Sans", sans-serif;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin: 0;
    display: inline-block;
    position: relative;
    padding-bottom: 14px;
    text-shadow: 0 2px 16px rgba(10, 26, 58, .45);
}

.ie-levels-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 72px;
    height: 3px;
    background: linear-gradient(90deg, #2f6fed, #f0a500);
    border-radius: 2px;
}

.ie-levels-desc {
    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, .85);
    line-height: 1.7;
    max-width: 560px;
    margin: 14px auto 0;
    text-shadow: 0 1px 8px rgba(10, 26, 58, .35);
}

/* Cards: sin margin negativo (el título ya no se tapa) */
.ie-levels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    align-items: stretch;
    margin-top: 0;
    position: relative;
    z-index: 4;
}

.ie-level-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px 26px 24px;
    box-shadow:
        0 18px 50px rgba(10, 26, 58, .14),
        0 4px 14px rgba(10, 26, 58, .06);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform .35s ease, box-shadow .35s ease;
    border: 1px solid rgba(10, 26, 58, .04);
    min-height: 100%;
    position: relative;
    overflow: hidden;
}

.ie-level-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    opacity: 1;
    transition: transform .5s ease;
    z-index: 0;
}

.ie-level-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(10, 26, 58, .78) 0%, rgba(10, 26, 58, .55) 100%);
    border-radius: 20px;
    z-index: 1;
    transition: background .4s ease;
}

.ie-level-card .ie-level-title,
.ie-level-card .ie-level-desc,
.ie-level-card .ie-level-stat {
    color: #fff;
}

.ie-level-card .ie-level-stat {
    color: rgba(255, 255, 255, .75);
}

.ie-level-card .ie-level-stat strong {
    color: #f0a500;
}

.ie-level-card .ie-level-icon {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.ie-level-card .ie-level-badge {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.ie-level-card .ie-level-head,
.ie-level-card .ie-level-body {
    position: relative;
    z-index: 2;
}

.ie-level-card:hover::before {
    transform: scale(1.08);
}

.ie-level-card:hover::after {
    background: linear-gradient(160deg, rgba(10, 26, 58, .55) 0%, rgba(47, 111, 237, .45) 100%);
}

.ie-level-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 28px 60px rgba(47, 111, 237, .35),
        0 0 0 3px #f0a500;
}

.ie-level-card:hover .ie-level-icon {
    background: #f0a500;
    color: #fff;
}

/* Imagen administrable (--ie-level-img). Si no está definida, se usa la
   imagen por defecto de cada variante. */
.ie-level-card--inicial::before {
    background-image: var(--ie-level-img, url('../img/inicio/5.jpeg'));
}

.ie-level-card--primaria::before {
    background-image: var(--ie-level-img, url('../img/inicio/2.jpeg'));
}

.ie-level-card--secundaria::before {
    background-image: var(--ie-level-img, url('../img/inicio/8.jpeg'));
}

.ie-level-card--featured {
    border-color: transparent;
    padding: 34px 28px 28px;
    transform: translateY(-10px);
    box-shadow:
        0 28px 60px rgba(10, 26, 58, .28),
        0 8px 24px rgba(47, 111, 237, .2);
}

.ie-level-card--featured:hover {
    transform: translateY(-16px);
}

.ie-level-card--featured .ie-level-badge {
    background: rgba(240, 165, 0, .28);
    color: #f0a500;
}

.ie-level-card--featured .ie-level-icon {
    background: rgba(255, 255, 255, .12);
    color: #f0a500;
}

.ie-level-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ie-level-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px;
}

.ie-level-icon svg {
    width: 100%;
    height: 100%;
}

.ie-level-badge {
    display: inline-block;
    font-family: "Josefin Sans", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    line-height: 1.2;
}

.ie-level-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ie-level-title {
    font-family: "Josefin Sans", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.2;
}

.ie-level-desc {
    font-family: "Open Sans", sans-serif;
    font-size: 13.5px;
    line-height: 1.65;
    margin: 0 0 16px;
    flex: 1;
}

.ie-level-stat {
    font-family: "Open Sans", sans-serif;
    font-size: 12.5px;
    margin-top: auto;
    padding-top: 4px;
}

@media (max-width: 991px) {
    .ie-levels-bar {
        margin-top: -48px;
    }

    .ie-levels-bar::before {
        top: 120px;
    }

    .ie-levels-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ie-level-card--featured {
        transform: none;
        order: -1;
    }

    .ie-level-card--featured:hover {
        transform: translateY(-6px);
    }
}

@media (max-width: 575px) {
    .ie-levels-bar {
        margin-top: -32px;
        padding-bottom: 36px;
    }

    .ie-levels-header {
        padding-bottom: 20px;
    }

    .ie-levels-title {
        font-size: 1.35rem;
    }
}
