/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
    --bg-dark: #0a0a0a;
    --primary-red: #e50914;
    --bright-red: #ff1e27;
    --text-white: #ffffff;
    --text-gray: #b3b3b3;
    --green-wa: #00e676;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow: hidden; /* Evita scrolls residuales en pantallas de escritorio */
}

/* ==========================================================================
   CONTENEDOR MAESTRO (100% ANCHO/ALTO Y ZONA DE CLIC PRINCIPAL)
   ========================================================================== */
.main-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    max-height: 120vh; 
    min-height: 650px;  
    padding: 10px 6%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out; 
    
    /* TODO el fondo de la pantalla ahora invita visualmente a hacer clic */
    cursor: pointer; 
}

/* ==========================================================================
   PROTECCIÓN DE CURSORES (Evita que los textos hereden el puntero de la galería)
   ========================================================================== */
.hero-text, 
.navbar, 
.benefits-side, 
.services-section, 
.footer-bar,
.mouse-indicator {
    cursor: default;
}

/* Forzamos el puntero de acción en elementos interactivos reales */
.nav-links a, 
.btn, 
.card, 
.menu-toggle,
.close-gallery,
.wa-icon-circle {
    cursor: pointer;
}

/* ==========================================================================
   NAVBAR & EFECTO HOVER DE PESTAÑA GLOW
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    height: 60px;
    position: relative;
    z-index: 20;
}

.logo {
    line-height: 1;
}
.logo-white { font-size: 1.3rem; font-weight: 800; letter-spacing: 1px; }
.logo-red { font-size: 1.3rem; font-weight: 800; color: var(--primary-red); }
.tagline { display: block; font-size: 0.55rem; color: var(--text-gray); letter-spacing: 2px; }

.nav-links { 
    display: flex; 
    list-style: none; 
    height: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    position: relative;
    height: 60px; 
    padding: 0 15px;
}

.nav-links a { 
    color: var(--text-gray); 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Línea roja oculta bajo cada ítem del menú */
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--bright-red);
    box-shadow: 0 0 12px var(--bright-red), 0 0 4px var(--bright-red);
    transition: width 0.3s ease;
}

/* Hover y Estados Activos del Menú */
.nav-item:hover a, 
.nav-item a.active { 
    color: var(--text-white); 
}

.nav-item:hover::after,
.nav-item:has(a.active)::after {
    width: 70%; 
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 8px 18px; 
    border-radius: 25px; 
    text-decoration: none; 
    font-size: 0.8rem; 
    font-weight: 600; 
    transition: all 0.3s ease;
}

.btn-whatsapp-nav { 
    background-color: var(--primary-red); 
    color: white; 
    gap: 8px; 
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4); 
}
.btn-whatsapp-nav:hover {
    background-color: var(--bright-red);
    box-shadow: 0 0 20px rgba(255, 30, 39, 0.6);
}

.btn-outline { 
    border: 2px solid white; 
    color: white; 
    background: transparent; 
    gap: 8px; 
}
.btn-outline:hover { 
    background: white; 
    color: black; 
}

.btn-danger { 
    background: linear-gradient(135deg, var(--bright-red), var(--primary-red)); 
    color: white; 
    gap: 10px; 
    padding: 10px 22px; 
    border-radius: 30px; 
    box-shadow: 0 4px 20px rgba(255, 30, 39, 0.4); 
}
.btn-danger small { 
    display: block; 
    font-size: 0.6rem; 
    font-weight: 400; 
}

/* ==========================================================================
   HERO CONTAINER (ZONA TEXTOS DINÁMICOS)
   ========================================================================== */
.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    position: relative;
    z-index: 10;
}

.hero-text { 
    max-width: 65%; 
}
.sub-title { 
    color: var(--primary-red); 
    font-size: 0.75rem; 
    letter-spacing: 3px; 
    font-weight: 700; 
}
.hero-text h1 { 
    font-size: 2.2rem; 
    font-weight: 900; 
    margin: 8px 0; 
    line-height: 1.1; 
}
.highlight-red { 
    color: #ff2a2a; 
    text-shadow: 0 0 15px rgba(255, 42, 42, 0.3); 
}
.hero-text p { 
    color: var(--text-gray); 
    font-size: 0.9rem; 
    margin-bottom: 15px; 
}

/* Transición suave para el cambio de textos gestionado por JS */
#hero-subtitle, #hero-title, #hero-description {
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
}

.hero-actions { 
    display: flex; 
    gap: 15px; 
}

/* BENEFICIOS LATERALES FLOTANTES */
.benefits-side { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    background: rgba(0, 0, 0, 0.6); 
    padding: 15px; 
    border-radius: 10px; 
    border: 1px solid rgba(255,255,255,0.1); 
    backdrop-filter: blur(5px); 
}
.benefit-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.benefit-item i { 
    color: var(--primary-red); 
    font-size: 1.1rem; 
}
.benefit-item h4 { 
    font-size: 0.8rem; 
}
.benefit-item p { 
    font-size: 0.7rem; 
    color: var(--text-gray); 
}

.mouse-indicator { 
    text-align: center; 
    font-size: 0.7rem; 
    color: var(--text-gray); 
    margin-bottom: 5px; 
}

