/* ========================================
   🌟 HEADER PREMIUM ULTIMATE - EFECTOS AVANZADOS
   Diseñado por experto en UI/UX con animaciones profesionales
   Incluye: Glassmorphism, Micro-interacciones, Animaciones Fluidas
======================================== */

/* ===== VARIABLES CSS AVANZADAS ===== */
:root {
    /* Gradientes premium */
    --gradient-primary: linear-gradient(135deg, #FF0000 0%, #FF1493 50%, #FFB6C1 100%);
    --gradient-hover: linear-gradient(135deg, #FF1111 0%, #FF1493 40%, #FF69B4 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    
    /* Sombras arquitectónicas */
    --shadow-premium: 0 8px 32px rgba(255, 0, 0, 0.15), 0 4px 16px rgba(255, 20, 147, 0.1);
    --shadow-hover: 0 12px 40px rgba(255, 0, 0, 0.25), 0 8px 20px rgba(255, 20, 147, 0.15);
    --shadow-glow: 0 0 30px rgba(255, 20, 147, 0.3);
    
    /* Transiciones avanzadas */
    --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --easing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Efectos */
    --blur-glass: blur(20px) saturate(180%);
    --blur-strong: blur(40px) saturate(200%);
}

/* ===== HEADER PRINCIPAL PREMIUM ===== */
.modern-header-premium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.4s var(--easing-smooth);
    will-change: transform, backdrop-filter;
}

.header-glass-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: var(--blur-glass);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Efecto de partículas de fondo */
.header-glass-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 20, 147, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 182, 193, 0.02) 0%, transparent 50%);
    pointer-events: none;
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
        opacity: 1;
    }
    50% { 
        transform: translate(10px, -5px) rotate(180deg); 
        opacity: 0.7;
    }
}

/* Estado scrolled */
.modern-header-premium.scrolled {
    backdrop-filter: var(--blur-strong);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-premium);
}

.modern-header-premium.scrolled .header-glass-container {
    padding: 0.75rem 0;
}

/* ===== LOGO PREMIUM CON EFECTOS ===== */
.logo-section {
    position: relative;
    flex-shrink: 0;
    padding: 0 2rem;
}

.premium-logo {
    height: 60px;
    width: auto;
    transition: all 0.4s var(--easing-smooth);
    filter: drop-shadow(0 4px 12px rgba(255, 0, 0, 0.15));
    position: relative;
    z-index: 2;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0;
    filter: blur(15px);
    transition: all 0.4s var(--easing-smooth);
    z-index: 1;
}

.logo-section:hover .premium-logo {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(0 6px 20px rgba(255, 0, 0, 0.25));
}

.logo-section:hover .logo-glow {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(1.2);
}

/* ===== NAVEGACIÓN PREMIUM ===== */
.premium-navigation {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 60px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.1);
}

/* Background slider animado */
.nav-background-slider {
    position: absolute;
    top: 50%;
    left: var(--slider-position, 8px);
    transform: translateY(-50%);
    width: var(--slider-width, 80px);
    height: calc(100% - 8px);
    background: var(--gradient-glass);
    border-radius: 25px;
    transition: all 0.4s var(--easing-elastic);
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enlaces de navegación premium - MÁS SEPARADOS */
.premium-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    margin: 0 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 30px;
    transition: all 0.3s var(--easing-smooth);
    overflow: hidden;
    white-space: nowrap;
    z-index: 2;
    min-width: 120px;
}

.nav-text {
    position: relative;
    z-index: 3;
    transition: all 0.3s var(--easing-smooth);
}

/* Indicador inferior */
.nav-indicator {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    transition: transform 0.4s var(--easing-elastic);
}

/* Efecto ripple */
.nav-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.6s var(--easing-smooth);
}

/* Estados hover */
.premium-nav-link:hover {
    color: #FFFFFF;
    transform: translateY(-2px);
}

.premium-nav-link:hover .nav-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.premium-nav-link:hover .nav-indicator {
    transform: translateX(-50%) scaleX(1);
}

.premium-nav-link:hover .nav-ripple {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
}

/* Estado activo */
.premium-nav-link.active {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.1);
}

.premium-nav-link.active .nav-indicator {
    transform: translateX(-50%) scaleX(1);
}

.premium-nav-link.active .nav-text {
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Animación de clic - EFECTO VISUAL DE CLICK */
.premium-nav-link:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

/* Efecto de click con animación de pulso */
.premium-nav-link.clicked {
    animation: clickPulse 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes clickPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 20, 147, 0.7);
    }
    25% {
        transform: scale(0.95);
        box-shadow: 0 0 0 8px rgba(255, 20, 147, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 20, 147, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 25px rgba(255, 20, 147, 0);
    }
}

/* Efecto de onda expansiva en click */
.premium-nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    z-index: 1;
}

.premium-nav-link.wave-effect::before {
    animation: waveExpansion 0.8s ease-out;
}

