/* ========================================
   🌟 RESPONSIVE NAVIGATION IMPROVED - TAZDUCA
   Sistema de navegación responsivo mejorado con:
   - Diseño fluido y adaptativo
   - Transiciones suaves
   - Accesibilidad mejorada
   - Soporte para todos los dispositivos
======================================== */

/* ===== VARIABLES DE NAVEGACIÓN RESPONSIVA ===== */
:root {
    /* Breakpoints */
    --mobile: 480px;
    --tablet: 768px;
    --desktop: 1024px;
    --wide: 1280px;
    
    /* Alturas de navegación */
    --nav-height-desktop: 80px;
    --nav-height-tablet: 70px;
    --nav-height-mobile: 60px;
    
    /* Z-index sistema */
    --z-header: 1000;
    --z-nav: 1001;
    --z-mobile-menu: 1002;
    --z-mobile-overlay: 1003;
}

/* ===== ESTILOS BASE DE NAVEGACIÓN ===== */
.modern-header-premium {
    width: 100%;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-glass-container {
    width: 100%;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 20px;
    height: var(--nav-height-desktop);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: height 0.3s ease, padding 0.3s ease;
}

/* ===== LOGO RESPONSIVO ===== */
.logo-section {
    flex-shrink: 0;
    z-index: var(--z-nav);
}

.premium-logo {
    height: 50px;
    width: auto;
    transition: height 0.3s ease;
}

/* ===== NAVEGACIÓN DESKTOP ===== */
.premium-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(255, 0, 0, 0.1);
}

.premium-nav-link {
    padding: 0.75rem 1.5rem;
    margin: 0 0.25rem;
    color: #1E293B;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.premium-nav-link:hover {
    color: var(--primary-red);
    background: rgba(255, 0, 0, 0.05);
    transform: translateY(-2px);
}

.premium-nav-link.active {
    color: var(--primary-red);
    background: rgba(255, 0, 0, 0.1);
}

/* ===== BOTÓN HAMBURGUESA MEJORADO ===== */
.mobile-menu-section {
    display: none;
    z-index: var(--z-nav);
}

.premium-hamburger {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.premium-hamburger:hover {
    background: rgba(255, 0, 0, 0.05);
    border-color: var(--primary-red);
    transform: scale(1.05);
}

.hamburger-bar {
    width: 24px;
    height: 3px;
    background: var(--primary-red);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

/* Animación hamburguesa activa */
.premium-hamburger.active .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.premium-hamburger.active .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.premium-hamburger.active .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== MENÚ MÓVIL MEJORADO ===== */
.premium-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-mobile-menu);
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.premium-mobile-menu.active {
    visibility: visible;
}

.mobile-menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.premium-mobile-menu.active .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-content {
    position: absolute;
    right: -100%;
    top: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.premium-mobile-menu.active .mobile-menu-content {
    right: 0;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-logo {
    height: 40px;
    width: auto;
}

.mobile-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.05);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-close-btn:hover {
    background: rgba(255, 0, 0, 0.1);
    transform: rotate(90deg);
}

.mobile-close-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--primary-red);
    position: absolute;
}

.mobile-close-btn span:first-child {
    transform: rotate(45deg);
}

.mobile-close-btn span:last-child {
    transform: rotate(-45deg);
}

.mobile-navigation {
    flex: 1;
    padding: 20px;
}

.premium-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin: 5px 0;
    color: #1E293B;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.premium-mobile-link:hover {
    background: rgba(255, 0, 0, 0.05);
    color: var(--primary-red);
    transform: translateX(5px);
}

.mobile-link-arrow {
    color: var(--primary-red);
    transition: transform 0.3s ease;
}

.premium-mobile-link:hover .mobile-link-arrow {
    transform: translateX(5px);
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 0, 0, 0.02);
}

.contact-info p {
    margin: 10px 0;
    color: #64748B;
    font-size: 0.9rem;
}

/* ===== MEDIA QUERIES ===== */

/* Tablet */
@media (max-width: 1024px) {
    .header-glass-container {
        height: var(--nav-height-tablet);
        padding: 0 15px;
    }
    
    .premium-logo {
        height: 45px;
    }
    
    .nav-wrapper {
        gap: 0.5rem;
        padding: 0.4rem 0.8rem;
    }
    
    .premium-nav-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        margin: 0 0.1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-glass-container {
        height: var(--nav-height-mobile);
        padding: 0 15px;
    }
    
    .premium-logo {
        height: 40px;
    }
    
    /* Ocultar navegación desktop */
    .premium-navigation {
        display: none;
    }
    
    /* Mostrar botón hamburguesa */
    .mobile-menu-section {
        display: block;
    }
    
    /* Ajustes al header en scroll */
    .modern-header-premium.scrolled .header-glass-container {
        height: var(--nav-height-mobile);
    }
}

/* Mobile pequeño */
@media (max-width: 480px) {
    .header-glass-container {
        padding: 0 10px;
    }
    
    .premium-logo {
        height: 35px;
    }
    
    .premium-hamburger {
        width: 44px;
        height: 44px;
    }
    
    .mobile-menu-content {
        width: 90%;
    }
    
    .premium-mobile-link {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .header-glass-container {
        height: 50px;
    }
    
    .premium-logo {
        height: 30px;
    }
    
    .mobile-menu-content {
        padding-top: 50px;
    }
    
    .premium-mobile-link {
        padding: 10px 15px;
    }
}

/* ===== ANIMACIONES Y TRANSICIONES ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animación de entrada para links móviles */
.premium-mobile-menu.active .premium-mobile-link {
    animation: slideIn 0.3s ease forwards;
}

.premium-mobile-menu.active .premium-mobile-link:nth-child(1) { animation-delay: 0.1s; }
.premium-mobile-menu.active .premium-mobile-link:nth-child(2) { animation-delay: 0.15s; }
.premium-mobile-menu.active .premium-mobile-link:nth-child(3) { animation-delay: 0.2s; }
.premium-mobile-menu.active .premium-mobile-link:nth-child(4) { animation-delay: 0.25s; }
.premium-mobile-menu.active .premium-mobile-link:nth-child(5) { animation-delay: 0.3s; }

/* ===== ACCESIBILIDAD ===== */
.premium-nav-link:focus,
.premium-mobile-link:focus,
.premium-hamburger:focus,
.mobile-close-btn:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Skip navigation link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-red);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 5px 0;
    z-index: var(--z-header) + 10;
}

.skip-nav:focus {
    top: 0;
}

/* ===== SOPORTE PARA DISPOSITIVOS TÁCTILES ===== */
@media (hover: none) and (pointer: coarse) {
    .premium-nav-link:hover,
    .premium-mobile-link:hover,
    .premium-hamburger:hover {
        transform: none;
    }
    
    .premium-nav-link:active,
    .premium-mobile-link:active,
    .premium-hamburger:active {
        transform: scale(0.98);
    }
}

/* ===== DARK MODE (OPCIONAL) ===== */
@media (prefers-color-scheme: dark) {
    .modern-header-premium {
        background: rgba(30, 41, 59, 0.95);
    }
    
    .premium-nav-link,
    .premium-mobile-link {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .mobile-menu-content {
        background: #1E293B;
    }
    
    .mobile-menu-backdrop {
        background: rgba(0, 0, 0, 0.8);
    }
}