/* ========================================
   VARIABLES Y RESET
   ======================================== */
:root {
    --primary-dark: #0a1628;
    --primary-mid: #0d2137;
    --primary-blue: #1a3a5c;
    --primary-light: #2c5a8c;
    --primary-hover: #3a7abd;
    --text-light: #e8edf3;
    --text-muted: #a8b8c8;
    --white: #ffffff;
    --shadow: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    padding-top: 76px;
    color: #2d3748;
    background: #f8fafc;
}
/* ========================================
   IMÁGENES DE BIENVENIDA - MEJORADO
   ======================================== */
.welcome-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    opacity: 0;
    transform: scale(0.9) translateY(30px);
}

.welcome-img-large {
    height: 350px;
}

.welcome-img-medium {
    height: 200px;
}

.welcome-img.animate__animated {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Efecto hover para las imágenes */
.welcome-img:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

/* Animaciones personalizadas */
@keyframes fadeInLeftCustom {
    from {
        opacity: 0;
        transform: translateX(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeInRightCustom {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.welcome-img.animate__fadeInLeft {
    animation: fadeInLeftCustom 0.8s ease forwards;
}

.welcome-img.animate__fadeInRight {
    animation: fadeInRightCustom 0.8s ease forwards;
}
/* ========================================
   SECCIÓN DE BIENVENIDA MEJORADA - NUEVO
   ======================================== */

/* Contenedor de la imagen principal */
.welcome-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transition: all 0.5s ease;
}

.welcome-image-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}

.welcome-main-image {
    transition: transform 0.8s ease;
    height: 400px;
    width: 100%;
    object-fit: cover;
}

.welcome-image-wrapper:hover .welcome-main-image {
    transform: scale(1.05);
}

/* Overlay con ícono de reproducción */
.welcome-image-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.4);
    opacity: 0;
    transition: all 0.4s ease;
    cursor: pointer;
    z-index: 2;
}

.welcome-image-wrapper:hover .welcome-image-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.welcome-image-overlay i {
    font-size: 35px;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.welcome-image-overlay:hover i {
    transform: scale(1.15);
    color: #ffd700;
}

/* ========================================
   TARJETAS DE IMÁGENES CON ANIMACIÓN
   ======================================== */

.welcome-image-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(50px) scale(0.95);
}

.welcome-image-card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.welcome-image-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.welcome-image-card .welcome-img {
    height: 280px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    display: block;
}

.welcome-image-card:hover .welcome-img {
    transform: scale(1.08);
}

/* Efecto de overlay en las tarjetas */
.welcome-image-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(10, 22, 40, 0.8), transparent);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.welcome-image-card:hover::after {
    opacity: 1;
}

/* Efecto de brillo */
.welcome-image-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1), transparent 70%);
    opacity: 0;
    transition: all 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.welcome-image-card:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

/* Caption de las imágenes */
.image-caption {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    padding: 20px 25px;
    color: white;
    z-index: 2;
    transition: all 0.5s ease;
    opacity: 0;
}

.welcome-image-card:hover .image-caption {
    bottom: 0;
    opacity: 1;
}