@keyframes waveExpansion {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    50% {
        width: 120px;
        height: 120px;
        opacity: 0.4;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* ===== HAMBURGER PREMIUM ===== */
.mobile-menu-section {
    flex-shrink: 0;
    padding: 0 2rem;
}

.premium-hamburger {
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s var(--easing-smooth);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.hamburger-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-hover);
    opacity: 0;
    transition: opacity 0.3s var(--easing-smooth);
}

.hamburger-bar {
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    transition: all 0.4s var(--easing-elastic);
    position: relative;
    z-index: 2;
}

.premium-hamburger:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.premium-hamburger:hover .hamburger-bg {
    opacity: 0.2;
}

.premium-hamburger:hover .hamburger-bar {
    background: #FFFFFF;
}

/* Estado activo del hamburger */
.premium-hamburger.active .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

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

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

.premium-hamburger.active .hamburger-bg {
    opacity: 0.3;
}

/* ===== MENÚ MÓVIL PREMIUM ===== */
.premium-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s var(--easing-smooth);
}

.mobile-menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: var(--blur-strong);
    transform: translateX(100%);
    transition: transform 0.5s var(--easing-elastic);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

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

.premium-mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

/* Header del menú móvil */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 0, 0, 0.1);
}

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

.mobile-close-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s var(--easing-smooth);
}

.mobile-close-btn span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #FF0000;
    border-radius: 1px;
    transition: all 0.3s var(--easing-smooth);
}

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

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

.mobile-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Navegación móvil */
.mobile-navigation {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.premium-mobile-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s var(--easing-smooth);
    overflow: hidden;
}

.mobile-link-bg {
    position: absolute;
    top: 0;
    left: -100%;
    right: 0;
    bottom: 0;
    background: var(--gradient-glass);
    transition: left 0.4s var(--easing-smooth);
}

.mobile-link-text {
    position: relative;
    z-index: 2;
    transition: all 0.3s var(--easing-smooth);
}

.mobile-link-arrow {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s var(--easing-smooth);
}

.premium-mobile-link:hover .mobile-link-bg {
    left: 0;
}

.premium-mobile-link:hover .mobile-link-text {
    color: #FF0000;
    transform: translateX(5px);
}

.premium-mobile-link:hover .mobile-link-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #FF1493;
}

/* Efecto de click para enlaces móviles */
.premium-mobile-link:active {
    transform: scale(0.98);
    background: rgba(255, 20, 147, 0.1);
}

.premium-mobile-link.mobile-clicked {
    animation: mobileClickEffect 0.5s ease-out;
}

@keyframes mobileClickEffect {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.05);
    }
    25% {
        transform: scale(0.97);
        background: rgba(255, 20, 147, 0.15);
    }
    50% {
        transform: scale(1.02);
        background: rgba(255, 20, 147, 0.08);
    }
    100% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Footer del menú móvil */
.mobile-menu-footer {
    padding: 2rem;
    border-top: 1px solid rgba(255, 0, 0, 0.1);
    background: rgba(255, 0, 0, 0.02);
}

.contact-info p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .header-glass-container {
        padding: 0.875rem 1rem;
    }
    
    .logo-section,
    .mobile-menu-section {
        padding: 0 1rem;
    }
    
    .premium-logo {
        height: 50px;
    }
    
    .nav-wrapper {
        gap: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .premium-nav-link {
        padding: 0.875rem 2rem;
        margin: 0 0.5rem;
        font-size: 0.95rem;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .premium-navigation {
        display: none;
    }
    
    .premium-hamburger {
        display: flex;
    }
    
    .header-glass-container {
        padding: 0.75rem 0.75rem;
    }
    
    .logo-section,
    .mobile-menu-section {
        padding: 0 0.5rem;
    }
    
    .premium-logo {
        height: 45px;
    }
}

@media (max-width: 480px) {
    .mobile-menu-content {
        width: 100%;
    }
    
    .premium-logo {
        height: 40px;
    }
    
    .premium-hamburger {
        width: 44px;
        height: 44px;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */

/* Entrada de enlaces con delay */
.premium-nav-link {
    opacity: 0;
    animation: navLinkAppear 0.8s var(--easing-smooth) forwards;
}

.premium-nav-link:nth-child(1) { animation-delay: 0.3s; }
.premium-nav-link:nth-child(2) { animation-delay: 0.4s; }
.premium-nav-link:nth-child(3) { animation-delay: 0.5s; }
.premium-nav-link:nth-child(4) { animation-delay: 0.6s; }
.premium-nav-link:nth-child(5) { animation-delay: 0.7s; }

@keyframes navLinkAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enlaces móviles con animación staggered */
.premium-mobile-menu.active .premium-mobile-link {
    animation: mobileSlideIn 0.5s var(--easing-smooth) forwards;
    opacity: 0;
    transform: translateX(50px);
}

.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; }

@keyframes mobileSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== OPTIMIZACIONES DE RENDIMIENTO ===== */
.modern-header-premium,
.premium-nav-link,
.premium-mobile-link,
.premium-hamburger {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}