/* ========================================
   NUEVO HEADER - DISEÑO MODERNO Y LIMPIO
   ======================================== */

:root {
    --primary-color: #546e7a;
    --primary-dark: #37474f;
    --primary-light: #78909c;
    --secondary-color: #e65100;
    --text-light: #ffffff;
    --text-dark: #212121;
    --background-light: #f5f7fa;
    --border-color: #e0e0e0;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding-top: var(--header-height);
}

/* ========================================
   NUEVO HEADER PRINCIPAL
   ======================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    height: 70px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}

/* Container del Header */
.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    gap: 20px;
    width: 100%; /* Asegurar que ocupe el 100% del ancho disponible */
}

/* ========================================
   LOGO
   ======================================== */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-logo img {
    height: 55px;
    width: auto;
    transition: height 0.3s ease;
}

.main-header.scrolled .header-logo img {
    height: 45px;
}

/* ========================================
   NAVEGACIÓN PRINCIPAL
   ======================================== */
.header-nav {
    display: flex;
    align-items: center;
    flex: 0 1 auto; /* Cambiar para que no crezca tanto */
    justify-content: center;
    max-width: 800px; /* Limitar ancho máximo de la navegación */
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 400;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(84, 110, 122, 0.08);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Remover estilos active - ya no se usa */

/* ========================================
   SELECTOR DE IDIOMA
   ======================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto; /* Mantener a la derecha en desktop */
}

.language-selector {
    display: flex;
    gap: 8px;
    background: white;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

.lang-btn img {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-btn:hover {
    background-color: var(--background-light);
    transform: translateY(-2px);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========================================
   MENÚ HAMBURGUESA (MÓVIL)
   ======================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    z-index: 1100;
    position: fixed; /* Fijo en la pantalla */
    right: 20px; /* Pegado a la derecha */
    top: 20px; /* Arriba */
}

.menu-toggle:hover {
    background: rgba(84, 110, 122, 0.1);
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--primary-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ========================================
   OVERLAY PARA MÓVIL
   ======================================== */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
    .header-wrapper {
        padding: 0 30px;
    }
    
    .nav-link {
        padding: 8px 14px;
        font-size: 14px;
    }
}

/* ========================================
   RESPONSIVE - MÓVIL
   ======================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .header-wrapper {
        padding: 0 20px;
        justify-content: space-between; /* Logo izquierda, resto a la derecha */
    }
    
    .menu-toggle {
        display: flex;
        order: 3; /* Toggle al final (derecha) */
    }
    
    /* Logo más pequeño en móvil */
    .header-logo img {
        height: 45px;
        order: 1; /* Logo primero (izquierda) */
    }
    
    /* Navegación móvil */
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 30px 30px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 999;
        overflow-y: auto;
    }
    
    .header-nav.active {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        justify-content: flex-start;
    }
    
    /* Selector de idioma en móvil - MOVIDO A LA IZQUIERDA/CENTRO */
    .header-actions {
        position: static;
        order: 2;
        margin-right: auto; /* Empuja las banderas hacia la izquierda */
        margin-left: 10px; /* Espacio desde el logo */
    }
    
    .language-selector {
        gap: 6px;
        padding: 4px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .lang-btn img {
        width: 20px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .header-wrapper {
        padding: 0 15px;
    }
    
    .header-logo img {
        height: 40px;
    }
    
    .header-nav {
        width: 280px;
        padding: 90px 20px 20px;
    }
    
    .header-actions {
        /* Mantener centrado en pantallas pequeñas */
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-header {
    animation: slideDown 0.5s ease;
}

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

/* ========================================
   FIX CRÍTICO: ANULAR ESTILOS DE STYLES.CSS
   ======================================== */

/* ANULAR el ::after que viene de styles.css (líneas 194-208) */
.main-header .header-nav .nav-link::after,
.main-header .header-nav .nav-menu .nav-link::after,
.main-header nav ul li a::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

/* ANULAR el ::before por si acaso */
.main-header .header-nav .nav-link::before,
.main-header .header-nav .nav-menu .nav-link::before,
.main-header nav ul li a::before {
    content: none !important;
    display: none !important;
}

/* Resetear TODOS los estados del link */
.main-header .header-nav .nav-link,
.main-header .header-nav .nav-link:link,
.main-header .header-nav .nav-link:visited,
.main-header .header-nav .nav-link:hover,
.main-header .header-nav .nav-link:active,
.main-header .header-nav .nav-link:focus {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    position: relative !important;
}

/* Forzar estilos correctos del nuevo header */
.main-header .header-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 10px 18px !important;
    color: var(--primary-dark) !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    background-color: transparent !important;
}

.main-header .header-nav .nav-link:hover {
    background-color: rgba(84, 110, 122, 0.08) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px) !important;
    text-decoration: none !important;
}

/* ========================================
   FIX CRÍTICO: ANULAR ESTILOS DE STYLES.CSS
   ======================================== */

/* ANULAR el ::after que viene de styles.css (líneas 194-208) */
.main-header .header-nav .nav-link::after,
.main-header .header-nav .nav-menu .nav-link::after,
.main-header nav ul li a::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

/* ANULAR el ::before por si acaso */
.main-header .header-nav .nav-link::before,
.main-header .header-nav .nav-menu .nav-link::before,
.main-header nav ul li a::before {
    content: none !important;
    display: none !important;
}

/* Resetear TODOS los estados del link */
.main-header .header-nav .nav-link,
.main-header .header-nav .nav-link:link,
.main-header .header-nav .nav-link:visited,
.main-header .header-nav .nav-link:hover,
.main-header .header-nav .nav-link:active,
.main-header .header-nav .nav-link:focus {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    position: relative !important;
}

/* Forzar estilos correctos del nuevo header */
.main-header .header-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 10px 18px !important;
    color: var(--primary-dark) !important;
    font-weight: 400 !important; /* Peso más ligero - CAMBIADO de 500 a 400 */
    font-size: 15px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    background-color: transparent !important;
    font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif !important; /* Fuente más ligera */
    letter-spacing: 0.3px !important; /* Más espaciado entre letras */
}

.main-header .header-nav .nav-link:hover {
    background-color: rgba(84, 110, 122, 0.08) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px) !important;
    text-decoration: none !important;
    font-weight: 400 !important; /* Mantener peso ligero en hover */
}