.image-caption span {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: inline-block;
    padding: 8px 20px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

.image-caption i {
    color: #ffd700;
}

/* ========================================
   ANIMACIONES PERSONALIZADAS
   ======================================== */

/* Animación para el título */
@keyframes fadeInLeftCustom {
    from {
        opacity: 0;
        transform: translateX(-60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Animación para las tarjetas */
@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.9);
    }
    60% {
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.welcome-image-card.animate {
    animation: cardAppear 0.8s ease forwards;
}

/* ========================================
   RESPONSIVE PARA LA SECCIÓN DE BIENVENIDA
   ======================================== */

@media (max-width: 991.98px) {
    .welcome-main-image {
        height: 320px;
    }
    
    .welcome-image-card .welcome-img {
        height: 220px;
    }
    
    .welcome-image-overlay {
        width: 60px;
        height: 60px;
    }
    
    .welcome-image-overlay i {
        font-size: 28px;
    }
    
    .welcome-image-wrapper {
        margin-bottom: 20px;
    }
}

@media (max-width: 767.98px) {
    .welcome-main-image {
        height: 260px;
    }
    
    .welcome-image-card .welcome-img {
        height: 180px;
    }
    
    .welcome-image-overlay {
        width: 50px;
        height: 50px;
    }
    
    .welcome-image-overlay i {
        font-size: 22px;
    }
    
    .image-caption span {
        font-size: 0.9rem;
        padding: 6px 15px;
    }
    
    .welcome-section .section-title {
        font-size: 1.8rem;
    }
    
    /* Ajuste para móvil */
    .welcome-image-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 575.98px) {
    .welcome-main-image {
        height: 200px;
    }
    
    .welcome-image-card .welcome-img {
        height: 150px;
    }
    
    .welcome-image-overlay {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .welcome-image-overlay i {
        font-size: 18px;
    }
    
    .welcome-section .section-title {
        font-size: 1.5rem;
    }
    
    .welcome-section h3 {
        font-size: 1.1rem;
    }
}
/* ========================================
   RESPONSIVE PARA IMÁGENES DE BIENVENIDA
   ======================================== */
@media (max-width: 991.98px) {
    .welcome-img {
        height: 200px;
    }
    .welcome-img-large {
        height: 280px;
    }
    .welcome-img-medium {
        height: 180px;
    }
      /* Asegurar que el menú colapsable tenga buen fondo */
    .navbar-collapse {
        background: #0a1628;
        padding: 15px 10px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* RESET de los dropdowns en móvil */
    .navbar .dropdown {
        position: relative !important;
    }
    
    /* Forzar que el menú dropdown se comporte correctamente */
    .navbar .dropdown-menu {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        float: none !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 0 !important;
        margin: 5px 0 !important;
        box-shadow: none !important;
        display: none !important;
        transition: none !important;
    }
    
    /* MOSTRAR cuando tiene la clase show */
    .navbar .dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Estilo de los items del submenú */
    .navbar .dropdown-item {
        color: #e8edf3 !important;
        padding: 12px 20px !important;
        padding-left: 35px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.9rem;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    .navbar .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .navbar .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
    }
    
    /* Toggle - hacerlo clickeable */
    .navbar .dropdown-toggle {
        cursor: pointer !important;
        user-select: none !important;
    }
    
    /* Flecha del dropdown */
    .navbar .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }
    
    .navbar .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }
}
    
    @media (max-width: 767.98px) {
        .welcome-img {
            height: 180px;
        }
        .welcome-img-large {
            height: 220px;
        }
        .welcome-img-medium {
            height: 160px;
        }
    }
    
    @media (max-width: 575.98px) {
        .welcome-img {
            height: 150px;
        }
        .welcome-img-large {
            height: 200px;
        }
        .welcome-img-medium {
            height: 140px;
        }
    }
    /* ========================================
       CARRUSEL - BOTONES FUNCIONALES
       ======================================== */
    .banner-section .carousel-control-prev,
    .banner-section .carousel-control-next {
        width: 60px;
        height: 60px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.4);
        border-radius: 50%;
        margin: 0 20px;
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
    }
    
    .banner-section:hover .carousel-control-prev,
    .banner-section:hover .carousel-control-next {
        opacity: 1;
    }
    
    .banner-section .carousel-control-prev:hover,
    .banner-section .carousel-control-next:hover {
        background: rgba(0,0,0,0.7);
        transform: translateY(-50%) scale(1.1);
    }
    
    .banner-section .carousel-control-prev-icon,
    .banner-section .carousel-control-next-icon {
        width: 30px;
        height: 30px;
        background-size: 100% 100%;
    }
    
    /* Asegurar que los botones sean clickeables */
    .banner-section .carousel-control-prev,
    .banner-section .carousel-control-next {
        pointer-events: auto;
        cursor: pointer;
    }

/* ========================================
   SOLUCIÓN DEFINITIVA PARA MENÚ MÓVIL
   ======================================== */

/* Forzar que los dropdowns en móvil se vean correctamente */
@media (max-width: 991.98px) {
    /* Hacer que el menú lateral tenga scroll si es necesario */
    .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
        background: #0a1628;
        padding: 15px 0;
    }
    
    /* Forzar que los dropdowns ocupen todo el ancho */
    .navbar .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        display: none !important; /* Oculto por defecto */
    }
    
    /* Mostrar cuando tiene la clase show */
    .navbar .dropdown-menu.show {
        display: block !important;
    }
    
    /* Estilo para los items del submenú */
    .navbar .dropdown-item {
        color: #e8edf3 !important;
        padding: 10px 20px !important;
        padding-left: 35px !important;
        font-size: 0.9rem;
        border-radius: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .navbar .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        color: #ffffff !important;
    }
    
    /* El toggle debe verse como un botón normal */
    .navbar .dropdown-toggle {
        cursor: pointer !important;
    }
    
    /* Indicador visual de que tiene submenú */
    .navbar .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }
    
    .navbar .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }
}
@media (max-width: 575.98px) {
    .welcome-section .col-lg-6 .row .col-6:first-child .welcome-img {
        height: 180px;
    }
    .welcome-img {
        height: 150px;
    }
}

