/**
 * HERO.CSS - Solución Definitiva para Hero Section
 * Laura Cuencio - Mindfulness & Bienestar
 * Corrige: superposiciones, transparencias, responsive, contraste
 */

/* ========================================
   HERO SECTION - CONFIGURACIÓN BASE
======================================== */

/* Reset completo para hero */
.hero-slider,
.hero-carousel,
.carousel,
.carousel-item,
.hero-slide {
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
}

/* ========================================
   HERO CONTAINER PRINCIPAL
======================================== */

.hero-slider {
    width: 100% !important;
    height: 100vh !important;
    min-height: 600px !important;
    max-height: 900px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Hero default y single específicos */
.hero-slider.hero-default,
.hero-slider.hero-single {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
}

/* ========================================
   CAROUSEL ESPECÍFICO
======================================== */

.hero-carousel {
    width: 100% !important;
    height: 100vh !important;
    min-height: 600px !important;
    max-height: 900px !important;
    position: relative !important;
    z-index: 1 !important;
}

.hero-carousel .carousel-inner {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

.hero-carousel .carousel-item,
.hero-slide {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    position: relative !important;
}

/* Asegurar que solo el slide activo sea visible */
.carousel-item:not(.active) {
    display: none !important;
}

.carousel-item.active {
    display: flex !important;
}

/* ========================================
   OVERLAY MEJORADO Y PROFESIONAL
======================================== */

.hero-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(
        135deg,
        rgba(74, 93, 66, 0.65) 0%,
        rgba(123, 132, 113, 0.45) 50%,
        rgba(212, 185, 150, 0.35) 100%
    ) !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

/* Overlay para diferentes tipos de hero */
.hero-slider.hero-default .hero-overlay,
.hero-slider.hero-single .hero-overlay {
    background: linear-gradient(
        135deg,
        rgba(74, 93, 66, 0.7) 0%,
        rgba(123, 132, 113, 0.5) 50%,
        rgba(212, 185, 150, 0.4) 100%
    ) !important;
}

/* ========================================
   CONTENIDO DEL HERO - SIN SUPERPOSICIONES
======================================== */

.hero-content {
    position: relative !important;
    z-index: 10 !important;
    text-align: center !important;
    color: white !important;
    max-width: 85% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2rem 1rem !important;
    pointer-events: auto !important;
    background: none !important;
    backdrop-filter: none !important;
}

/* ========================================
   TÍTULOS CON CONTRASTE PERFECTO
======================================== */

.hero-content .hero-title,
.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem) !important;
    font-weight: 300 !important;
    line-height: 1.1 !important;
    margin-bottom: 1.5rem !important;
    color: #FFFFFF !important;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 4px 8px rgba(74, 93, 66, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.3) !important;
    font-family: 'Playfair Display', Georgia, serif !important;
    letter-spacing: -0.02em !important;
    position: relative !important;
    z-index: 11 !important;
    display: block !important;
}

/* Accent text en títulos */
.hero-content .hero-title .text-accent,
.hero-content h1 .text-accent {
    color: #F4E4BC !important; /* Dorado más claro para mejor contraste */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.7),
        0 4px 8px rgba(212, 185, 150, 0.5) !important;
}

/* ========================================
   SUBTÍTULOS LEGIBLES
======================================== */

.hero-content .hero-subtitle,
.hero-content p {
    font-size: clamp(1.1rem, 2.8vw, 1.4rem) !important;
    font-weight: 300 !important;
    line-height: 1.6 !important;
    margin-bottom: 2.5rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.5),
        0 2px 6px rgba(74, 93, 66, 0.3) !important;
    max-width: 650px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    position: relative !important;
    z-index: 11 !important;
    display: block !important;
}

/* ========================================
   BOTONES DEL HERO MEJORADOS
======================================== */

.hero-content .hero-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
    z-index: 11 !important;
    margin-top: 2rem !important;
}

.hero-content .btn {
    min-width: 180px !important;
    padding: 0.875rem 2rem !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    border-radius: 50px !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 8px 25px rgba(74, 93, 66, 0.2) !important;
    position: relative !important;
    z-index: 12 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    border: 2px solid transparent !important;
}

