/* =========================================
   HEADER — ESTILO PROFESIONAL
========================================= */

.header {
    width: 100%;
    background: var(--color-bg-alt);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(8px);
}

/* =========================================
   CONTENEDOR INTERNO CENTRADO
========================================= */

.header-inner {
    max-width: 1500px; /* aumentado para que el menú respire */
    margin: 0 auto;
    width: 100%;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-sizing: border-box;
    flex-wrap: nowrap !important; /* evita que el header se rompa */
}

/* =========================================
   LOGO
========================================= */

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    flex-shrink: 0 !important; /* evita que se comprima */
}

.logo:hover {
    opacity: 0.7;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex-shrink: 0;
}

.brand-tagline {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--color-text);
    opacity: 0.72;
    line-height: 1.1;
    white-space: nowrap;
}


/* =========================================
   NAVBAR — PROFESIONAL
========================================= */

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;  /* deja salir el dropdown */
    position: relative;
}



.nav-group {
    position: relative;
}

.nav-group-btn {
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--color-bg-alt);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-group-btn:hover {
    background: var(--color-hover);
    border-color: var(--color-primary);
}

/* Dropdown */
.nav-group-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    z-index: 9999 !important; /* dropdown por encima del nav */
}

.nav-group:hover .nav-group-menu {
    display: block;
}

/* Enlaces del dropdown */
.nav-group-menu a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
    transition: 0.25s ease;
    position: relative;
    font-size: 15px;
}

.nav-group-menu a:last-child {
    border-bottom: none;
}

/* HOVER PROFESIONAL AZUL (SIN SUBRAYADO) */
.nav-group-menu a:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary-strong);
    padding-left: 18px !important;
}

/* =========================================
   HEADER RIGHT (IDIOMA + TEMA)
========================================= */

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    flex-shrink: 0 !important; /* evita que se comprima */
}

.lang-select {
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    color: var(--color-text);
    cursor: pointer;
    transition: 0.25s ease;
    min-width: 68px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.lang-select:hover {
    background: var(--color-hover);
    border-color: var(--color-primary);
}

.theme-toggle-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    color: var(--color-text);
    cursor: pointer;
    transition: 0.25s ease;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.theme-toggle-btn:hover {
    background: var(--color-hover);
    border-color: var(--color-primary);
}

.lang-select:focus-visible,
.theme-toggle-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

body.dark-mode .nav-group-btn,
body.dark-mode .nav-group-btn * {
    color: var(--color-text) !important;
}

body.dark-mode .nav-group-menu a,
body.dark-mode .nav-item-title,
body.dark-mode .nav-item-desc {
    color: var(--color-text) !important;
}

body.dark-mode .nav-item-desc {
    opacity: 0.78;
}

.mobile-menu-toggle,
.nav-mobile {
    display: none !important;
}

/* =========================================
   ICONOS EN EL HEADER (PROFESIONAL)
========================================= */

.nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 32px;
    height: 32px;
}

.nav-cat-icon {
    width: 32px !important;
    height: 32px !important;
    margin-right: 6px;
    flex-shrink: 0;
}

/* =========================================
   FIX — ALINEACIÓN PERFECTA DE ICONOS
========================================= */

/* ITEM PREMIUM CON TITULO + DESCRIPCIÓN */
.nav-group-menu a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--color-text);
    border-radius: 10px;
    transition: all 0.25s ease;
    position: relative;
}

/* Contenedor del texto */
.nav-item-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

/* Título de la herramienta */
.nav-item-title {
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Descripción */
.nav-item-desc {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Hover premium */
.nav-group-menu a:hover {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(4px);
    transform: translateX(4px);
}

/* Línea lateral animada */
.nav-group-menu a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--color-primary);
    border-radius: 3px;
    opacity: 0;
    transform: translateX(-6px);
    transition: 0.25s ease;
}

.nav-group-menu a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Iconos */
.nav-group-menu a svg {
    width: 22px;
    height: 22px;
    opacity: 0.85;
    margin-top: 2px;
    flex-shrink: 0;
}





/* =========================================
   RESPONSIVE — TABLET
========================================= */

@media (max-width: 1024px) {
    .header-inner {
        padding: 14px 24px;
        gap: 16px;
    }

    .nav {
        gap: 16px;
        flex-wrap: wrap;
    }
}

/* =========================================
   RESPONSIVE — MÓVIL
========================================= */

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 14px 20px;
    }

    .nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 10px;
        overflow: visible !important;
    }

    .nav-group-menu {
        position: relative;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }

    .theme-toggle-btn,
    .lang-select {
        height: 38px;
        font-size: 14px;
    }

    .nav-group-btn {
        padding: 8px 12px;
    }
}