/* ========================================
   ANIMACIONES PERSONALIZADAS
   ======================================== */
@keyframes fadeInLeftCustom {
    from {
        opacity: 0;
        transform: translateX(-40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeInRightCustom {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.welcome-img.animate__fadeInLeft {
    animation: fadeInLeftCustom 0.8s ease forwards;
}

.welcome-img.animate__fadeInRight {
    animation: fadeInRightCustom 0.8s ease forwards;
}

/* ========================================
   RESPONSIVE PARA IMÁGENES DE BIENVENIDA
   ======================================== */
@media (max-width: 991.98px) {
    .welcome-section .col-lg-6 .row .col-6:first-child .welcome-img {
        height: 250px;
    }
    .welcome-img {
        height: 150px;
    }
}

@media (max-width: 575.98px) {
    .welcome-section .col-lg-6 .row .col-6:first-child .welcome-img {
        height: 180px;
    }
    .welcome-img {
        height: 120px;
    }
}
   
   
/* ========================================
   SPINNER - Ocultar cuando la página carga
   ======================================== */
#spinner {
    z-index: 9999;
    background: #ffffff !important;
    transition: opacity 0.5s ease;
    opacity: 1;
}

#spinner.show {
    opacity: 1;
    visibility: visible;
}

#spinner.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#spinner .spinner-border {
    border-color: #0a1628 !important;
    border-right-color: transparent !important;
}

/* Si el usuario tiene JavaScript deshabilitado, mostrar mensaje */
.no-js #spinner {
    display: none !important;
}
/* ========================================
   NAVBAR
   ======================================== */
.navbar {
    background: var(--primary-dark) !important;
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
    transition: var(--transition);
}

.navbar-brand .brand-text {
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.navbar .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--white) !important;
    background: rgba(255,255,255,0.08);
}

.navbar .dropdown-menu {
    background: var(--primary-mid);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 8px;
    box-shadow: var(--shadow);
}

.navbar .dropdown-item {
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.navbar .dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.navbar .dropdown-divider {
    border-color: rgba(255,255,255,0.05);
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.2);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========================================
   BANNER / CARRUSEL
   ======================================== */
.banner-section {
    position: relative;
    height: 85vh;
    min-height: 500px;
    overflow: hidden;
}

.banner-section .carousel,
.banner-section .carousel-inner,
.banner-section .carousel-item {
    height: 100%;
}

.banner-section .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-section .carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, 0.6);
    z-index: 1;
}

.banner-section .carousel-caption {
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
}

.banner-section .carousel-caption h1 {
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    letter-spacing: -0.5px;
}

.banner-section .carousel-caption .lead {
    font-size: 1.25rem;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}


.banner-section .carousel-indicators {
    bottom: 40px;
}

.banner-section .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    margin: 0 6px;
}

.banner-section .carousel-indicators button.active {
    background: var(--white);
    border-color: var(--white);
}
/* ========================================
   BOTONES
   ======================================== */