/* Botón primario en hero */
.hero-content .btn-primary {
    background: linear-gradient(135deg, #7B8471 0%, #6B8E5A 100%) !important;
    color: #FFFFFF !important;
    border-color: #7B8471 !important;
}

.hero-content .btn-primary:hover {
    background: linear-gradient(135deg, #6B8E5A 0%, #4A5D42 100%) !important;
    color: #FFFFFF !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 12px 35px rgba(74, 93, 66, 0.3) !important;
}

/* Botón outline en hero */
.hero-content .btn-outline-light {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.hero-content .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 
        0 8px 25px rgba(255, 255, 255, 0.3),
        0 12px 35px rgba(255, 255, 255, 0.15) !important;
}

/* ========================================
   CONTROLES DEL CAROUSEL MEJORADOS
======================================== */

.carousel-control-prev,
.carousel-control-next {
    width: 5% !important;
    opacity: 0.8 !important;
    z-index: 15 !important;
    transition: opacity 0.3s ease !important;
    background: none !important;
    border: none !important;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1 !important;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 35px !important;
    height: 35px !important;
    background-size: 100% !important;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)) !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    backdrop-filter: blur(10px) !important;
}

/* ========================================
   INDICADORES ELEGANTES
======================================== */

.carousel-indicators {
    margin-bottom: 2.5rem !important;
    z-index: 15 !important;
    gap: 0.5rem !important;
}

.carousel-indicators button {
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
    margin: 0 !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
    border: 2px solid transparent !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    opacity: 1 !important;
}

.carousel-indicators button.active {
    background-color: #F4E4BC !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.4) !important;
    box-shadow: 
        0 0 15px rgba(244, 228, 188, 0.6),
        0 0 25px rgba(244, 228, 188, 0.3) !important;
}

.carousel-indicators button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.7) !important;
    transform: scale(1.2) !important;
}

/* ========================================
   RESPONSIVE BREAKPOINTS HERO
======================================== */

/* Mobile First - Extra Small devices */
@media (max-width: 575.98px) {
    .hero-slider,
    .hero-carousel {
        height: 75vh !important;
        min-height: 500px !important;
        max-height: 700px !important;
    }
    
    .hero-content {
        padding: 1.5rem 1rem !important;
        max-width: 95% !important;
    }
    
    .hero-content .hero-title,
    .hero-content h1 {
        font-size: 2.2rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.1 !important;
    }
    
    .hero-content .hero-subtitle,
    .hero-content p {
        font-size: 1.05rem !important;
        margin-bottom: 2rem !important;
        line-height: 1.5 !important;
    }
    
    .hero-content .hero-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
    }
    
    .hero-content .btn {
        width: 100% !important;
        max-width: 280px !important;
        min-width: auto !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 8% !important;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 28px !important;
        height: 28px !important;
    }
    
    .carousel-indicators {
        margin-bottom: 1.5rem !important;
    }
    
    .carousel-indicators button {
        width: 10px !important;
        height: 10px !important;
    }
}

/* Small devices */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-slider,
    .hero-carousel {
        height: 80vh !important;
        min-height: 550px !important;
        max-height: 750px !important;
    }
    
    .hero-content .hero-title,
    .hero-content h1 {
        font-size: 2.8rem !important;
    }
    
    .hero-content .hero-subtitle,
    .hero-content p {
        font-size: 1.15rem !important;
    }
    
    .hero-content .hero-actions {
        flex-direction: row !important;
        gap: 1rem !important;
    }
    
    .hero-content .btn {
        width: auto !important;
        min-width: 160px !important;
    }
}

/* Medium devices */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-slider,
    .hero-carousel {
        height: 85vh !important;
        min-height: 600px !important;
        max-height: 800px !important;
    }
    
    .hero-content {
        max-width: 80% !important;
    }
    
    .hero-content .hero-title,
    .hero-content h1 {
        font-size: 3.2rem !important;
    }
    
    .hero-content .hero-subtitle,
    .hero-content p {
        font-size: 1.25rem !important;
    }
}

/* Large devices */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-slider,
    .hero-carousel {
        height: 90vh !important;
        min-height: 650px !important;
        max-height: 850px !important;
    }
    
    .hero-content {
        max-width: 75% !important;
    }
    
    .hero-content .hero-title,
    .hero-content h1 {
        font-size: 3.8rem !important;
    }
    
    .hero-content .hero-subtitle,
    .hero-content p {
        font-size: 1.3rem !important;
    }
}

