:root {
    --primary-blue: #0C1FAC;
    --accent-orange: #FF7800;
    --bg-light: #f8fafc;
    --text-main: #334155;
    --text-muted: #64748b;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* ================= HEADER & NAVBAR ================= */
.navbar {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    transition: 0.3s;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent-orange);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-blue);
    background: none;
    border: none;
    cursor: pointer;
}

/* ================= SUBMENÚS DESPLEGABLES (MULTINIVEL) ================= */
.nav-item {
    position: relative;
    display: inline-block;
    padding: 10px 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 240px;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.08);
    border-radius: 8px;
    z-index: 1001;
    flex-direction: column;
    overflow: visible; /* Permite que los sub-submenús laterales sobresalgan */
    border: 1px solid #f1f5f9;
}

.nav-item:hover > .dropdown-content {
    display: flex;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.3s, color 0.3s, padding-left 0.3s;
}

.dropdown-content a:hover {
    background-color: var(--bg-light);
    color: var(--accent-orange);
    padding-left: 25px;
}

.has-dropdown > a::after {
    content: '\f0d7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8em;
    color: var(--primary-blue);
}

/* Soporte para sub-submenús (despliegue lateral hacia la derecha) */
.dropdown-content .has-submenu {
    position: relative;
}

.dropdown-content .has-submenu > a::after {
    content: '\f0da'; /* Flecha hacia la derecha */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 10px;
    font-size: 0.8em;
    color: var(--text-muted);
}

.dropdown-content .has-submenu .submenu-level-2 {
    display: none;
    position: absolute;
    top: 0;
    left: 100%; /* Se despliega al costado derecho del elemento padre */
    background-color: white;
    min-width: 220px;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.08);
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    flex-direction: column;
    z-index: 1002;
}

.dropdown-content .has-submenu:hover > .submenu-level-2 {
    display: flex;
}

/* ================= BOTONES ================= */
.btn-primary, .btn-formulario, .enlace-separar {
    background: var(--primary-blue);
    color: white !important;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box; 
}

.btn-primary:hover, .btn-formulario:hover, .enlace-separar:hover {
    background: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 120, 0, 0.3);
}

/* ================= BANNER HERO & SWIPER ================= */
.swiper-container, .hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero-slider {
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 0 20px; 
    box-sizing: border-box; 
}

.hero-content {
    max-width: 800px;
    width: 100%; 
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem); 
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero-content p {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    margin-bottom: 30px;
    line-height: 1.5;
}

.swiper-pagination {
    display: none !important; 
}

.swiper-button-next, .swiper-button-prev {
    color: var(--primary-blue) !important;
    background: rgba(255,255,255,0.8);
    padding: 30px 20px;
    border-radius: 5px;
    transform: scale(0.7);
    transition: 0.3s;
}

.swiper-slide img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ================= CONTENEDOR PRINCIPAL ================= */
.page-content {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.page-content h1 {
    color: var(--primary-blue);
    text-align: center;
    border-bottom: 3px solid var(--accent-orange);
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 40px;
}

/* ================= GRID TARJETAS ================= */
.grid-programas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin: 50px 0;
}

.card-programa {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%; 
    box-sizing: border-box;
}

.card-programa:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(12, 31, 172, 0.1);
}

.card-programa img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid var(--bg-light);
}

.card-programa h5, .card-programa h4 {
    color: var(--primary-blue);
    font-size: 1.2rem;
    margin-bottom: 15px;
    min-height: 50px;
}

.card-programa > .card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1; 
    text-align: justify;
}

.card-programa a.enlace-separar {
    margin-top: auto; 
    width: 100%;
    display: block;
}

/* ================= ACORDEONES ================= */
details {
    width: 100%;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
    margin-bottom: 15px;
    box-sizing: border-box;
}

summary {
    padding: 15px;
    font-weight: 600;
    color: var(--primary-blue);
    cursor: pointer;
    list-style: none;
    border-left: 4px solid var(--accent-orange);
    display: flex;
    justify-content: space-between;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

details[open] summary::after {
    content: '\f077';
}

details .details-content {
    padding: 15px;
    font-size: 0.9rem;
}

details .details-content ul {
    padding-left: 20px;
}

/* ================= FORMULARIO PLACEHOLDER ================= */
.form-placeholder {
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin: 40px auto;
    max-width: 600px;
    border-top: 4px solid var(--accent-orange);
    box-sizing: border-box;
}

.form-placeholder i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

/* ================= FOOTER ================= */
.site-footer {
    background: var(--primary-blue);
    color: white;
    padding: 60px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.footer-col p { margin-bottom: 10px; font-size: 0.95rem; }
.footer-col i { color: var(--accent-orange); margin-right: 15px; width: 20px; text-align: center; }

.footer-col h3 img {
    height: 60px;
    background-color: white; 
    padding: 10px 15px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
    object-fit: contain;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

/* ================= MODAL LIGERO PARA ZOOM DE IMÁGENES ================= */
.img-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.img-modal .modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10001;
}

.close-modal:hover { color: #bbb; }

.modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px;
    z-index: 10002;
    user-select: none;
    background: rgba(0,0,0,0.5);
    border-radius: 5px;
    transition: 0.3s;
}

.modal-prev { left: 10px; }
.modal-next { right: 10px; }
.modal-prev:hover, .modal-next:hover { background: rgba(0,0,0,0.8); }

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* ================= BOTÓN OCULTO DE ADMINISTRADOR ================= */
.hidden-admin-login {
    position: fixed;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    z-index: 9999;
    opacity: 0; 
    cursor: default; 
}

/* ================= RESPONSIVE (MÓVILES) ================= */
@media (max-width: 768px) {
    .logo img {
        height: 50px;
    }

    .hero-slider {
        height: 55vh;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2rem; 
        line-height: 1.3;
        padding: 0 10px;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .swiper-button-next, .swiper-button-prev {
        padding: 15px 10px;
        transform: scale(0.5);
    }

    .modal-prev, .modal-next {
        font-size: 20px;
        padding: 10px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 80px; 
        left: 0;
        background: white;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        display: flex;
    }

    .nav-item { padding: 0; width: 100%; text-align: center; }
    .dropdown-content { position: static; box-shadow: none; border: none; background: #f8fafc; }
    
    .hamburger {
        display: block;
    }
}