.btn-primary {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transition: var(--transition);
    font-weight: 600;
    padding: 12px 32px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 90, 140, 0.3);
}

.btn-outline-light {
    border-width: 2px;
    font-weight: 600;
    padding: 12px 32px;
}

.btn-light {
    font-weight: 600;
    padding: 12px 32px;
}

/* ========================================
   SECCIONES
   ======================================== */
.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 2px;
}

.welcome-section {
    padding: 80px 0;
}

.welcome-section .section-title {
    display: block;
}

.welcome-section .section-title::after {
    left: 0;
    transform: none;
}

/* ========================================
   TARJETAS DE UNIDADES
   ======================================== */
.units-section {
    padding: 80px 0;
}

.unit-card {
    transition: var(--transition);
    border: 1px solid #e8edf3;
    cursor: default;
}

.unit-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}

.unit-icon {
    background: var(--primary-dark) !important;
    transition: var(--transition);
}

.unit-card:hover .unit-icon {
    background: var(--primary-light) !important;
}

.unit-card h5 {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1rem;
}

.unit-card .btn-outline-primary {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.unit-card .btn-outline-primary:hover {
    background: var(--primary-light);
    color: var(--white);
}

/* ========================================
   PREGUNTAS FRECUENTES
   ======================================== */
.faq-section {
    padding: 80px 0;
    background: var(--white);
}

.faq-section .accordion-item {
    border: 1px solid #e8edf3;
    margin-bottom: 12px;
    border-radius: 10px !important;
    overflow: hidden;
}

.faq-section .accordion-button {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 18px 24px;
    background: #f8fafc;
}

.faq-section .accordion-button:not(.collapsed) {
    background: var(--primary-dark);
    color: var(--white);
    box-shadow: none;
}

.faq-section .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.faq-section .accordion-body {
    padding: 20px 24px;
    color: #4a5a6a;
    line-height: 1.7;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 60px 0 0;
}

.footer-title {
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-text {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 6px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-contact li i {
    margin-right: 14px;
    margin-top: 4px;
    min-width: 20px;
}

.social-links {
    margin-top: 20px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    color: var(--text-light);
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary-light);
    color: var(--white);
    transform: translateY(-3px);
}

.facebook-feed {
    max-width: 600px;
    margin: 0 auto;
}

.facebook-feed .fb-page {
    max-width: 100%;
    overflow: hidden;
}

/* Copyright */
.copyright {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.copyright b {
    color: var(--white);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991.98px) {
    .navbar {
        padding: 10px 0;
    }
    .navbar .nav-link {
        padding: 6px 12px !important;
    }
    .banner-section {
        height: 60vh;
        min-height: 400px;
    }
    .banner-section .carousel-caption h1 {
        font-size: 2.2rem !important;
    }
    .banner-section .carousel-control-prev,
    .banner-section .carousel-control-next {
        width: 40px;
        height: 40px;
        margin: 0 10px;
    }
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-top: 62px;
    }
    .navbar-brand .brand-text {
        font-size: 0.9rem;
    }
    .banner-section {
        height: 50vh;
        min-height: 350px;
    }
    .banner-section .carousel-caption h1 {
        font-size: 1.8rem !important;
    }
    .banner-section .carousel-caption .lead {
        font-size: 1rem;
    }
    .welcome-section {
        padding: 50px 0;
    }
    .units-section {
        padding: 50px 0;
    }
    .faq-section {
        padding: 50px 0;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .btn-primary,
    .btn-outline-light,
    .btn-light {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .footer {
        padding: 40px 0 0;
    }
    .footer-widget {
        margin-bottom: 30px;
    }
}

@media (max-width: 575.98px) {
    .banner-section {
        height: 40vh;
        min-height: 300px;
    }
    .banner-section .carousel-caption h1 {
        font-size: 1.5rem !important;
    }
    .banner-section .carousel-caption .lead {
        font-size: 0.9rem;
    }
    .banner-section .carousel-indicators {
        bottom: 20px;
    }
    .banner-section .carousel-indicators button {
        width: 10px;
        height: 10px;
    }
}

/* Edge tiene problemas con position: static en dropdowns */
@supports (-ms-ime-align: auto) {
    /* Este selector solo funciona en Edge */
    @media (max-width: 991.98px) {
        .navbar .dropdown-menu {
            position: relative !important;
            display: none !important;
            width: 100% !important;
            background: rgba(255, 255, 255, 0.05) !important;
            border: none !important;
            padding: 0 !important;
            margin: 5px 0 !important;
            box-shadow: none !important;
            transform: none !important;
            top: auto !important;
            left: auto !important;
            float: none !important;
            max-height: none !important;
            overflow: visible !important;
        }
        
        .navbar .dropdown-menu.show {
            display: block !important;
        }
        
        .navbar .dropdown-item {
            display: block !important;
            color: #e8edf3 !important;
            padding: 12px 20px !important;
            padding-left: 35px !important;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
            white-space: normal !important;
            word-wrap: break-word !important;
            width: 100% !important;
            clear: both !important;
        }
    }
}

/* Fix adicional para Edge y todos los navegadores */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #0a1628;
        padding: 15px 10px;
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Para iOS */
    }
    
    .navbar .dropdown {
        position: relative !important;
    }
    
    .navbar .dropdown-menu {
        position: relative !important;
        display: none !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 0 !important;
        margin: 5px 0 !important;
        box-shadow: none !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        float: none !important;
    }
    
    .navbar .dropdown-menu.show {
        display: block !important;
    }
    
    .navbar .dropdown-item {
        display: block !important;
        color: #e8edf3 !important;
        padding: 12px 20px !important;
        padding-left: 35px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.9rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        width: 100% !important;
        clear: both !important;
        text-align: left !important;
    }
    
    .navbar .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .navbar .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
    }
    
    .navbar .dropdown-toggle {
        cursor: pointer !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }
    
    .navbar .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }
    
    .navbar .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }
}

