/* ============================================================
   HEADER IGRC — CSS (ACCESIBLE Y CONSISTENTE)
   ============================================================ */

.sitio-header {
    background-color: #051d2c;
    color: #fff;
}

.contenedor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px 20px;
    position: relative;
}

.header-logo { margin-right: 40px; }
.logo-imagen { width: 140px; height: auto; }

.menu-principal { flex-grow: 1; }
.menu-lista {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}
.menu-enlace {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
}
.menu-item:hover > .megamenu-panel { display: block; }
.menu-item:hover > .menu-enlace { color: #9BB7D0; }

/* ============================================================
   MEGAMENÚ — FONDO BLANCO → usa #0038d1
   ============================================================ */
.megamenu-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1500px;
    background-color: #ffffff;
    padding: 40px 40px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    border-top: 1px solid #e5e7eb;
    z-index: 999;
}
.megamenu-contenido {
    display: flex;
    gap: 60px;
}
.megamenu-columna { flex: 1; }
.megamenu-titulo {
    font-size: 22px;
    font-weight: 600;
    color: #051d2c;
    margin-bottom: 25px;
}
.megamenu-lista {
    list-style: none;
    margin: 0;
    padding: 0;
}
.megamenu-item { margin-bottom: 20px; }
.megamenu-enlace {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #051d2c;
    position: relative;
    padding-right: 20px;
}
.mm-texto { font-size: 17px; font-weight: 500; }
.mm-descripcion {
    font-size: 14px;
    color: #6b7280;
    margin-top: 3px;
}
.mm-flecha {
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: #0038d1; /* sobre blanco */
}
.megamenu-enlace:hover .mm-flecha {
    opacity: 1;
    transform: translateY(-50%) translateX(3px);
}
.megamenu-enlace:hover .mm-texto { color: #0038d1; }

/* BLOQUE INFERIOR (fondo #F2F4F7) → usa #0038d1 */
.megamenu-inferior {
    background: #F2F4F7;
    padding: 28px 32px;
    margin-top: 32px;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-right: -40px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    gap: 40px;
}
.inferior-columna { flex: 1; }
.inferior-enlace {
    text-decoration: none;
    color: #051d2c;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.inferior-linea {
    display: flex;
    align-items: center;
    gap: 10px;
}
.inferior-icono {
    width: 22px;
    height: 22px;
    stroke: #051d2c;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.2s ease;
}
.inferior-titulo {
    font-size: 16px;
    font-weight: 600;
    transition: color 0.2s ease;
}
.inferior-descripcion {
    font-size: 14px;
    color: #4a5568;
    transition: color 0.2s ease;
}
.inferior-enlace:hover .inferior-titulo { color: #0038d1; }
.inferior-enlace:hover .inferior-descripcion { color: #1a2b3c; }
.inferior-enlace:hover .inferior-icono { stroke: #0038d1; }

.megamenu-panel { padding-bottom: 0 !important; }

/* --- RESPONSIVE TABLET --- */
@media (max-width: 992px) {
    .megamenu-contenido { flex-direction: column; gap: 40px; }
    .megamenu-panel { padding: 30px 30px; }
    .menu-lista { gap: 20px; }
}

/* ============================================================
   MENÚ HAMBURGUESA Y MÓVIL (fondo oscuro)
   ============================================================ */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.menu-toggle-line {
    width: 26px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.menu-toggle.activo .menu-toggle-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.activo .menu-toggle-line:nth-child(2) { opacity: 0; }
.menu-toggle.activo .menu-toggle-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.menu-movil {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #051d2c;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    z-index: 9999;
}
.menu-movil-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.mm-item {
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 10px;
}
.mm-toggle {
    width: 100%;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    padding: 8px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mm-toggle::after {
    content: "+";
    font-size: 20px;
    transition: transform 0.3s ease;
}
.mm-item.activo .mm-toggle::after { transform: rotate(45deg); }
.mm-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.mm-item.activo .mm-submenu { max-height: 800px; }
.mm-submenu li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    padding: 6px 0;
    display: block;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}
.mm-submenu li a:hover { opacity: 1; }
.menu-movil.activo { display: block; }

/* ============================================================
   HEADER ACCIONES + BOTÓN CONTACTAR (sobre fondo oscuro)
   ============================================================ */
.header-acciones {
    display: flex;
    align-items: center;
    gap: 22px;
}
.icono-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.icono-header:hover { opacity: 0.7; }
.icono-svg { width: 100%; height: 100%; }

/* Botón sobre fondo oscuro → #2a6fc9 */
.btn-contactar {
    padding: 8px 16px;
    background-color: #2a6fc9;
    color: #ffffff;
    border-radius: 0px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.btn-contactar:hover { background-color: #1a5cb5; }

/* BUSCADOR OVERLAY (fondo oscuro) */
.buscador-ipp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 29, 44, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.buscador-ipp-overlay.activo { display: flex; }
.buscador-ipp-overlay input {
    width: 80%;
    max-width: 600px;
    padding: 18px 24px;
    font-size: 20px;
    border-radius: 50px;
    border: 1px solid #2a6fc9;
    background: #051d2c;
    color: #fff;
}

/* ============================================================
   RESPONSIVE MÓVIL
   ============================================================ */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .menu-principal { display: none; }
    .contenedor-header {
        flex-direction: row;
        align-items: center;
        padding: 10px 16px;
    }
    .header-logo { margin-right: 10px; }
    .logo-imagen { width: 110px; }
    .btn-contactar { display: none; }
    .header-acciones { gap: 14px; }
    .icono-header { width: 22px; height: 22px; }
    .menu-movil {
        padding: 16px;
        max-height: 80vh;
        overflow-y: auto;
        box-sizing: border-box;
        width: 100%;
    }
    .menu-movil-lista { gap: 12px; }
    .mm-toggle { font-size: 16px; padding: 6px 0; }
    .mm-submenu { padding-left: 8px; }
    .mm-submenu li a { font-size: 15px; padding: 4px 0; }
    .buscador-ipp-overlay input {
        width: 90%;
        padding: 14px 20px;
        font-size: 18px;
    }
}

/* ============================================================
   BARRA SUPERIOR DE SERVICIOS EXTERNOS
   ============================================================ */
.top-bar-servicios {
    background: #f4f6f8;
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 0;
    font-size: 0.85rem;
    font-family: var(--igrc-font-base, sans-serif);
    position: relative;
    z-index: 101;
}

.contenedor-top-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.top-bar-etiqueta {
    font-weight: 600;
    color: #1a3a4a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

.top-bar-separador {
    color: #b0b8c0;
}

.top-bar-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.top-bar-enlace {
    color: #1a3a4a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.top-bar-enlace:hover {
    color: #004dff;
    text-decoration: underline;
}

.top-bar-ver-todos {
    margin-left: auto;
    color: #004dff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}
.top-bar-ver-todos:hover {
    color: #0038d1;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .contenedor-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 16px;
    }
    .top-bar-ver-todos {
        margin-left: 0;
    }
    .top-bar-nav {
        gap: 6px 10px;
    }
    .top-bar-separador {
        display: none;
    }
    .top-bar-nav a:not(:last-child)::after {
        content: "·";
        color: #b0b8c0;
        margin-left: 6px;
    }
}