/* --- 1. Importación Local de la Tipografía Montserrat --- */

/* Estilo Regular (Normal) */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat.regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    /* Mejora la velocidad de carga visual */
}

/* Estilo Bold (Negrita) */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat.bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #ffffff;
}

p {
    margin-bottom: 2em;
    /* Equivalente a una línea en blanco extra */
}

/* --- Estructura de la Barra de Navegación --- */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    z-index: 150 !important;
    /* Forza a la barra de navegación a estar por encima del video */
}

header div {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

h1 {
    color: white;
    z-index: 102;
    /* Se mantiene visible sobre el menú desplegado */
}

/* --- El botón Hamburguesa --- */
.menu-checkbox {
    display: none;
    /* Ocultamos el cuadrito del checkbox */
}

.hamburger {
    grid-column: 3;
    justify-self: end;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 102;
    /* Asegura que quede por encima del menú al abrirse */
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
}

/* --- Menú Desplegable (Estilo Móvil en cualquier pantalla) --- */
nav {
    position: fixed;
    top: 0;
    right: -100%;
    /* Oculto completamente a la derecha */
    width: 300px;
    /* Ancho del panel del menú */
    height: 100vh;
    background-color: rgba(20, 20, 20, 0.5);
    /* Fondo oscuro semitransparente */
    backdrop-filter: blur(10px);
    /* Efecto difuminado moderno */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: right 0.4s ease;
    /* Animación de deslizamiento */
    z-index: 101;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    transition: color 0.2s;
}

nav a:hover {
    color: #b3b3b3;
}

/* --- Lógica de Apertura con Pure CSS --- */

/* Cuando el checkbox esté activado, mueve el menú a la posición visible */
.menu-checkbox:checked~nav {
    right: 0;
}

/* Animación opcional: transforma las tres líneas de la hamburguesa en una "X" al abrirse */
.menu-checkbox:checked~.hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-checkbox:checked~.hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-checkbox:checked~.hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- Estilos para el nuevo Logo en Imagen --- */
.logo-link {
    grid-column: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 102;
    /* Para que siga visible por encima del menú desplegado */
    text-decoration: none;
}

.logo-img {
    height: 100px;
    /* Ajusta este valor (por ejemplo, entre 35px y 50px) según lo grande que quieras que se vea */
    width: auto;
    /* Mantiene la proporción original de la imagen */
    object-fit: contain;
}

/* --- Contenedor Base Fijo --- */
.hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    /* El contenedor se queda abajo */
}


/* --- Estilo base idéntico para todas las imágenes del carrusel --- */
.slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1);

    animation:
        fundidoCarrusel 14s infinite ease-in-out,
        zoomCarrusel 14s infinite linear;

    will-change: opacity, transform;
}

/* --- Retrasos de cada imagen --- */
.img1 {
    background-image: url('../img/g1.webp');
    animation-delay: 0s;
}

.img2 {
    background-image: url('../img/g2.webp');
    animation-delay: 3.5s;
}

.img3 {
    background-image: url('../img/g3.webp');
    animation-delay: 7s;
}

.img4 {
    background-image: url('../img/g4.webp');
    animation-delay: 10.5s;
}

/* --- Animación --- */
@keyframes fundidoCarrusel {
    0% {
        opacity: 0;
        transform: scale(1);
    }

    5% {
        opacity: 1;
        transform: scale(1.02);
    }

    25% {
        opacity: 1;
        transform: scale(1.12);
    }

    30% {
        opacity: 0;
        transform: scale(1.14);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes zoomCarrusel {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1.12);
    }
}


/* --- Nuevas Secciones de Contenido (Debajo del Fondo) --- */

/* Contenedor que empuja el contenido hacia abajo para que no tape la imagen principal */
.content-container {
    background-color: #ffffff;
    /* Fondo blanco para las secciones de texto, puedes cambiarlo */
    padding: 10px 20px;
    color: #333333;
    /* Color de texto oscuro para que sea legible */
    position: relative;
    z-index: 10;
}

/* --- Espaciado exclusivo para la sección de presentación --- */
#presentacion {
    margin-top: 50px;
    /* Ajusta este valor (en píxeles) para dar más o menos espacio */
}

/* Cada sección individual */
.info-section {
    max-width: 1000px;
    margin: 0 auto 80px auto;
    /* Centra la sección y añade separación abajo */
}

/* --- Estilo para el logotipo de la presentación con Zoom por Scroll --- */
.logo-presentacion {
    display: block;
    margin: 0 auto 100px auto;
    max-width: 200px;
    height: auto;
    animation: zoomPorScroll linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
    transition: transform 0.3s ease;
}

.logo-presentacion:hover {
    transform: scale(1.08);
}