/* ========================================
   ESTILOS ADICIONALES PARA HISTORIA.PHP
   ======================================== */

/* Ajuste para las tarjetas de línea de tiempo */
.unit-card .unit-icon span {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Efecto hover para las tarjetas de tiempo */
.unit-card:hover .unit-icon span {
    color: #ffd700;
}

/* Ajuste para el video responsivo */
.welcome-image-wrapper iframe {
    border-radius: 16px;
}

/* Estilo para la sección de galería en Historia */
#galeria .welcome-image-card .welcome-img {
    height: 200px;
}

@media (max-width: 767.98px) {
    #galeria .welcome-image-card .welcome-img {
        height: 150px;
    }
}

@media (max-width: 575.98px) {
    #galeria .welcome-image-card .welcome-img {
        height: 120px;
    }
}

/* Botones de carrusel para Historia */
.banner-section .carousel-control-prev,
.banner-section .carousel-control-next {
    display: flex !important;
}

/* Mejora de espaciado en móvil */
@media (max-width: 767.98px) {
    .welcome-section .btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .welcome-section .btn-group .btn {
        width: 100%;
        margin: 0 !important;
    }
}

/* ========================================
   GALERÍA INTERACTIVA - MODAL
   ======================================== */

/* Las imágenes de la galería se vuelven clickeables */
.gallery-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    z-index: 5;
}

/* ========================================
   MODAL PARA GALERÍA
   ======================================== */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: modalFadeIn 0.4s ease;
    overflow: hidden;
}

.gallery-modal.active {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalContentIn 0.5s ease;
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    transition: transform 0.3s ease;
}

.gallery-modal-content img:hover {
    transform: scale(1.02);
}

/* Título de la imagen en el modal */
.gallery-modal-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 20px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    padding: 10px 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Botón de cerrar */
.gallery-modal-close {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gallery-modal-close:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
    transform: rotate(90deg);
}

/* Botones de navegación (prev/next) */
.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gallery-modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-nav.prev {
    left: -80px;
}

.gallery-modal-nav.next {
    right: -80px;
}

/* Contador de imágenes */
.gallery-modal-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========================================
   RESPONSIVE PARA LA GALERÍA
   ======================================== */

