/**
 * ============================================
 * HEADER - ESTILOS PRINCIPALES
 * MexNoticias Theme v2.6
 * ============================================
 * 
 * Responsive:
 * - >= 1024px: Layout desktop (3 filas, menú horizontal con wrap)
 * - <= 1023px: Layout móvil (2 filas centradas, menú hamburguesa)
 */

/* ============================================
   VARIABLES GLOBALES
   ============================================ */
:root {
    --color-text-main: #1f2124;
    --color-hover-border: #0BE6AF;
    --color-active-cat: #58d0f5;
    
    /* Colores oficiales de redes sociales */
    --color-facebook: #1877F2;
    --color-instagram: #E4405F;
    --color-whatsapp: #25D366;
    --color-youtube: #FF0000;
    --color-tiktok-bg: #FFFFFF;
    --color-tiktok-icon: #000000;
}

/* ============================================
   FILA 1: ESPACIO PUBLICITARIO EZOIC
   Contenedor visible con dimensiones reservadas
   ============================================ */
.site-header__ad-slot {
    background-image: linear-gradient(120deg, #fdfbfb 0%, #FCFCFC 100%);
    min-height: 90px!important;
    width: 100%;
	max-width: 970px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    overflow: hidden;
    opacity: 1;
}

.site-header__ads-placeholder {
    width: 100%;
    padding: 0px 0px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .site-header__ad-slot {
        min-height: 250px;
    }
}

/* ============================================
   FILA 2: TOPBAR (FONDO NEGRO)
   ============================================ */
.site-header__topbar {
    background: #000;
    color: #fff;
    padding: 15px 20px;
}

.site-header__topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header__socials,
.site-header__extras {
    width: 300px;
    flex-shrink: 0;
}

.site-header__logo {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* ============================================
   COL 1: REDES SOCIALES
   Círculos de color con iconos blancos
   ============================================ */
.site-header__socials {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.social-icon svg {
    fill: #ffffff;
    width: 20px;
    height: 20px;
}

.social-facebook { background-color: var(--color-facebook); }
.social-instagram { background-color: var(--color-instagram); }
.social-whatsapp { background-color: var(--color-whatsapp); }
.social-youtube { background-color: var(--color-youtube); }
.social-tiktok { background-color: var(--color-tiktok-bg); }
.social-tiktok svg { fill: var(--color-tiktok-icon); }
.social-x { background-color: transparent; width: auto; height: auto; padding: 10px; }
.social-x svg { fill: #ffffff; width: 20px; height: 20px; }

/* ============================================
   COL 2: LOGO
   ============================================ */
.logo-text {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    text-decoration: none;
}

/* ============================================
   FILA 3: NAVBAR (FONDO BLANCO)
   ============================================ */
.site-header__nav-wrapper {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.site-header__nav-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

/* ============================================
   CONTENEDOR FLEX: Menú + Búsqueda (wrap conjunto)
   ============================================ */
.main-menu-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 100%;
}

/* ============================================
   MENÚ PRINCIPAL
   ============================================ */
.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.main-menu > li {
    position: static;
    flex: 0 0 auto;
}

.main-menu > li > a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #1f2124;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    position: relative;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.main-menu > li > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--color-hover-border);
    transform: scaleX(0);
    transition: transform 0.25s;
}

.main-menu > li:hover > a::after {
    transform: scaleX(1);
}
nav.site-navigation {
	width: 92%;
}

/* ============================================
   BÚSQUEDA (integrada en el wrap)
   ============================================ */
.site-header__search-toggle {
    flex: 0 0 auto;
}

.site-header__search-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    color: #1f2124;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MEGAMENÚ
   ============================================ */
.mex-megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 30px 0;
    box-shadow: 0 15px 25px rgba(0,0,0,0.08);
    border-top: 1px solid #eaeaea;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1001;
}

.main-menu > li:hover .mex-megamenu {
    opacity: 1;
    visibility: visible;
}

.mex-megamenu__grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.mex-megamenu__post {
    text-decoration: none;
    color: var(--color-text-main);
    display: flex;
    flex-direction: column;
}

.mex-megamenu__thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eee;
    margin-bottom: 10px;
}

.mex-megamenu__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mex-megamenu__title {
    font-size: 14px;
    margin: 0;
    color: #1f2124 !important;
    font-weight: 400;
}

/* ============================================
   BÚSQUEDA DROPDOWN
   ============================================ */
.mex-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.3s;
    z-index: 999;
    border-top: 1px solid #eee;
}

.mex-search-dropdown.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mex-search-dropdown__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.mex-search-form {
    display: flex;
    align-items: center;
}

.mex-search-field {
    border: none;
    outline: none;
    width: 100%;
    font-size: 16px;
    color: #1f2124;
}

/* ============================================
   BOTÓN HAMBURGUESA FLOTANTE
   Oculto por defecto (desktop), visible en <= 1023px
   ============================================ */
.menu-toggle-float {
    display: none;
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: var(--color-hover-border);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1002;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.menu-toggle-float:hover {
    background: var(--color-active-cat);
    transform: translateY(-50%) scale(1.05);
}

.menu-toggle-float:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.menu-toggle-float svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   BREAKPOINT <= 1023px (Tablet y Móvil)
   ============================================ */
@media (max-width: 1023px) {
    
    /* Topbar: 2 filas centradas */
    .site-header__topbar {
        padding: 10px 0px 5px 0px;
    }

    .site-header__topbar-inner {
        flex-direction: column;
        position: relative;
    }

    .site-header__logo {
        order: 1;
        flex: 0 0 auto;
    }

    .logo-image {
        width: 200px;
    }

    /* Iconos sociales más pequeños en tablet/móvil */
    .social-icon {
        width: 32px;
        height: 32px;
    }

    .social-icon svg {
        width: 16px;
        height: 16px;
    }

    .social-x {
        padding: 8px;
    }

    .site-header__socials {
        order: 2;
        justify-content: center;
        gap: 10px;
    }

    .site-header__extras {
        display: none;
    }

    /* Mostrar botón hamburguesa flotante */
    .menu-toggle-float {
        display: flex;
    }

    /* Menú principal: oculto por defecto */
    .site-header__nav-wrapper {
        display: none;
    }

    .site-header__nav-wrapper.is-active {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 12px rgba(0,0,0,0.2);
        z-index: 1001;
        overflow-y: auto;
        animation: slideIn 0.3s ease;
    }

    @keyframes slideIn {
        from {
            transform: translateX(100%);
        }
        to {
            transform: translateX(0);
        }
    }

    .site-header__nav-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        gap: 0;
    }

    .main-menu-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-menu {
        flex-direction: column;
        width: 100%;
    }

    .main-menu > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-menu > li > a {
        padding: 15px 0;
        font-size: 16px;
    }

    /* Ocultar megamenú en panel móvil */
    .mex-megamenu {
        display: none;
    }

    /* Ocultar búsqueda en panel móvil */
    .site-header__search-toggle {
        display: none;
    }

}