/* ============================================= */
/* VARIABLES Y ESTILOS GLOBALES                  */
/* ============================================= */
:root {
    --primary-color: #002D62; /* Un azul corporativo oscuro */
    --secondary-color: #00BFFF; /* Un azul más brillante para acentos */
    --dark-color: #000000;
    --light-color: #FFFFFF;
    --text-color: #F0F0F0;
    --font-family: 'Poppins', sans-serif; /* Puedes cambiarla por otra fuente de Google Fonts */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--dark-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--light-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================= */
/* PRELOADER - ANIMACIÓN DE OBTURADOR DE CÁMARA  */
/* ============================================= */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-color); /* Fondo negro base */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; /* Oculta cualquier cosa que se salga */
    transition: opacity 0.5s ease 0.5s, visibility 0.5s ease 0.5s; /* Añade un retardo al desaparecer */
}

/* Estilo de la clase que añade el JS para desaparecer */
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Estilos para las "cuchillas" del obturador */
.shutter {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%; /* Cada una ocupa la mitad de la pantalla */
    background-color: #0a0a0a; /* Un negro ligeramente distinto para que se noten */
    
    /* Animación para abrir el obturador */
    animation: openShutter 1s ease-in-out forwards;
}

.top-shutter {
    top: 0;
    border-bottom: 1px solid #222; /* Borde sutil */
}

.bottom-shutter {
    bottom: 0;
    border-top: 1px solid #222; /* Borde sutil */
}

/* Animación que hace que las cuchillas se encojan hasta desaparecer */
@keyframes openShutter {
    0% {
        height: 50%;
    }
    100% {
        height: 0%;
    }
}

/* Estilos para el logo que se revela */
.preloader-logo {
    max-width: 150px;
    opacity: 0; /* Inicia invisible */
    transform: scale(0.8); /* Inicia ligeramente pequeño */

    /* Animación para revelar el logo */
    animation: revealLogo 0.8s ease-out 0.5s forwards;
    /* El retardo de 0.5s hace que la animación del logo empiece a mitad de la animación del obturador */
}

/* Animación que hace aparecer y enfocar el logo */
@keyframes revealLogo {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================= */
/* HEADER Y NAVEGACIÓN                           */
/* ============================================= */
.header {
    background-color: var(--dark-color);
    width: 100%;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

.nav-logo {
    color: var(--light-color);
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--light-color);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--secondary-color);
}

/* Menú de Hamburguesa */
#nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    background-color: var(--light-color);
    position: relative;
    width: 30px;
    height: 3px;
    border-radius: 3px;
    transition: all 0.4s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
}

.hamburger::before {
    top: -10px;
}

.hamburger::after {
    bottom: -10px;
}


/* ============================================= */
/* HERO SECTION / SLIDESHOW                      */
/* ============================================= */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--light-color);
    overflow: hidden; /* Evita que el texto se vea fuera de lugar durante la animación */
}

/* --- Animación para las imágenes de fondo --- */
.slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* CAMBIO: La animación ahora dura 40s (5 slides * 8s cada una) */
    animation: slide-animation 40s infinite; 
}

/* Retardos para las 5 imágenes */
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 8s; }
.slide:nth-child(3) { animation-delay: 16s; }
.slide:nth-child(4) { animation-delay: 24s; } /* NUEVA REGLA */
.slide:nth-child(5) { animation-delay: 32s; } /* NUEVA REGLA */

.slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

/* CAMBIO: Los porcentajes de la animación se ajustan al nuevo ciclo de 40s */
@keyframes slide-animation {
    0%   { opacity: 0; transform: scale(1.1); }
    4%   { opacity: 1; transform: scale(1); }   /* 4% de 40s = 1.6s para aparecer */
    16%  { opacity: 1; transform: scale(1); }   /* Se mantiene visible */
    20%  { opacity: 0; transform: scale(1.1); } /* 4% de 40s = 1.6s para desaparecer. 20% de 40s = 8s */
    100% { opacity: 0; }
}

/* --- Estilos y animación para el texto --- */

.hero-text-slider {
    position: relative;
    z-index: 3;
    padding: 20px;
    width: 90%;
    max-width: 800px; 
}

.hero-text-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    opacity: 0; 
    /* CAMBIO: La animación ahora dura 40s para sincronizarse */
    animation: text-slide-animation 40s infinite; 
}

/* Retardos para las 5 frases */
.hero-text-slide:nth-child(1) { animation-delay: 0s; }
.hero-text-slide:nth-child(2) { animation-delay: 8s; }
.hero-text-slide:nth-child(3) { animation-delay: 16s; }
.hero-text-slide:nth-child(4) { animation-delay: 24s; } /* NUEVA REGLA */
.hero-text-slide:nth-child(5) { animation-delay: 32s; } /* NUEVA REGLA */