@media (max-width: 991.98px) {
    .gallery-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .gallery-modal-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .gallery-modal-nav.prev {
        left: 10px;
    }
    
    .gallery-modal-nav.next {
        right: 10px;
    }
    
    .gallery-modal-content img {
        max-height: 70vh;
    }
    
    .gallery-modal-title {
        font-size: 1.2rem;
        padding: 8px 20px;
        margin-top: 15px;
    }
    
    .gallery-modal-counter {
        font-size: 0.8rem;
        bottom: -35px;
    }
}

@media (max-width: 575.98px) {
    .gallery-modal {
        padding: 15px;
    }
    
    .gallery-modal-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .gallery-modal-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .gallery-modal-nav.prev {
        left: 5px;
    }
    
    .gallery-modal-nav.next {
        right: 5px;
    }
    
    .gallery-modal-content img {
        max-height: 60vh;
    }
    
    .gallery-modal-title {
        font-size: 1rem;
        padding: 6px 15px;
        margin-top: 10px;
    }
}

/* Estilo para el scroll cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}


/* ========================================
   ESTILOS ADICIONALES PARA CUEVAS.PHP
   ======================================== */

/* Efecto de hover en las tarjetas de información */
.unit-card .btn-outline-primary {
    transition: all 0.3s ease;
}

.unit-card .btn-outline-primary:hover {
    background: var(--primary-light);
    color: white;
}

/* Animación para la información extra */
.info-extra {
    animation: fadeInDown 0.4s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilo para los badges */
.badge {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 20px;
}

/* Ajuste para los QR codes */
.unit-card img {
    max-width: 100%;
    height: auto;
}

/* Mejora en la sección de video */
.ratio-16x9 {
    border-radius: 16px;
    overflow: hidden;
}

/* Responsive para las tarjetas */
@media (max-width: 767.98px) {
    .unit-card .unit-icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .unit-card .unit-icon span {
        font-size: 1.4rem !important;
    }
    
    .unit-card .unit-icon i {
        font-size: 1.5rem !important;
    }
}

/* Efecto de brillo en las imágenes de la galería */
.gallery-item .welcome-img {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.gallery-item:hover .welcome-img {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* Estilo para el contenedor de la galería */
#galeria .welcome-image-card .welcome-img {
    height: 200px;
}

@media (max-width: 767.98px) {
    #galeria .welcome-image-card .welcome-img {
        height: 150px;
    }
}

@media (max-width: 575.98px) {
    #galeria .welcome-image-card .welcome-img {
        height: 120px;
    }
}

/* ========================================
   CARRUSEL DE GALERÍA - CUEVAS
   ======================================== */

.gallery-carousel-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Imagen Principal */
.gallery-main-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #0a1628;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    width: 100%;
    height: 500px; /* Altura fija para todas las imágenes */
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Esto hace que todas las imágenes ocupen el mismo espacio sin distorsión */
    transition: transform 0.5s ease, opacity 0.4s ease;
    background: #0a1628;
}

.gallery-main-image img:hover {
    transform: scale(1.02);
}

/* Contador y título */
.gallery-image-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 5;
}

.gallery-image-title {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 5;
    text-align: center;
    white-space: nowrap;
}