/* --- NUEVA ANIMACIÓN: El scroll controla el tamaño y la opacidad --- */
@keyframes zoomPorScroll {
    from {
        opacity: 0;
        transform: scale(0.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Título de la sección (ocupa todo el ancho, arriba) */
.section-title {
    /*    font-size: 2rem; */
    margin-bottom: 30px;
    color: #111111;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
    text-align: center;
}

/* Contenedor Flexbox para poner la imagen a la izquierda y el texto a la derecha */
.section-body {
    display: flex;
    gap: 40px;
    align-items: center;
}

/* --- Nueva clase para textos que ocupan el 100% del ancho (Sin imágenes) --- */
.section-body-full {
    width: 100%;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555555;
    text-align: justify;
}

/* Bloque de la imagen (Izquierda) */
.section-image {
    flex: 1;
    max-width: 500px;
}

.section-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Bloque del texto (Derecha) */
.section-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555555;
}

/* --- Adaptación para Pantallas Pequeñas (Móviles) --- */
@media (max-width: 768px) {
    .section-body {
        flex-direction: column;
        gap: 20px;
    }

    .section-image {
        max-width: 100%;
    }
}

/* --- Estilos para el Pie de Página (Footer) --- */
footer {
    background-color: #111111;
    padding: 30px 20px;
    width: 100%;
    margin-top: 50px;
}

footer p {
    color: #ffffff;
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 0;
    opacity: 0.8;
}

/* --- Estilos para la sección de Contacto --- */
.contacto-centro {
    text-align: center;
}

.contacto-nombre {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 25px !important;
    color: #111111;
}

.contacto-dato {
    margin-bottom: 0 !important;
    line-height: 1.4;
}

.contacto-link {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.contacto-link:hover {
    color: #111111;
    text-decoration: underline;
}

html {
    scroll-behavior: smooth;
}

/* --- Estilos para el Botón Fijo "Volver Arriba" --- */
#btn-arriba {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(5px);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.5rem;
    transform: rotate(-90deg);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#btn-arriba.visible {
    opacity: 1;
    visibility: visible;
}

#btn-arriba:hover {
    background-color: #111111;
    transform: rotate(-90deg) scale(1.1);
}

/* --- Estilos para la Pantalla de Carga (Preloader) --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #eaeaea;
    border-top: 5px solid #111111;
    border-radius: 50%;
    animation: girarSpinner 1s linear infinite;
}

#preloader.oculto {
    opacity: 0;
    visibility: hidden;
}

@keyframes girarSpinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    align-items: start;
}

.instagram-grid .card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    height: 380px;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    position: relative;
}

.instagram-grid .card .instagram-media {
    margin: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
}

.instagram-media {
    margin: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 0 !important;
    border-radius: 0 !important;
}

.instagram-media iframe {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 380px !important;
    display: block !important;
}

@media (max-width:900px) {
    .instagram-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width:768px) {
    .instagram-grid {
        grid-template-columns: 1fr;
    }
}

.btn-instagram {
    display: inline-block;
    padding: 12px 30px;
    background-color: #111111;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-instagram:hover {
    background-color: #333333;
}

/* ================================================================
   MODAL - Estilos mejorados con botón de cierre visible
   ================================================================ */

/* ================================================================
   MODAL - Ventana emergente centrada (NO a pantalla completa)
   ================================================================ */

/* Contenedor del modal - Fondo oscuro que cubre toda la pantalla */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
    opacity: 1;
}

/* Botón de cierre - Con margen superior y derecho aumentado */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.8);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
    line-height: 1;
    user-select: none;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.modal-close:active {
    transform: scale(0.9);
}

/* Contenido del modal - Ventana centrada */
.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    margin: auto;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-carousel-container {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 85vh;
    aspect-ratio: 16 / 9;
    background-color: #111111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-slides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    display: block;
}

/* Modo "contain" para imágenes que deben verse completas (como la de "Quiénes somos") */
.modal-carousel-container.modal-contain {
    aspect-ratio: unset;
    height: auto;
    max-height: 85vh;
    background-color: #111111;
}

.modal-carousel-container.modal-contain .modal-slides {
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 400px;
}

.modal-carousel-container.modal-contain .modal-slides img {
    object-fit: contain;
    width: auto;
    height: auto;
    max-width: 95%;
    max-height: 85vh;
    min-width: auto;
    min-height: auto;
}

/* Botones de navegación */
.prev-slide,
.next-slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 14px 18px;
    cursor: pointer;
    font-size: 22px;
    border-radius: 50%;
    z-index: 100000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.prev-slide {
    left: 12px;
}

.next-slide {
    right: 12px;
}

.prev-slide:hover,
.next-slide:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.05);
}

.prev-slide:active,
.next-slide:active {
    transform: translateY(-50%) scale(0.95);
}

/* ================================================================
   RESPONSIVE - Ajustes para dispositivos móviles
   ================================================================ */

/* Tablets y móviles grandes */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 100%;
    }

    .modal-carousel-container {
        border-radius: 8px;
        max-height: 80vh;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 26px;
        background: rgba(0, 0, 0, 0.85);
        border-width: 2px;
    }

    .prev-slide,
    .next-slide {
        padding: 10px 14px;
        font-size: 18px;
        width: 40px;
        height: 40px;
    }

    .prev-slide {
        left: 8px;
    }

    .next-slide {
        right: 8px;
    }

    .modal-carousel-container.modal-contain .modal-slides {
        min-height: 300px;
    }

    .modal-carousel-container.modal-contain .modal-slides img {
        max-height: 75vh;
        max-width: 95%;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .modal-content {
        width: 98%;
    }

    .modal-carousel-container {
        border-radius: 6px;
        max-height: 75vh;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 22px;
        background: rgba(0, 0, 0, 0.9);
    }

    .prev-slide,
    .next-slide {
        padding: 8px 12px;
        font-size: 16px;
        width: 36px;
        height: 36px;
    }

    .prev-slide {
        left: 5px;
    }

    .next-slide {
        right: 5px;
    }

    .modal-carousel-container.modal-contain .modal-slides {
        min-height: 250px;
    }

    .modal-carousel-container.modal-contain .modal-slides img {
        max-height: 70vh;
        max-width: 98%;
    }
}

/* --- Estilos para el Video en Pantalla Completa (Hero) --- */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: -1;
    /* El video se va al fondo total del contenedor para no pisar el botón */
    pointer-events: none;
}

.hero-static-content {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    width: 90%;
}

.hero-static-content h1 {
    font-size: 3.4rem;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.65);
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #ffffff;
}

.hero-static-content p {
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 300;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .hero-static-content h1 {
        font-size: 2rem;
    }

    .hero-static-content p {
        font-size: 1rem;
        letter-spacing: 2px;
    }
}