/* =========================================
   1. TOP HEADER (Franja Roja)
   ========================================= */
.top-header {
    background: #d40000;
    color: white;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    z-index: 1;
    position: relative; /* Referencia para el centro absoluto */
    min-height: 40px;
}

/* Áreas Laterales */
.top-left-area,
.top-right-area {
    display: flex;
    align-items: center;
    z-index: 2;
}

/* Área Central: CENTRADO ABSOLUTO */
.top-center-area {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* Centro matemático exacto */
    z-index: 1;
    width: max-content;
    max-width: 40%;
    text-align: center;
    white-space: nowrap;
}

/* Estilos del Widget (Fondo y Padding Nuevo) */
.top-widget-content,
.top-widget {
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    line-height: 1;
    
    /* --- LO NUEVO --- */
    background: white; /* Fondo negro al 15% (muy sutil) */
    padding: 2px 4px; /* 2px arriba/abajo (tu pedido), 8px lados */
    border-radius: 4px; /* Bordes redondeados */
    display: inline-block; /* Ajusta el fondo al tamaño del texto */
    /* ---------------- */
}

.top-widget-content a, 
.top-widget a { 
    color: white; 
    text-decoration: none; /* Quitamos subrayado para que se vea más limpio con fondo */
}

/* FIX GTRANSLATE: Banderas siempre visibles */
.top-widget-content img,
.top-widget img,
a.glink img {
    opacity: 1 !important;
    filter: none !important;
    transition: none !important;
    vertical-align: middle; /* Alineación perfecta con el texto */
}

/* Redes Sociales */
.top-header .social-icons a {
    color: white;
    margin-left: 12px;
    font-size: 16px;
    transition: opacity 0.2s;
    display: inline-block;
    vertical-align: middle;
}
.top-header .social-icons a:hover { opacity: 0.7; }

/* =========================================
   2. MAIN HEADER (Barra Blanca)
   ========================================= */
.main-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 3px solid #d40000;
    transition: all 0.25s ease;
    position: relative;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.custom-logo {
    width: 150px;
    height: auto;
    transition: width 0.25s ease;
}

.title-box h1 {
    font-size: 22px;
    color: #122d86;
    margin-bottom: 3px;
    font-weight: 700;
    line-height: 1.1;
}

.title-box p {
    font-size: 14px;
    color: #555;
    margin: 0;
}

/* =========================================
   3. NAVEGACIÓN Y MENÚ
   ========================================= */
.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #122d86;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}
.hamburger:active { background: #f0f0f0; }

.mobile-menu {
    display: none;
    background: #ffffff;
    border-top: 1px solid #eee;
    border-bottom: 4px solid #d40000;
    padding: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.mobile-menu ul { list-style: none; padding: 0; margin: 0; }
.mobile-menu ul li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #f5f5f5;
    transition: 0.2s;
}
.mobile-menu ul li a:hover {
    color: #d40000;
    background: #fff9f9;
    padding-left: 25px;
}

/* =========================================
   4. RESPONSIVE DESIGN
   ========================================= */

/* --- TABLET (hasta 900px) --- */
@media (max-width: 900px) {
    .navbar { display: none; }
    .hamburger { display: block; margin-left: auto; }
    .custom-logo { width: 120px; }
}

/* --- MÓVIL (hasta 600px) --- */
@media (max-width: 600px) {
    
    /* 1. TOP HEADER: Reset de Absoluto a Bloque apilado */
    .top-header {
        flex-wrap: wrap;
        padding: 8px 15px;
        gap: 0;
    }

    /* Fila 1 Izquierda: Fecha */
    .top-left-area {
        width: 50%;
        order: 1;
        font-size: 11px;
        opacity: 0.9;
    }

    /* Fila 1 Derecha: Iconos */
    .top-right-area {
        width: 50%;
        order: 2;
        justify-content: flex-end;
    }
    .top-header .social-icons a { font-size: 14px; margin-left: 10px; }

    /* Fila 2 Centro: Widget (Full width) */
    .top-center-area {
        /* RESET del posicionamiento absoluto */
        position: static; 
        transform: none;
        
        width: 100%;
        max-width: 100%;
        order: 3;
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid rgba(255,255,255,0.15);
    }
    
    /* Mantenemos el fondo pero ajustamos si es necesario */
    .top-widget-content, .top-widget {
        display: inline-block; 
        /* En móvil quizás quieras que no tenga fondo o sea diferente, 
           pero por defecto se ve bien como "botón" */
    }
    
    /* 2. MAIN HEADER */
    .main-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
    }

    /* Ocultamos el Nav de escritorio */
    .navbar {
        display: none;
    }

    /* Mostramos la hamburguesa */
    .hamburger {
        display: block;
        /* No necesitamos margin-left: auto porque justify-content: space-between ya lo separa */
    }

    .custom-logo {
        width: 120px;
    }

    .site-title {
        font-size: 1.4rem;
    }
}