/* Miniaturas */
.gallery-thumbnails {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0 15px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
    width: 120px;
    height: 80px;
    border: 3px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.gallery-thumb:hover {
    transform: scale(1.05);
    border-color: rgba(44, 90, 140, 0.5);
}

.gallery-thumb.active {
    border-color: var(--primary-light);
    box-shadow: 0 0 20px rgba(44, 90, 140, 0.3);
    transform: scale(1.05);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Todas las miniaturas se ven iguales */
    display: block;
}

/* Botones de navegación (flechas) */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.gallery-carousel-wrapper:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: rgba(44, 90, 140, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.gallery-prev {
    left: -25px;
}

.gallery-nav.gallery-next {
    right: -25px;
}

/* ========================================
   RESPONSIVE PARA EL CARRUSEL
   ======================================== */

@media (max-width: 991.98px) {
    .gallery-main-image {
        height: 380px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
        opacity: 1;
    }
    
    .gallery-nav.gallery-prev {
        left: 10px;
    }
    
    .gallery-nav.gallery-next {
        right: 10px;
    }
    
    .gallery-thumb {
        width: 90px;
        height: 60px;
    }
    
    .gallery-image-title {
        font-size: 0.9rem;
        padding: 8px 20px;
        bottom: 20px;
        white-space: nowrap;
    }
    
    .gallery-image-counter {
        font-size: 0.8rem;
        padding: 6px 14px;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 767.98px) {
    .gallery-main-image {
        height: 280px;
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .gallery-thumb {
        width: 70px;
        height: 50px;
    }
    
    .gallery-thumbnails {
        gap: 8px;
    }
    
    .gallery-image-title {
        font-size: 0.8rem;
        padding: 6px 15px;
        bottom: 15px;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .gallery-main-image {
        height: 220px;
    }
    
    .gallery-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
        opacity: 1;
    }
    
    .gallery-thumb {
        width: 55px;
        height: 40px;
        border-width: 2px;
    }
    
    .gallery-thumbnails {
        gap: 6px;
        padding: 6px 3px 10px 3px;
    }
    
    .gallery-image-title {
        font-size: 0.7rem;
        padding: 4px 12px;
        bottom: 10px;
        white-space: nowrap;
    }
    
    .gallery-image-counter {
        font-size: 0.7rem;
        padding: 4px 10px;
        top: 10px;
        right: 10px;
    }
}

/* Animación de transición */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-main-image img.active {
    animation: galleryFadeIn 0.4s ease;
}
/* ========================================
   RESPONSIVE PARA EL CARRUSEL
   ======================================== */

@media (max-width: 991.98px) {
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
        opacity: 1;
    }
    
    .gallery-nav.gallery-prev {
        left: 10px;
    }
    
    .gallery-nav.gallery-next {
        right: 10px;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 45px;
    }
    
    .gallery-image-title {
        font-size: 0.9rem;
        padding: 8px 20px;
        bottom: 20px;
        white-space: nowrap;
    }
    
    .gallery-image-counter {
        font-size: 0.8rem;
        padding: 6px 14px;
        top: 15px;
        right: 15px;
    }
    
    .gallery-main-image {
        aspect-ratio: 16/10;
    }
}

@media (max-width: 767.98px) {
    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .gallery-thumb {
        width: 50px;
        height: 38px;
    }
    
    .gallery-thumbnails {
        gap: 8px;
    }
    
    .gallery-image-title {
        font-size: 0.8rem;
        padding: 6px 15px;
        bottom: 15px;
        white-space: nowrap;
    }
    
    .gallery-main-image {
        aspect-ratio: 4/3;
    }
    
    .gallery-main-image img {
        padding: 5px;
    }
}

@media (max-width: 575.98px) {
    .gallery-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
        opacity: 1;
    }
    
    .gallery-thumb {
        width: 40px;
        height: 30px;
        border-width: 2px;
    }
    
    .gallery-thumbnails {
        gap: 6px;
    }
    
    .gallery-image-title {
        font-size: 0.7rem;
        padding: 4px 12px;
        bottom: 10px;
        white-space: nowrap;
    }
    
    .gallery-image-counter {
        font-size: 0.7rem;
        padding: 4px 10px;
        top: 10px;
        right: 10px;
    }
    
    .gallery-main-image {
        aspect-ratio: 1/1;
    }
}

/* Animación de transición */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-main-image img.active {
    animation: galleryFadeIn 0.4s ease;
}

/* ========================================
   SCROLL DE MINIATURAS
   ======================================== */

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0 15px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* En móvil, las miniaturas ocupan menos espacio */
@media (max-width: 767.98px) {
    .gallery-thumbnails {
        gap: 8px;
        padding: 8px 5px 12px 5px;
    }
    
    .gallery-thumb {
        flex-shrink: 0;
        width: 55px;
        height: 40px;
    }
}

@media (max-width: 575.98px) {
    .gallery-thumbnails {
        gap: 6px;
        padding: 6px 3px 10px 3px;
    }
    
    .gallery-thumb {
        width: 45px;
        height: 33px;
    }
}