.hero-text-slide h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    text-transform: uppercase;
}

.hero-text-slide p {
    font-size: 1.5rem;
    font-weight: 300;
}

/* CAMBIO: Los porcentajes de la animación se ajustan al nuevo ciclo de 40s */
@keyframes text-slide-animation {
    0%   { transform: translate(-50%, calc(-50% + 50px)); opacity: 0; }
    4%   { transform: translate(-50%, -50%); opacity: 1; }
    16%  { transform: translate(-50%, -50%); opacity: 1; }
    20%  { transform: translate(-50%, calc(-50% - 50px)); opacity: 0; }
    100% { opacity: 0; }
}


/* ============================================= */
/* SECCIONES (Estilos generales y de aparición)   */
/* ============================================= */
.reveal {
    position: relative;
    transform: translateY(150px);
    opacity: 0;
    transition: 1s all ease;
}

.reveal.active {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================= */
/* GALERÍA                                       */
/* ============================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 45, 98, 0.8);
    color: var(--light-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================= */
/* SERVICIOS                                     */
/* ============================================= */
.services-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.service-card {
    background: #111;
    padding: 2.5rem 2rem;
    border-radius: 10px;
    text-align: center;
    flex-basis: 300px;
    border: 1px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 191, 255, 0.2);
}

.service-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--light-color);
}

/* ============================================= */
/* TESTIMONIOS                                   */
/* ============================================= */
.testimonials-section {
    background-color: #0A0A0A;
}

.testimonials-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.testimonial-card {
    background: #111;
    padding: 2rem;
    border-radius: 10px;
    flex-basis: 350px;
    border-left: 5px solid var(--secondary-color);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-card cite {
    font-weight: bold;
    color: var(--secondary-color);
}

/* --- INICIO: NUEVOS ESTILOS PARA LA SECCIÓN DE CLIENTES --- */
.clients-section {
    padding: 60px 20px;
    background-color: var(--dark-color);
}

.clients-grid {
    display: grid;
    /* Crea una cuadrícula responsive que se ajusta automáticamente */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2.5rem; /* Espacio entre logos */
    align-items: center; /* Alinea verticalmente los logos */
    max-width: 1000px;
    margin: 0 auto;
}

.client-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.client-logo img {
    max-width: 150px; /* Ancho máximo para cada logo */
    height: auto;
    
    /* --- El Efecto Mágico --- */
    
    /* 1. Por defecto, el logo está en blanco y negro */
    filter: grayscale(100%);
    
    /* 2. Añadimos una transición suave para el cambio de color y tamaño */
    transition: filter 0.4s ease, transform 0.4s ease;
}

/* 3. Al pasar el cursor sobre el contenedor del logo... */
.client-logo:hover img {
    /* ...el filtro de escala de grises se elimina, revelando el color original */
    filter: grayscale(0%);
    
    /* Opcional: El logo se agranda un poco para un efecto más dinámico */
    transform: scale(1.1);
}
/* --- FIN: NUEVOS ESTILOS --- */

/* ============================================= */
/* EQUIPO / COLABORADORES                        */
/* ============================================= */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.team-member:hover img {
    transform: scale(1.05);
}

.team-member h4 {
    color: var(--light-color);
    font-size: 1.1rem;
}

.team-member p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ============================================= */
/* EQUIPO / COLABORADORES                        */
/* ============================================= */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Ajustado para más espacio */
    gap: 2rem; /* Aumentado el espacio */
    justify-items: center;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.team-member:hover img {
    transform: scale(1.05);
}

.team-member h4 {
    color: var(--light-color);
    font-size: 1.1rem;
    margin-bottom: 0.25rem; /* Añadido margen */
}

.team-member p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 0.75rem; /* Añadido margen para separar de los iconos */
}

/* --- INICIO: NUEVOS ESTILOS PARA ICONOS SOCIALES DEL EQUIPO --- */
.team-social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem; /* Espacio entre iconos */
}

.team-social-icons a {
    color: var(--text-color);
    font-size: 1.2rem; /* Tamaño del icono */
    transition: color 0.3s ease, transform 0.3s ease;
}

.team-social-icons a:hover {
    color: var(--secondary-color); /* Cambia a color de acento al pasar el mouse */
    transform: translateY(-3px); /* Pequeño efecto de elevación */
}
/* --- FIN: NUEVOS ESTILOS --- */

