/* ==================================
   MOBILE MENU FIX - VERDADERAMENTE RESPONSIVO
   CENTRADO CON AIRE SUPERIOR E INFERIOR
   + BOTÓN X PARA CERRAR
   BREAKPOINT: 880px
   ================================== */

@media (max-width: 880px) {
    .mobile-menu {
        padding: 0;
        height: 100vh;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        background: #000000;
    }
    
    /* BOTÓN X PARA CERRAR */
    .mobile-menu-close {
        position: absolute;
        top: 2rem;
        right: 2rem;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.3s ease;
        z-index: 10;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.3);
        color: #ffffff;
        transform: scale(1.05);
    }
    
    .mobile-menu-close:active {
        transform: scale(0.95);
    }
    
    .mobile-menu-close svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-menu-list {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        max-height: 70vh;
        padding: 0 5vw;
        gap: 0;
        box-sizing: border-box;
    }
    
    /* Items distribuidos equitativamente con MUCHO más espacio */
    .mobile-menu-item {
        margin: 0;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-height: 8vh;
        min-height: 6vh;
    }
    
    /* Fuente responsiva basada en viewport */
    .mobile-menu-item a {
        font-size: clamp(18px, 3vh, 32px);
        padding: clamp(4px, 0.6vh, 10px) clamp(16px, 5vw, 32px);
        font-weight: 600;
        white-space: nowrap;
        line-height: 1.2;
    }
    
    /* CTA también responsivo */
    .mobile-menu-item a.cta {
        font-size: clamp(16px, 2.6vh, 24px);
        padding: clamp(6px, 1vh, 14px) clamp(20px, 6vw, 36px);
        margin-top: 0;
    }
}

/* Ajuste para pantallas muy pequeñas */
@media (max-width: 380px) and (max-height: 680px) {
    .mobile-menu-close {
        top: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    .mobile-menu-close svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-menu-list {
        max-height: 65vh;
        padding: 0 4vw;
    }
    
    .mobile-menu-item {
        max-height: 7.5vh;
        min-height: 5.5vh;
    }
    
    .mobile-menu-item a {
        font-size: clamp(16px, 2.8vh, 28px);
    }
    
    .mobile-menu-item a.cta {
        font-size: clamp(15px, 2.4vh, 22px);
    }
}

/* Para iPhone XR y similares (414 x 896) */
@media (min-width: 400px) and (max-width: 450px) and (min-height: 850px) {
    .mobile-menu-list {
        max-height: 68vh;
    }
    
    .mobile-menu-item {
        max-height: 7.8vh;
    }
}

/* Para Galaxy S8+ y pantallas estrechas altas (360 x 740) */
@media (max-width: 380px) and (min-height: 700px) and (max-height: 780px) {
    .mobile-menu-list {
        max-height: 66vh;
    }
    
    .mobile-menu-item {
        max-height: 7.6vh;
        min-height: 5.8vh;
    }
}

/* Para pantallas landscape o muy anchas en mobile */
@media (max-width: 900px) and (max-height: 500px) {
    .mobile-menu-close {
        top: 1rem;
        right: 1rem;
    }
    
    .mobile-menu-list {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: 80vh;
        padding: 0 3vw;
    }
    
    .mobile-menu-item {
        flex: 0 0 50%;
        max-height: 16vh;
    }
}
