/* Hover solo en escritorio */
@media (min-width: 769px) {
    .header nav ul li:hover > ul {
        display: flex;
    }
    .header nav ul li.submenu > ul li.submenu:hover > ul {
        display: flex;
    }
}

@media screen and (max-width: 768px) {
    * {
        box-sizing: border-box;
    }

    /* -------------------------------------- */
    /* Estilos del Header para Móviles */
    /* -------------------------------------- */

    .header-content {
        padding: 15px 20px;
    }
    .menu-toggle {
        display: block;
    }
    .header nav {
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    }
    .header nav ul {
        flex-direction: column;
        gap: 0;
    }
    .header nav ul li {
        width: 100%;
    }
    .header nav ul li a {
        padding: 12px 20px;
        border-bottom: 1px solid #eee;
    }
    .header nav.active {
        max-height: 600px;
    }
    /* Submenús móviles */
    .header nav ul li ul {
        position: static;
        display: none;
        box-shadow: none;
        background: #f9f9f9;
        padding-left: 20px;
        min-width: unset;
    }
    .header nav ul li ul ul {
        padding-left: 20px;
    }
    .header nav ul li.submenu.submenu-open > ul {
        display: block;
    }

    /* CAMBIO 2 (Móvil): También se aplica el hover aquí si es táctil, o simplemente para consistencia visual */
    .header nav ul li ul li a:active {
        background-color: #fce4ec; 
        color: #e91e63;
    }

    /* -------------------------------------- */
    /* Estilos del Banner */
    /* -------------------------------------- */
    .banner {
        margin: 0;
    }

    /* === PARTE SUPERIOR (ESTADO FINAL FIJO EN MÓVIL) === */
    .banner-superior {
        height: 50vh;
    }

    .banner-superior .equipo {
        /* Cambio para mostrar la imagen completa */
        object-fit: contain; 
        background-color: #fff;
        width: 100%;
        height: 100%;
        /* APLICACIÓN DEL ESTADO FINAL (ACTIVO) */
        filter: brightness(45%); 
        transition: none; /* Eliminamos transición para estado fijo */
    }

    /* 🔹 Nueva capa oscura */
    .banner-superior .overlay {
        /* APLICACIÓN DEL ESTADO FINAL (ACTIVO) */
        background: rgba(50, 50, 50, 0.45); 
        transition: none; /* Eliminamos transición para estado fijo */
    }

    /* 🔹 Texto inicial detrás y gris */
    .banner-superior .titulo-banner {
        font-size: 8.5vw; /* Ajuste para móvil */
        /* APLICACIÓN DEL ESTADO FINAL (ACTIVO) */
        background: linear-gradient(90deg, #f10ea9, #fe00cf);
        -webkit-background-clip: text;
        color: transparent;
        text-shadow: 0px 0px 15px rgba(219, 184, 216, 0.7); 
        z-index: 3;
        transition: none; /* Eliminamos transición para estado fijo */
    }

    /* Desactivamos/ignoramos los estilos :hover de escritorio en móvil */
    .banner-superior:hover .equipo,
    .banner-superior:hover .overlay,
    .banner-superior:hover .titulo-banner {
        /* Se repite el estado final para anular cualquier potencial efecto hover residual */
        filter: brightness(45%);
        background: rgba(50, 50, 50, 0.45);
        color: transparent;
        text-shadow: 0px 0px 15px rgba(219, 184, 216, 0.7);
        z-index: 3;
        -webkit-background-clip: text;
    }
    
    /* === BOTÓN ANIMADO === */
    .boton-scroll {
        top: 42vh; 
        z-index: 10; 
    }

    .boton-scroll img {
        width: 45px; 
        height: 45px;
    }

    /* === PARTE INFERIOR (ESTRUCTURA MÓVIL Y EFECTO DE OCUPACIÓN) === */
    .banner-inferior {
        position: relative; 
        height: 50vh; 
        flex-direction: column; 
        text-align: center;
        padding: 1.5rem 10%; 
        justify-content: center;
        overflow: hidden; 
        margin: 0; /* Aseguramos que no haya margen negativo */
    }

    /* Contenedor del texto */
    .banner-inferior .texto {
        width: 100%; 
        order: 2; 
        /* Transiciones para el efecto de revelado */
        transition: opacity 1s ease, padding-top 1s ease; 
        position: relative; 
        z-index: 1; 
    }

    .banner-inferior h2 {
        font-size: 1.5rem; 
        margin-bottom: 0.5rem;
    }

    .banner-inferior p {
        font-size: 0.9rem; 
        line-height: 1.5;
        margin-bottom: 0; 
    }

    /* Contenedor de la imagen del chef (Absoluto para ocupar el espacio y ocultarse) */
    .banner-inferior .chef {
        position: absolute; 
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0; 
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden; 
        transition: opacity 5s ease;
        z-index: 2; 
    }

    .banner-inferior .chef img {
        width: 100%; 
        max-width: 300px; 
        height: auto;
        object-fit: contain;
    }

    /* ------------------------------------------------------------------ */
    /* === CLASES DE JS PARA ANIMACIÓN DE ESTADOS === */
    /* ------------------------------------------------------------------ */

    /* --- ESTADO ACTIVADO DEL BANNER SUPERIOR (Clase anulada por estilos fijos arriba) --- */
    .banner-superior.activo .equipo {
        filter: brightness(45%);
    }

    .banner-superior.activo .overlay {
        background: rgba(50, 50, 50, 0.45);
    }

    .banner-superior.activo .titulo-banner {
        background: linear-gradient(90deg, #f10ea9, #fe00cf);
        -webkit-background-clip: text;
        color: transparent;
        text-shadow: 0px 0px 25px rgba(219, 184, 216, 0.7);
        z-index: 3;
    }

    /* --- ESTADO INICIAL DEL BANNER INFERIOR (Fuera de vista) --- */
    .banner-inferior.inicial .chef {
        opacity: 1; /* Imagen visible */
        z-index: 2;
    }

    .banner-inferior.inicial .texto {
        opacity: 0; /* Texto oculto */
        z-index: 1;
        /* Simula que el texto está "empujado" o fuera de vista */
        padding-top: 20vh; 
    }

    /* --- ESTADO DE REVELADO DEL BANNER INFERIOR (Dentro de vista) --- */
    .banner-inferior.revelado .chef {
        opacity: 0; /* Imagen desaparece */
        z-index: 1;
    }

    .banner-inferior.revelado .texto {
        opacity: 1; /* Texto visible */
        z-index: 2;
        /* El texto ocupa el espacio completo */
        padding-top: 0; 
    }


    /* -------------------------------------- */
    /* Estilos de Beneficios */
    /* -------------------------------------- */
    .benefits-title {
        font-size: 1.9rem;
        margin-left: -20px auto 0;
        overflow-wrap: break-word; /* Evita que se salga del contenedor */
    }

    .benefits-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-top: 40px;
    }

    .benefit-card {
        width: 100%;
        max-width: 350px;
        min-height: 150px; 
        padding: 30px;
        transition: background-color 0.3s ease, min-height 0.5s ease;
        position: relative; /* Necesario para que el contenido se posicione bien */
    }
    
    /* El número y título se muestran juntos abajo en estado inactivo */
    .benefit-content {
        position: static;
        flex-direction: center;
        justify-content: center;
    }
    
    /* El contenedor de hover será el que se expande */
    .benefit-text-hover {
        position: static;
        height: 0;
        opacity: 0;
        visibility: hidden;
        padding: 0;
        /* Quitamos el alineado a la izquierda para centrar en móvil */
        align-items: center; 
        text-align: center;
        transition: all 0.5s ease;
        overflow: hidden;
    }

    .benefit-description {
        padding: 15px 0 0;
        color: var(--color-texto-oscuro); /* El texto es oscuro al expandirse */
    }

    /* Ocultamos el título pequeño inicialmente para que el número se vea mejor */
    .benefit-small-title {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    /* Número: posicionado estáticamente, no absoluto */
    .benefit-number {
        font-size: 6rem;
        position: static;
        transform: none;
        color: #FFFCFA; 
        margin-bottom: 0;
        line-height: 1;
    }

    /* -------------------------------------- */
    /* ESTADO ACTIVO (Scroll-Reveal en Móvil) */
    /* -------------------------------------- */
    .benefit-card.is-active-mobile {
        background-color: var(--color-verde-destacado);
        min-height: 380px; /* Altura para mostrar el contenido */
    }

    .benefit-card.is-active-mobile .benefit-number {
        color: var(--color-texto-oscuro);
    }

    .benefit-card.is-active-mobile .benefit-small-title {
        color: var(--color-texto-oscuro);  
    }
    
    .benefit-card.is-active-mobile .benefit-small-title {
        opacity: 1;
        visibility: visible;
        margin-top: 15px;
    }

    .benefit-card.is-active-mobile .benefit-text-hover {
        height: auto;
        opacity: 1;
        visibility: visible;
    }

    /* -------------------------------------- */
    /* Estilos de Cómo se ofrece */
    /* -------------------------------------- */
    .ofrece {
        height: auto;
        padding: 40px 20px;
        position: relative;
        overflow: hidden;
        min-height: 400px;
    }

    .ofrece-contenido {
        display: flex; /* We use flexbox to control the order of the elements */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 20px;
        position: relative;
        min-height: 400px;
    }

    /* Text container - We make it appear first */
    .ofrece-texto {
        max-width: 100%;
        text-align: center;
        order: 1; /* Assign a visual order to place it at the top */
    }

    /* Image container - We make it appear last */
    .ofrece-imagen {
        width: 100%;
        max-width: 400px;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 1s ease-out, transform 1s ease-out;
        order: 2; /* Assign a visual order to place it at the bottom */

        /* We use max-height to smoothly hide and show the image */
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
    }

    .ofrece-imagen img {
        width: 100%;
        height: auto;
        border: 5px solid #F682B1;
        border-radius: 12px;
        object-fit: cover;
    }

    /* Class to show the content when the animation is triggered */
    .ofrece.is-visible .ofrece-imagen {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
        margin-top: 20px;
    }
    
    /* We ensure that the image's container is also a flex item to use the 'order' property */
    .ofrece-contenido > div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }


    /* -------------------------------------- */
    /* Estilos del Formulario */
    /* -------------------------------------- */
    .contact-form-container {
        height: auto;
        width: auto;
        padding: 40px 20px;
    }

    /* Cambia a una columna vertical */
    .contact-form-wrapper {
        flex-direction: column;
        height: auto;
        padding: 0;
    }

    /* Ajusta el contenido del formulario para ocupar todo el ancho */
    .contact-form-content {
        width: 100%;
        padding: 0;
    }

    /* Oculta la imagen en móviles */
    .contact-form-image-box {
        display: none;
    }

    /* Ajusta el tamaño del título principal */
    .contact-form-title {
        font-size: 40px;
        margin-bottom: 15px;
    }

    /* Ajusta el subtítulo y el espacio */
    .contact-form-subtitle {
        font-size: 15px;
        margin-bottom: 30px;
    }

    /* Ajusta los estilos de los campos del formulario */
    .contact-form label {
        font-size: 15px;
    }

    /* Ajusta el padding y la separación de los campos */
    .contact-form .form-group {
        margin-bottom: 20px;
    }

    /* Ajusta la línea divisoria */
    .form-divider {
        margin: 30px 0;
    }

    /* -------------------------------------- */
    /* Estilos del footer completo */
    /* -------------------------------------- */
    .main-footer, .footer-top-bg, .footer-bottom-bg {
        padding: 0;
    }
    
    .footer-top {
        flex-direction: column;
        align-items: center;
        height: auto;
        padding: 40px 15px;
    }
    
    .footer-content-wrapper,
    .footer-logo-social,
    .footer-links-container,
    .footer-contact-info {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .footer-links-container {
        flex-direction: column;
        gap: 20px;
        margin: 30px 0;
    }
    
    .footer-logo-social {
        margin-bottom: 20px;
        margin: 50px auto 0;
    }
    
    .social-icons {
        justify-content: center;
        margin: 50px auto 0;
    }

    .footer-contact-info {
        padding: 20px;
        border-radius: 20px;
        width: 100%;
    }

    .footer-bottom {
        flex-direction: center;
        gap: 5px;
    }

    /*----------MODAL-------------*/
    /*----------------------------*/
    /*----------------------------*/
    .modal-content-custom {
        padding: 30px 20px; 
        max-width: 95%;
        margin: 20px; 
    }

    .modal-title-custom {
        font-size: 45px; /* Ligeramente más grande que en el ejemplo anterior, aprovechando el ancho extra hasta 768px */
    }
    
    .modal-check-mark {
        width: 80px;
        height: 80px;
        margin: 15px auto;
    }

    .modal-check-mark::after {
        font-size: 50px; /* Ajusta el tamaño del check */
    }

    .close-button-custom {
        font-size: 26px; 
        top: 10px;
        right: 15px;
    }
}