/**
 * Estilos para Menú Mobile Responsive
 * Tema: Jaton Mallorca
 */

/* ============================================
   BOTÓN HAMBURGUESA
   ============================================ */

.mobile-menu-toggle {
    display: none; /* Oculto por defecto en desktop */
    position: relative;
    z-index: 1001;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 50px;
    height: 50px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 129, 180, 0.1);
    border-radius: 5px;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #0081B4;
    outline-offset: 2px;
}

/* Líneas del hamburguesa */
.hamburger-line {
    display: block;
    width: 30px;
    height: 3px;
    background-color: #333;
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Animación a X cuando está activo */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* ============================================
   NAVEGACIÓN RESPONSIVE
   ============================================ */

/* Tablets y móviles */
@media screen and (max-width: 768px) {
    
    .mobile-menu-toggle {
        display: flex; /* Mostrar botón en mobile */
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    /* Contenedor de navegación */
    .nav {
        position: fixed;
        top: 0;
        right: -100%; /* Oculto fuera de la pantalla */
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 60px; /* Espacio para el botón de cerrar */
    }
    
    /* Menú abierto */
    .nav.menu-open {
        right: 0;
    }
    
    /* Overlay oscuro cuando el menú está abierto */
    .nav.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Lista del menú */
    .nav ul,
    .mobile-menu {
        display: flex !important;
        flex-direction: column;
        padding: 20px;
        margin: 0;
        list-style: none;
    }
    
    .nav ul li {
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .nav ul li:last-child {
        border-bottom: none;
    }
    
    .nav ul li a {
        display: block;
        padding: 15px 10px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        transition: all 0.2s ease;
        border-left: 3px solid transparent;
    }
    
    .nav ul li a:hover,
    .nav ul li a:focus {
        background: #f5f5f5;
        border-left-color: #0081B4;
        color: #0081B4;
        padding-left: 15px;
    }
    
    .nav ul li a:active {
        background: #e8f4f8;
    }
    
    /* Submenús (si existen) */
    .nav ul li ul {
        padding-left: 20px;
        background: #f9f9f9;
    }
    
    .nav ul li ul li a {
        font-size: 14px;
        padding: 12px 10px;
    }
}

/* ============================================
   TABLET HORIZONTAL (768px - 1024px)
   ============================================ */

@media screen and (min-width: 769px) and (max-width: 1024px) {
    
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav ul li {
        margin: 5px;
    }
    
    .nav ul li a {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* ============================================
   MÓVILES PEQUEÑOS (max-width: 480px)
   ============================================ */

@media screen and (max-width: 480px) {
    
    .nav {
        width: 90%;
        max-width: 280px;
    }
    
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
    }
    
    .hamburger-line {
        width: 25px;
        height: 2px;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    .nav ul li a {
        font-size: 15px;
        padding: 12px 10px;
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Soporte para modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
    .nav {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .nav ul li a {
        color: #ffffff;
    }
    
    .nav ul li {
        border-bottom-color: #333;
    }
    
    .hamburger-line {
        background-color: #ffffff;
    }
}

/* Para usuarios que prefieren reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    .nav,
    .mobile-menu-toggle,
    .hamburger-line,
    .nav ul li a {
        transition: none;
        animation: none;
    }
}

/* ============================================
   MEJORAS PARA TOUCH
   ============================================ */

/* Aumentar área de touch en móvil */
@media (hover: none) and (pointer: coarse) {
    .nav ul li a {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
        display: flex;
        align-items: center;
    }
    
    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

/* Prevenir scroll cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
}

/* Asegurar que el menú esté sobre otros elementos */
.nav,
.mobile-menu-toggle {
    z-index: 1000;
}

.nav.menu-open {
    z-index: 1001;
}



