/**
 * Mobile Menu Styles
 * Estilos para el menú hamburguesa y menú móvil
 */

/* ========================================
   BOTÓN HAMBURGUESA
======================================== */

.mobile-menu-toggle {
    display: none; /* Oculto por defecto en desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-menu-toggle:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #1e293b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animación del botón hamburguesa cuando está activo */
.mobile-menu-open .mobile-menu-toggle .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-open .mobile-menu-toggle .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-open .mobile-menu-toggle .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ========================================
   OVERLAY Y MENÚ MÓVIL
======================================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* ========================================
   BOTÓN CERRAR (X)
======================================== */

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10000;
    transition: transform 0.2s ease;
}

.mobile-menu-close:hover {
    transform: rotate(90deg);
}

.mobile-menu-close svg {
    width: 24px;
    height: 24px;
    stroke: #1e293b;
    stroke-width: 2;
}

/* ========================================
   NAVEGACIÓN MÓVIL
======================================== */

.mobile-navigation {
    padding: 80px 30px 30px;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-nav-menu li:last-child {
    border-bottom: none;
}

.mobile-nav-menu a {
    display: block;
    padding: 16px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a:focus {
    color: #2563eb;
    padding-left: 10px;
}

.mobile-nav-menu .current-menu-item > a,
.mobile-nav-menu .current_page_item > a {
    color: #2563eb;
    font-weight: 600;
}

/* ========================================
   CTA EN MENÚ MÓVIL
======================================== */

.mobile-menu-cta {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.mobile-menu-cta .header-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 16px;
}

/* ========================================
   UTILIDADES
======================================== */

/* Ocultar en desktop */
.desktop-only {
    display: inline-flex;
}

/* Prevenir scroll cuando el menú está abierto */
body.mobile-menu-open {
    overflow: hidden;
}

/* ========================================
   RESPONSIVE - MOSTRAR EN MÓVIL
======================================== */

@media (max-width: 1023px) {
    /* Mostrar botón hamburguesa */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Ocultar menú desktop */
    .main-navigation {
        display: none;
    }

    /* Ocultar CTA desktop */
    .desktop-only {
        display: none;
    }

    /* Ajustar header para móvil */
    .site-header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */

@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-menu-content {
        width: 60%;
        max-width: 350px;
    }

    .mobile-nav-menu a {
        font-size: 20px;
        padding: 18px 0;
    }
}

/* ========================================
   RESPONSIVE - DESKTOP
======================================== */

@media (min-width: 1024px) {
    /* Asegurar que el menú móvil esté oculto */
    .mobile-menu-overlay,
    .mobile-menu-toggle {
        display: none !important;
    }

    /* Mostrar navegación desktop */
    .main-navigation {
        display: block;
    }

    .desktop-only {
        display: inline-flex;
    }
}

/* ========================================
   ANIMACIONES
======================================== */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   ACCESIBILIDAD
======================================== */

/* Focus visible para navegación por teclado */
.mobile-menu-toggle:focus-visible,
.mobile-menu-close:focus-visible,
.mobile-nav-menu a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu-content,
    .hamburger-line,
    .mobile-nav-menu a {
        transition: none;
    }
}

