/* ═══════════════════════════════════════════════════════════════════════════
 *  LEW_ShowHeader — Estilos del header global
 *  Base: desktop ≥1600px
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Ocultar header Elementor para evitar duplicado ── */
.elementor-location-header {
    display: none !important;
}

/* ── Reset base del header ── */
#lewHeader,
#lewHeader * {
    box-sizing: border-box;
}
#lewHeader {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    font-family: 'Roboto Mono', monospace;
}
#lewHeader a {
    text-decoration: none;
}
#lewHeader button {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
 *  BARRA 1 — Escudos de equipos
 * ═══════════════════════════════════════════════════════════════════════════ */
.lewh-bar-teams {
    display: flex;
    align-items: center;
    background-color: #e8ecf4;
    height: 64px;
    overflow: hidden;
}

/* Scroll horizontal de escudos */
.lewh-teams-scroll {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lewh-teams-scroll::-webkit-scrollbar { display: none; }

/* Clases generadas por LEW_MostrarGaleriaClubes */
#lewHeader .LEW_DivisionClubsGallery {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
}
#lewHeader .LEW_DivisionClubContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 7px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background-color .15s ease;
}
#lewHeader .LEW_DivisionClubContainer:hover {
    background-color: rgba(0,0,0,.06);
}
#lewHeader .LEW_DivisionClubImageContainer {
    display: flex;
    align-items: center;
    justify-content: center;
}
#lewHeader .LEW_DivisionClubImage {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
    max-width: unset;
    max-height: unset;
}

/* Flags de idioma — al final de la barra, no se sale */
.lewh-flags {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding: 0 10px;
    border-left: 1px solid #f0f2f5;
}
.lewh-flag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: #9aa3ae;
    padding: 4px 7px;
    border-radius: 4px;
    transition: color .15s ease, background-color .15s ease, opacity .15s ease;
    opacity: .55;
}
.lewh-flag-emoji {
    font-size: 14px;
    line-height: 1;
}
.lewh-flag-code {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
}
.lewh-flag:hover,
.lewh-flag--active {
    color: #1a2035;
    background-color: #f0f2f5;
    opacity: 1;
}
.lewh-flag--active {
    box-shadow: 0 0 0 1.5px #1B99D2;
}

/* ═══════════════════════════════════════════════════════════════════════════
 *  BARRA 2 — Header principal
 * ═══════════════════════════════════════════════════════════════════════════ */
.lewh-bar-main {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f2f5;
    height: 68px;
    position: relative;
}

/* Logo */
.lewh-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 20px;
    height: 100%;
    border-right: 1px solid #f0f2f5;
}
.lewh-logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* Tabs de liga */
.lewh-league-tabs {
    display: flex;
    align-items: stretch;
    height: 100%;
    border-right: 1px solid #f0f2f5;
}
.lewh-league-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    border-left: 1px solid #f0f2f5;
    border-bottom: 3px solid transparent;
    transition: border-color .18s ease, background-color .18s ease;
    position: static;
}
.lewh-league-tab:hover {
    background-color: #f8f9fb;
}
.lewh-league-tab--active {
    border-bottom-color: var(--lewh-tab-color);
}
.lewh-league-tab-img {
    height: 52px;
    width: auto;
    display: block;
    max-width: 280px;
    object-fit: contain;
}
.lewh-league-tab-fallback {
    display: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    color: #1a2035;
    text-transform: uppercase;
}
.lewh-league-tab-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .05em;
    color: #9aa3ae;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
}
.lewh-league-tab--active .lewh-league-tab-label {
    color: var(--lewh-tab-color);
}

/* ── Dropdown de liga ────────────────────────────────────────────────────── */

/* El tab ya NO es el contexto de posición — lo hereda del bar-main */
.lewh-league-tab { position: static; }

.lewh-league-tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    text-decoration: none;
    padding: 0 18px;
}

/* Dropdown anclado al bar-main (ancho completo) */
.lewh-league-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--lewh-tab-color);
    display: flex;
    align-items: stretch;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 46px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease;
    z-index: 9998;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    will-change: opacity, transform;
}