/* Extra large devices */
@media (min-width: 1200px) {
    .hero-slider,
    .hero-carousel {
        height: 100vh !important;
        min-height: 700px !important;
        max-height: 900px !important;
    }
    
    .hero-content {
        max-width: 70% !important;
    }
    
    .hero-content .hero-title,
    .hero-content h1 {
        font-size: 4.5rem !important;
    }
    
    .hero-content .hero-subtitle,
    .hero-content p {
        font-size: 1.4rem !important;
    }
    
    .hero-content .btn {
        min-width: 200px !important;
        padding: 1rem 2.5rem !important;
        font-size: 1.1rem !important;
    }
}

/* Ultra wide devices */
@media (min-width: 1400px) {
    .hero-content {
        max-width: 65% !important;
    }
    
    .hero-content .hero-title,
    .hero-content h1 {
        font-size: 5rem !important;
    }
}

/* ========================================
   FIXES ESPECÍFICOS Y PERFORMANCE
======================================== */

/* Asegurar que las imágenes de fondo se carguen correctamente */
.hero-slider[style*="background-image"],
.carousel-item[style*="background-image"],
.hero-slide[style*="background-image"] {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
}

/* Prevenir superposiciones con navbar */
.hero-slider,
.hero-carousel {
    margin-top: 0 !important;
    top: 0 !important;
}

/* Optimización de performance */
.hero-slider,
.hero-carousel,
.carousel-item,
.hero-slide {
    will-change: transform !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
}

/* Fallback para navegadores que no soporten backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .hero-content .btn-outline-light {
        background: rgba(255, 255, 255, 0.25) !important;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        background-color: rgba(255, 255, 255, 0.3) !important;
    }
}

/* Asegurar que el contenido sea siempre visible */
.hero-content * {
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix para imágenes que no cargan */
.hero-slider:not([style*="background-image"]),
.carousel-item:not([style*="background-image"]),
.hero-slide:not([style*="background-image"]) {
    background: linear-gradient(135deg, #7B8471 0%, #4A5D42 100%) !important;
}

/* Evitar que elementos se muevan durante las transiciones */
.hero-content .hero-title,
.hero-content .hero-subtitle,
.hero-content .hero-actions {
    transform: translateZ(0) !important;
}

/* ========================================
   MEJORAS DE ACCESIBILIDAD
======================================== */

/* Focus states para controles del carousel */
.carousel-control-prev:focus,
.carousel-control-next:focus {
    outline: 2px solid #F4E4BC !important;
    outline-offset: 2px !important;
}

.carousel-indicators button:focus {
    outline: 2px solid #F4E4BC !important;
    outline-offset: 2px !important;
}

/* Reducir motion para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    .hero-content .btn,
    .carousel-control-prev-icon,
    .carousel-control-next-icon,
    .carousel-indicators button {
        transition: none !important;
    }
    
    .hero-content .btn:hover {
        transform: none !important;
    }
    
    .carousel-indicators button.active {
        transform: scale(1.2) !important;
    }
}

/* ========================================
   CLEANUP Y OVERRIDES FINALES
======================================== */

/* Asegurar que no haya elementos duplicados */
.hero-content > .hero-title + .hero-title,
.hero-content > h1 + h1,
.hero-content > .hero-subtitle + .hero-subtitle,
.hero-content > p + p:not([class]) {
    display: none !important;
}

/* Limpiar estilos conflictivos */
.hero-slider .container,
.hero-carousel .container {
    position: relative !important;
    z-index: 10 !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100% !important;
}

/* Asegurar orden correcto de elementos */
.hero-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
}

.hero-content .hero-title {
    order: 1 !important;
}

.hero-content .hero-subtitle {
    order: 2 !important;
}

.hero-content .hero-actions {
    order: 3 !important;
}

/* ========================================
   DARK MODE SUPPORT (FUTURO)
======================================== */

@media (prefers-color-scheme: dark) {
    .hero-overlay {
        background: linear-gradient(
            135deg,
            rgba(47, 62, 70, 0.75) 0%,
            rgba(74, 93, 66, 0.55) 50%,
            rgba(123, 132, 113, 0.45) 100%
        ) !important;
    }
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
    .hero-slider,
    .hero-carousel {
        height: auto !important;
        min-height: 300px !important;
        max-height: 400px !important;
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    
    .hero-overlay {
        display: none !important;
    }
    
    .hero-content {
        color: #333 !important;
        text-shadow: none !important;
    }
    
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators {
        display: none !important;
    }
}