/* ============================================================================
   HERO CARRUSEL
   ============================================================================ */

.hero-carousel {
    position: relative;
    /* ✅ AJUSTE CLAVE: viewport menos altura del header */
    height: calc(100vh);
    /* ✅ Eliminar restricciones de altura */
    min-height: auto;
    max-height: none;
    overflow: hidden;
    background: var(--primary-green);
    /* ✅ Sin margen ni padding que cree gap */
    margin: 0;
    padding: 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Imagen de fondo */
.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.1);
    transition: transform 6s ease-out;
}

.carousel-slide.active .slide-bg {
    transform: scale(1);
}

/* Overlay oscuro */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Contenido del slide */
.carousel-slide .container {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide .hero-content {
    text-align: center;
    max-width: 800px;
    color: white;
    padding: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out 0.3s, transform 0.6s ease-out 0.3s;
}

.carousel-slide.active .hero-content {
    opacity: 1;
    transform: translateY(0);
}

.carousel-slide h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.carousel-slide p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Botones de navegación */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 2rem;
}

.carousel-next {
    right: 2rem;
}

/* Indicadores (dots) */
.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.carousel-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.carousel-dots .dot:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.carousel-dots .dot.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: scale(1.2);
}

/* CTA Button en carrusel */
.carousel-slide .cta-button {
    display: inline-block;
    background: var(--accent-green);
    color: white;
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
}

.carousel-slide .cta-button:hover {
    background: var(--light-green);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.carousel-slide .cta-button i {
    margin-right: 0.5rem;
}

/* ============================================================================
   HERO CARRUSEL - RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .hero-carousel {
        /* ✅ Ajustar en móvil si el header cambia de tamaño */
        height: calc(100vh - 60px);
    }

    .carousel-slide h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .carousel-slide p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.5;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .carousel-prev {
        left: 1rem;
    }

    .carousel-next {
        right: 1rem;
    }

    .carousel-dots {
        bottom: 1.5rem;
        gap: 0.5rem;
    }

    .carousel-dots .dot {
        width: 10px;
        height: 10px;
    }

    .carousel-slide .cta-button {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

    .carousel-slide .hero-content {
        padding: 1.5rem 4rem;
    }
}

@media (max-width: 480px) {
    .hero-carousel {
        height: calc(100vh - 55px);
    }

    .carousel-slide h1 {
        font-size: 1.8rem;
    }

    .carousel-slide p {
        font-size: 0.9rem;
        max-width: 240px;
        margin-bottom: 1.25rem;
    }

    .carousel-slide .hero-content {
        padding: 1.5rem 3.5rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-prev {
        left: 0.75rem;
    }

    .carousel-next {
        right: 0.75rem;
    }
}

@media (max-width: 360px) {
    .hero-carousel {
        height: calc(100vh - 50px);
    }

    .carousel-slide h1 {
        font-size: 1.6rem;
    }

    .carousel-slide p {
        max-width: 200px;
        font-size: 0.85rem;
    }

    .carousel-slide .hero-content {
        padding: 1rem 3rem;
    }
}

/* Pausar animación al hacer hover */
.hero-carousel:hover .slide-bg {
    animation-play-state: paused;
}



/* ============================================================================
   ESTILOS ADICIONALES PARA VIDEO EN HERO
   Agregar estos estilos a tu styles_hero.css existente
   ============================================================================ */

/* ============================================================================
   VIDEO BACKGROUND
   ============================================================================ */

.hero-video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
    z-index: 0;
}

/* Asegurar que el video cubra todo el contenedor */
.slide-bg.video-bg {
    background: none !important;
    overflow: hidden;
}

/* Mantener comportamiento de imagen para slides con imagen */
.slide-bg.image-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay más oscuro cuando hay video para mejorar legibilidad */
.carousel-slide:has(.hero-video-background) .slide-overlay {
    background: rgba(0, 0, 0, 0.55);
}

/* ============================================================================
   RESPONSIVE - VIDEO
   ============================================================================ */

@media (max-width: 768px) {
    .hero-video-background {
        /* En móvil, algunos navegadores tienen restricciones de autoplay */
        pointer-events: none;
    }
}

/* ============================================================================
   PERFORMANCE - REDUCIR ANIMACIÓN EN VIDEO BACKGROUNDS
   ============================================================================ */

/* Desactivar la animación de zoom cuando hay video */
.carousel-slide:has(.hero-video-background) .slide-bg {
    transform: scale(1) !important;
    transition: none !important;
}

/* ============================================================================
   FALLBACK - SI EL VIDEO NO CARGA
   ============================================================================ */

.hero-video-background::-webkit-media-controls {
    display: none !important;
}

.hero-video-background::-webkit-media-controls-enclosure {
    display: none !important;
}

/* ============================================================================
   INDICADOR DE CARGA PARA VIDEO
   ============================================================================ */

.slide-bg.video-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-green);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.slide-bg.video-bg:not(:has(video[readyState="4"]))::before {
    opacity: 0.3;
}