/* ==========================================================================
   SECCIÓN DE TARJETAS (ZONA INFERIOR)
   ========================================================================== */
.services-section {
    flex-grow: 1; 
    display: flex;
    align-items: center;
    padding-bottom: 10px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
    height: 100%; 
    max-height: 380px; 
}

.card {
    position: relative;
    height: 100%; 
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 45%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

.card.active, .card:hover {
    border-color: var(--bright-red);
    box-shadow: 0 0 20px rgba(255, 30, 39, 0.4);
    transform: translateY(-4px);
}

.card-number { 
    position: absolute; 
    top: 12px; 
    left: 15px; 
    font-size: 0.75rem; 
    color: var(--primary-red); 
    z-index: 2; 
    font-weight: bold; 
}
.card-content { 
    position: relative; 
    z-index: 2; 
}
.card-icon { 
    width: 35px; 
    height: 35px; 
    background: var(--primary-red); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 10px; 
    font-size: 1rem; 
}

.card h3 { 
    font-size: 0.85rem; 
    font-weight: 700; 
    margin-bottom: 5px; 
}
.card p { 
    font-size: 0.7rem; 
    color: var(--text-gray); 
    line-height: 1.3; 
    margin-bottom: 10px; 
}

.btn-card-wa { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 5px; 
    background: rgba(255,255,255,0.08); 
    border: 1px solid rgba(255,255,255,0.15); 
    color: white; 
    text-decoration: none; 
    font-size: 0.7rem; 
    font-weight: 600; 
    padding: 6px 0; 
    border-radius: 20px; 
    transition: background 0.3s;
}
.card.active .btn-card-wa, .card:hover .btn-card-wa { 
    background: var(--bright-red); 
    border-color: var(--bright-red); 
}

/* ==========================================================================
   FOOTER BAR
   ========================================================================== */
.footer-bar { 
    display: flex; 
    justify-content: center; 
    gap: 40px; 
    padding: 10px 0; 
    border-top: 1px solid rgba(255,255,255,0.05); 
}
.footer-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.75rem; 
    color: var(--text-gray); 
}
.footer-item i { 
    color: var(--primary-red); 
}

/* ==========================================================================
   MODAL DE GALERÍA (PANTALLA COMPLETA INTERACTIVA)
   ========================================================================== */
.gallery-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 5, 0.98);
    z-index: 1000;
    display: none; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.gallery-overlay.open {
    display: flex;
}

.close-gallery {
    position: absolute;
    top: 20px; right: 40px;
    font-size: 3rem;
    color: white;
    transition: color 0.3s;
}
.close-gallery:hover { 
    color: var(--bright-red); 
}

#gallery-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: white;
    margin-bottom: 30px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 5px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.gallery-item {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.3s, border-color 0.3s;
}
.gallery-item:hover {
    transform: scale(1.03);
    border-color: var(--bright-red);
}

@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

/* ==========================================================================
   BOTÓN FLOTANTE SÚPER WHATSAPP
   ========================================================================== */
.whatsapp-floating { 
    position: fixed; 
    bottom: 15px; 
    right: 15px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: #004d26; 
    border: 1px solid var(--green-wa); 
    padding: 5px 12px; 
    border-radius: 30px; 
    z-index: 100; 
}
.wa-text { 
    text-align: left; 
    color: white; 
}
.wa-text small { 
    display: block; 
    font-size: 0.6rem; 
    opacity: 0.8; 
}
.wa-text strong { 
    font-size: 0.75rem; 
}
.wa-icon-circle { 
    width: 30px; 
    height: 30px; 
    background: var(--green-wa); 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1rem; 
    text-decoration: none; 
}

/* ==========================================================================
   BOTÓN HAMBURGUESA (MÓVIL)
   ========================================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    z-index: 100;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-white);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: var(--bright-red);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: var(--bright-red);
}

/* ==========================================================================
   RESPONSIVE COMPLETO (Móviles y Tablets)
   ========================================================================== */
@media (max-width: 900px) {
    body { 
        overflow-y: auto; 
    }
    .main-wrapper { 
        height: auto; 
        max-height: none; 
        padding: 20px 4%; 
    }

    .menu-toggle {
        display: flex;
    }

    /* Menú cortina fullscreen */
    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease, transform 0.4s ease;
        transform: translateY(-20px);
    }

    .nav-menu-wrapper.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links { 
        flex-direction: column;
        align-items: center;
        height: auto;
        gap: 15px;
    }
    
    .nav-item {
        height: auto;
        padding: 10px 0;
    }

    .nav-links a {
        font-size: 1.3rem;
        font-weight: 600;
    }

    .nav-item::after {
        bottom: -5px;
    }

    .btn-whatsapp-nav {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    /* Layout general móvil */
    .cards-container { 
        grid-template-columns: 1fr; 
        height: auto; 
        max-height: none; 
    }
    .card { 
        height: 280px; 
    }
    .hero-container { 
        flex-direction: column; 
        text-align: center; 
        gap: 25px; 
        margin: 40px 0;
    }
    .hero-text { 
        max-width: 100%; 
    }
    .hero-actions { 
        justify-content: center; 
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .benefits-side {
        width: 100%;
    }
    .gallery-grid { 
        grid-template-columns: 1fr; 
    }
}