/* Estilos para el mega menu */
.dropdown > a > i {
    font-size: 12px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover > a > i {
    transform: rotate(180deg);
}

.mega-menu {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    max-width: 1200px;
    min-width: 800px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    top: 140px; /* Altura del header normal */
    max-height: 80vh;
    overflow-y: auto;
}

/* Asegurar que el contenedor del dropdown tenga overflow visible */
.navigation > li.dropdown {
    position: relative;
    overflow: visible;
}

/* Clase para cuando el header está en modo sticky */
.mega-menu.sticky-mode {
    position: fixed;
    top: 140px; /* Altura del header sticky */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
}

.mega-menu-content {
    width: 100%;
    padding: 15px;
    position: relative;
}

.row {
    margin: 0;
    width: 100%;
}

.col-md-3 {
    padding: 10px;
    width: 250px;
}

.menu-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.menu-card:hover {
    transform: translateY(-5px);
}

.col-md-4 .menu-image {
    height: 330px;
}

.col-md-4 .menu-overlay {
    top: auto;
    height: auto;
    background: linear-gradient(to top, rgba(0,56,118,0.95), rgba(0,56,118,0.7) 50%, transparent);
    padding: 20px 15px;
}


.col-md-4 .menu-overlay h3 {
    font-size: 18px;
}

.col-md-6 .menu-image {
    height: 145px;
}

.menu-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.menu-card:hover .menu-image img {
    transform: scale(1.1);
}

.menu-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,56,118,0.85), rgba(0,56,118,0.4));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    /* text-align: center; */
    height: 100%;
}
.menu-overlay small {
    color: #fff;
    line-height: 1.2em;
}

.overlay2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 56, 118, 0.4), rgba(255, 255, 255, 0));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    text-align: center;
    height: 100%;
}


.menu-overlay h3 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

@media (max-width: 991px) {
    .mega-menu {
        width: 95vw;
        min-width: auto;
        padding: 15px;
        max-width: none;
        left: 50%;
        transform: translateX(-50%);
        position: fixed;
    }
    
    .mega-menu.sticky-mode {
        top: 110px;
    }

    .col-md-4 .menu-image,
    .col-md-6 .menu-image {
        height: 180px;
    }

    .menu-overlay {
        padding: 10px;
    }

    .menu-overlay h3 {
        font-size: 14px;
    }

    .col-md-4 .menu-overlay {
        padding: 15px;
    }

    .col-md-4 .menu-overlay h3 {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .mega-menu {
        width: 98vw;
        padding: 10px;
        max-height: 70vh;
        left: 50%;
        transform: translateX(-50%);
        position: fixed;
    }
    
    .mega-menu.sticky-mode {
        top: 100px;
    }
}



.row.g-4 {
    margin: 0;
    --bs-gutter-x: 1.5rem;
}
.menu-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.menu-card a:hover {
    text-decoration: none;
}

/* Para el scroll suave cuando se hace clic en los enlaces internos */
html {
    scroll-behavior: smooth;
}



/* Estilos específicos para la sección NUESTRO PROYECTO EDUCATIVO */
.menu-title + .row .menu-card .menu-image {
    height: 200px; /* Altura más compacta */
}

.menu-title + .row .menu-overlay {
    background: linear-gradient(to bottom, transparent, rgba(0,56,118,0.9));
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    text-align: left;
}

.menu-title + .row .menu-overlay h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.menu-title + .row .menu-overlay p {
    color: #fff;
    font-size: 13px;
    margin: 0;
}

/* Ajuste responsive */
@media (max-width: 991px) {
    .menu-title + .row .menu-card .menu-image {
        height: 150px;
    }
}

/* Estilos para los enlaces individuales */
.menu-links li {
    position: relative;
    transition: all 0.3s ease;
}

.menu-links li a {
    display: block;
    padding: 0px 15px;
    color: #333;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.menu-links li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    width: 0;
    height: 2px;
    background-color: #003876;
    transition: width 0.3s ease;
}

/* Efecto hover individual */
.menu-links li:hover a {
    color: #003876;
    transform: translateX(5px);
}

.menu-links li:hover a::before {
    width: calc(100% - 30px);
}

/* Aseguramos que cada elemento tenga su propio espacio */
.menu-links li + li {
    margin-top: 5px;
}

.menu-comunidad{
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px #0001;
    height: 60px;
}
.menu-comunidad .menu-text{
    text-align: left;
}
.menu-comunidad .menu-text h3{
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}
.menu-comunidad .menu-text small{
    font-size: 12px;
    color: #555;
}
.menu-comunidad img{
    width: 55px;
    height: auto;
}
@media screen and (min-width: 992px) {
    .mobile {
        visibility: collapse !important;
    }
}