/* ============================================= */
/* FORMULARIO DE CONTACTO                        */
/* ============================================= */
.contact-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: #111;
    border: 1px solid #333;
    border-radius: 5px;
    color: var(--text-color);
    font-family: var(--font-family);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: var(--dark-color);
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background: var(--primary-color);
    color: var(--light-color);
}

/* ============================================= */
/* FOOTER                                        */
/* ============================================= */
.footer {
    background: #0A0A0A;
    padding: 2rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    font-size: 1.5rem;
    color: var(--light-color);
    transition: color 0.3s;
}

.social-link:hover {
    color: var(--secondary-color);
}

/* ============================================= */
/* BOTÓN FLOTANTE WHATSAPP                       */
/* ============================================= */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25D366;
    color: #FFF;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    z-index: 100;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

/* ============================================= */
/* RESPONSIVIDAD (Media Queries)                 */
/* ============================================= */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    /* hero-text ahora es hero-text-slide h1 y p */
    .hero-text-slide h1 {
        font-size: 2.5rem;
    }

    .hero-text-slide p {
        font-size: 1.2rem;
    }
    
    /* ... (resto de los media queries sin cambios) ... */
}
/* ============================================= */
/* RESPONSIVIDAD (Media Queries)                 */
/* ============================================= */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-text p {
        font-size: 1.2rem;
    }
    
    /* Menú de Hamburguesa Móvil */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Empieza fuera de la pantalla */
        width: 70%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }
    
    #nav-toggle:checked ~ .nav-menu {
        right: 0; /* Aparece en pantalla */
    }

    .nav-toggle-label {
        display: block;
        z-index: 501; /* Debe estar sobre la barra de nav */
    }

    /* Efecto "cool" de la hamburguesa a 'X' */
    #nav-toggle:checked + .nav-toggle-label .hamburger {
        background-color: transparent; /* La línea del medio desaparece */
    }

    #nav-toggle:checked + .nav-toggle-label .hamburger::before {
        transform: rotate(135deg);
        top: 0;
    }

    #nav-toggle:checked + .nav-toggle-label .hamburger::after {
        transform: rotate(-135deg);
        bottom: 0;
    }

    .form-group {
        flex-direction: column;
    }
}
/* ============================================= */
/* HEADER Y NAVEGACIÓN                           */
/* ============================================= */
.header {
    background-color: var(--dark-color);
    width: 100%;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

.nav-logo {
    color: var(--light-color);
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center; /* Alinea verticalmente los items */
    gap: 1.5rem;
}

.nav-link {
    color: var(--light-color);
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--secondary-color);
}

/* NUEVO: Estilos para el botón de Iniciar Sesión */
.nav-item-cta a {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.nav-item-cta a:hover {
    background-color: var(--secondary-color);
    color: var(--dark-color);
}


/* Menú de Hamburguesa */
#nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    background-color: var(--light-color);
    position: relative;
    width: 30px;
    height: 3px;
    border-radius: 3px;
    transition: all 0.4s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
}

.hamburger::before {
    top: -10px;
}

.hamburger::after {
    bottom: -10px;
}

/* NUEVO: Estilo para el overlay del menú */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 498; /* Justo debajo del menú */
}

/* ... (Resto del CSS sin cambios hasta la sección de responsividad) ... */


/* ============================================= */
/* RESPONSIVIDAD (Media Queries)                 */
/* ============================================= */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-text p {
        font-size: 1.2rem;
    }
    
    /* Menú de Hamburguesa Móvil */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Empieza fuera de la pantalla */
        width: 70%;
        max-width: 320px;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem; /* Aumenta el espacio en móvil */
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 499; /* Justo debajo de la navbar y el toggle */
    }
    
    #nav-toggle:checked ~ .nav-menu {
        right: 0; /* Aparece en pantalla */
    }

    /* NUEVO: Mostrar el overlay cuando el menú está activo */
    #nav-toggle:checked ~ .menu-overlay {
        display: block;
    }

    .nav-toggle-label {
        display: block;
        z-index: 501; /* Debe estar sobre la barra de nav */
    }
    
    /* NUEVO: Hacer el botón de login más grande en móvil para mejor toque */
    .nav-item-cta a {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }


    /* Efecto "cool" de la hamburguesa a 'X' */
    #nav-toggle:checked + .nav-toggle-label .hamburger {
        background-color: transparent; /* La línea del medio desaparece */
    }

    #nav-toggle:checked + .nav-toggle-label .hamburger::before {
        transform: rotate(135deg);
        top: 0;
    }

    #nav-toggle:checked + .nav-toggle-label .hamburger::after {
        transform: rotate(-135deg);
        bottom: 0;
    }

    .form-group {
        flex-direction: column;
    }
}