.lewh-league-tab:hover .lewh-league-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lewh-league-dropdown li {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
}

.lewh-league-dropdown a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 36px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    border-right: 1px solid rgba(255,255,255,.15);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}
.lewh-league-dropdown li:last-child a { border-right: none; }
.lewh-league-dropdown a:hover {
    color: #fff;
    background-color: rgba(255,255,255,.07);
}

/* Navegación TV / Noticias / Multimedia */
.lewh-nav {
    display: flex;
    align-items: stretch;
    height: 100%;
    margin-left: auto;
}
.lewh-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 14px;
    flex-shrink: 0;
    color: #9aa3ae;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.lewh-nav-item:hover {
    color: #1a2035;
    border-bottom-color: #1B99D2;
}
.lewh-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Separador vertical */
.lewh-separator {
    width: 1px;
    height: 32px;
    background-color: #f0f2f5;
    flex-shrink: 0;
    margin: 0 8px;
}

/* RRSS */
.lewh-rrss {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    flex-shrink: 0;
    padding: 0 6px;
}
.lewh-rrss-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.lewh-rrss-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    color: #9aa3ae;
    transition: color .15s ease, background-color .15s ease;
}
.lewh-rrss-link:hover {
    color: #1a2035;
    background-color: #f0f2f5;
}
.lewh-rrss-link svg {
    width: 13px;
    height: 13px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
 *  BARRA 3 — Navegación de división activa
 * ═══════════════════════════════════════════════════════════════════════════ */
.lewh-bar-divnav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    height: 46px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lewh-bar-divnav::-webkit-scrollbar { display: none; }

.lewh-divnav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 36px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    border-right: 1px solid rgba(255,255,255,.15);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.lewh-divnav-item:last-child {
    border-right: none;
}
.lewh-divnav-item:hover {
    color: #fff;
    background-color: rgba(255,255,255,.06);
}
.lewh-divnav-item--active {
    color: #fff;
    border-bottom-color: rgba(255,255,255,.8);
}

/* ═══════════════════════════════════════════════════════════════════════════
 *  HAMBURGER + MOBILE MENU
 * ═══════════════════════════════════════════════════════════════════════════ */

/* RRSS row shown only on mobile (above bar-teams) */
.lewh-bar-rrss-mobile {
    display: none;
}

.lewh-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #f0f0f0 !important;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    margin-right: 8px;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .15s;
}
.lewh-burger:hover { background-color: #e4e4e4 !important; }
.lewh-burger:active { background-color: #ddd !important; }
.lewh-burger svg { width: 20px; height: 20px; display: block; stroke: #555; }

.lewh-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #f0f2f5;
    box-shadow: 0 8px 28px rgba(0,0,0,.16);
    z-index: 9997;
    flex-direction: column;
    padding: 8px 16px 16px;
}
.lewh-mobile-menu--open { display: flex; }

.lewh-mmenu-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}
.lewh-mmenu-section:last-child { border-bottom: none; }

/* Ligas */
.lewh-mmenu-league {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 6px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: background-color .15s, border-color .15s;
}
.lewh-mmenu-league:hover { background-color: #f8f9fb; }
.lewh-mmenu-league--active { border-color: var(--lewh-tab-color, #1B99D2); }
.lewh-mmenu-league-img {
    height: 38px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    display: block;
}
.lewh-mmenu-league-fallback {
    display: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #1a2035;
}

/* Nav TV/Noticias/Multimedia */
.lewh-mmenu-nav { justify-content: stretch; gap: 6px; }
.lewh-mmenu-navitem {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6b7a8d;
    border-radius: 6px;
    border: 1.5px solid #eef0f3;
    transition: color .15s, background-color .15s;
}
.lewh-mmenu-navitem:hover { color: #1a2035; background-color: #f0f2f5; }

/* Idioma */
.lewh-mmenu-lang { justify-content: flex-start; gap: 8px; }
.lewh-mmenu-langitem {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    color: #9aa3ae;
    border: 1.5px solid #eef0f3;
    transition: color .15s, border-color .15s;
}
.lewh-mmenu-langitem--active {
    color: #1a2035;
    border-color: #1B99D2;
}

/* ═══════════════════════════════════════════════════════════════════════════
 *  RESPONSIVE
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1440px) {
    .lewh-league-tab {
        padding: 0 12px;
    }
    .lewh-league-tab-img {
        max-width: 160px;
    }
    .lewh-nav-item {
        padding: 0 10px;
    }
    .lewh-logo {
        padding: 0 14px;
    }
}

@media (max-width: 1199px) {
    .lewh-league-tab {
        padding: 0 10px;
    }
    .lewh-league-tab-img {
        max-width: 130px;
    }
    .lewh-nav-item {
        padding: 0 8px;
        font-size: 9px;
    }
    .lewh-rrss {
        padding: 0 4px;
        gap: 0;
    }
    .lewh-rrss-link {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 1023px) {
    /* Tabs de liga: solo logotipo, ocultar label */
    .lewh-league-tab-label {
        display: none;
    }
    .lewh-league-tab-img {
        height: 42px;
        max-width: 180px;
    }
    /* Nav: ocultar labels, solo iconos */
    .lewh-nav-item span {
        display: none;
    }
    .lewh-nav-item {
        padding: 0 10px;
    }
    .lewh-nav-icon {
        width: 20px;
        height: 20px;
    }
    .lewh-separator {
        margin: 0 4px;
    }
}

@media (max-width: 767px) {
    /* Barra 1: escudos más pequeños, sin nombre */
    .lewh-bar-teams {
        height: 50px;
    }
    #lewHeader .LEW_DivisionClubImage {
        width: 26px;
        height: 26px;
    }
    #lewHeader .LEW_DivisionClubContainer {
        padding: 4px 5px;
    }
    #lewHeader .LEW_DivisionClubsGallery {
        gap: 10px;
    }

    /* Barra 2: altura reducida, logo izq + burger dcha */
    .lewh-bar-main {
        height: 56px;
        justify-content: space-between;
    }
    .lewh-logo {
        padding: 0 10px;
        border-right: none;
        flex: 0 0 auto;
    }
    .lewh-logo img {
        height: 28px;
    }

    /* RRSS strip mobile: mostrar encima de la barra de clubs */
    .lewh-bar-rrss-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: #1a2332;
        padding: 4px 8px;
    }
    .lewh-bar-rrss-mobile .lewh-rrss-link {
        width: 30px;
        height: 30px;
        color: rgba(255,255,255,.75);
    }
    .lewh-bar-rrss-mobile .lewh-rrss-link:hover,
    .lewh-bar-rrss-mobile .lewh-rrss-link:active {
        color: #fff;
        background: rgba(255,255,255,.1);
    }
    .lewh-bar-rrss-mobile .lewh-rrss-link svg {
        width: 14px;
        height: 14px;
    }

    /* Tabs de liga: ocultar todos — el hamburger maneja la navegación */
    .lewh-league-tabs {
        display: none;
    }

    /* Nav: ocultar TV/Noticias/Multimedia */
    .lewh-nav { display: none; }
    .lewh-separator { display: none; }

    /* RRSS: ocultar de la barra principal */
    .lewh-rrss { display: none; }

    /* Flags: ocultar de la barra, están en el menú móvil */
    .lewh-flags { display: none; }

    /* Hamburger: mostrar */
    .lewh-burger {
        display: flex;
    }

    /* Barra 3: font más pequeño, scroll horizontal */
    .lewh-bar-divnav {
        height: 40px;
    }
    .lewh-divnav-item {
        font-size: 10px;
        padding: 0 12px;
        letter-spacing: .04em;
    }

    /* Mobile menu: estilo mejorado */
    .lewh-mobile-menu {
        border-radius: 0 0 12px 12px;
    }
    .lewh-mmenu-league-img {
        height: 32px;
        max-width: 110px;
    }

    /* Ligas apiladas en columna */
    .lewh-mmenu-section:has(.lewh-mmenu-league) {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .lewh-mmenu-league {
        justify-content: flex-start;
        padding: 10px 12px;
    }
}
