/* ===========================================================
   El Cortafuegos — Header del sitio
   Azul BK2 oscuro · Logo + nav + CTA · Responsive con drawer
   =========================================================== */

:root {
    --cch-bg-1:    #08305b;     /* azul muy oscuro */
    --cch-bg-2:    #0F4F88;     /* BK2 */
    --cch-accent:  #EFAB22;     /* BK3 amarillo */
    --cch-accent-h:#D69512;
    --cch-text:    #ffffff;
    --cch-text-mu: rgba(255,255,255,.78);
    --cch-height:  92px;
    --cch-height-sm: 74px;
}

/* Ocultar el header dinámico que añade hello-elementor */
body.cc-has-header > header#site-header,
body.cc-has-header header.site-header.dynamic-header,
body.cc-has-header .ehf-header { display: none !important; }

/* Empuja el contenido para no quedar bajo el header sticky */
body.cc-has-header { padding-top: var(--cch-height); }
@media (max-width: 768px) {
    body.cc-has-header { padding-top: var(--cch-height-sm); }
}

.cc-site-header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 9990;
    background: linear-gradient(180deg, var(--cch-bg-1) 0%, var(--cch-bg-2) 100%);
    box-shadow: 0 2px 14px rgba(0,0,0,.18);
    border-bottom: 2px solid var(--cch-accent);
    font-family: 'Nunito Sans', system-ui, sans-serif;
    transition: box-shadow .2s ease, background .25s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.cc-site-header.is-scrolled {
    background: var(--cch-bg-1);
    box-shadow: 0 4px 22px rgba(0,0,0,.32);
}

.cc-header-inner {
    max-width: 1280px;
    height: var(--cch-height);
    margin: 0 auto;
    padding: 0 22px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px;
    position: relative;
}

/* Logo */
.cc-header-logo {
    display: inline-flex; align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform .18s ease;
}
.cc-header-logo {
    height: calc(var(--cch-height) - 6px);
}
.cc-header-logo img {
    height: 100%; width: auto; display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
    background: transparent;
    object-fit: contain;
}
.cc-header-logo:hover { transform: scale(1.04); }

/* Nav */
.cc-header-nav {
    display: flex; align-items: center; gap: 28px;
    flex: 1; justify-content: flex-end;
}
.cc-header-menu {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; gap: 4px;
}
.cc-header-link {
    position: relative;
    display: inline-block;
    padding: 10px 14px;
    font-family: 'Nunito Sans', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: color .18s ease, background .18s ease;
    text-shadow: none;
}
.cc-header-link::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 2px; border-radius: 2px;
    background: var(--cch-accent);
    transform: scaleX(0); transform-origin: center;
    transition: transform .25s ease;
}
.cc-header-link {
    color: rgba(255,255,255,.92);
}
.cc-header-link:hover,
.cc-header-link:focus-visible {
    color: var(--cch-accent);
    outline: none;
}
.cc-header-link:hover::after,
.cc-header-link:focus-visible::after { transform: scaleX(1); }

.cc-header-link.is-active {
    color: #fff;
    background: rgba(239,171,34,.12);
}
.cc-header-link.is-active::after { transform: scaleX(1); }

/* CTA */
.cc-header-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--cch-accent); color: #1c1c1c;
    padding: 10px 18px; border-radius: 50px;
    font-family: 'Fredoka', 'Nunito Sans', sans-serif;
    font-size: 14px; font-weight: 700; letter-spacing: .3px;
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(239,171,34,.4), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .18s ease, background .2s ease, box-shadow .2s ease;
}
.cc-header-cta:hover {
    background: var(--cch-accent-h); color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239,171,34,.5);
}
.cc-header-cta svg { transition: transform .2s ease; }
.cc-header-cta:hover svg { transform: translateX(3px); }

/* Hamburguesa — oculta en desktop, visible en móvil.
   !important + alta specificity para que el Kit de Elementor / temas no nos pisen los estilos. */
.cc-site-header .cc-header-toggle {
    display: none !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    background: rgba(255,255,255,.12) !important;
    background-image: none !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--cch-accent) !important;
    transition: background .2s ease, transform .15s ease;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1 !important;
    font-size: 0 !important;
    text-shadow: none !important;
    text-decoration: none !important;
}
.cc-site-header .cc-header-toggle:hover { background: rgba(255,255,255,.20) !important; }
.cc-site-header .cc-header-toggle svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    color: var(--cch-accent) !important;
    fill: none !important;
    stroke: currentColor !important;
}
.cc-site-header .cc-header-toggle .cc-icon-close { display: none !important; }
.cc-site-header .cc-header-toggle[aria-expanded="true"] .cc-icon-menu  { display: none !important; }
.cc-site-header .cc-header-toggle[aria-expanded="true"] .cc-icon-close { display: block !important; }

/* Backdrop */
.cc-header-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: -1;
}
.cc-header-backdrop.is-open {
    opacity: 1; pointer-events: auto;
}

/* ── Móvil / Tablet ─────────────────────────────────────── */
@media (max-width: 968px) {
    .cc-header-inner { padding: 0 16px; height: var(--cch-height-sm); }
    .cc-header-logo img { height: 56px; }

    .cc-site-header .cc-header-toggle { display: inline-flex !important; }
    .cc-header-logo { height: auto; max-width: 220px; flex: 0 1 auto; min-width: 0; }
    .cc-header-logo img { width: 100%; height: auto; max-height: calc(var(--cch-height-sm) - 14px); }

    .cc-header-nav {
        position: fixed;
        top: var(--cch-height-sm);
        left: 0; right: 0;
        background: var(--cch-bg-1);
        flex-direction: column; align-items: stretch;
        gap: 0;
        box-shadow: 0 12px 28px rgba(0,0,0,.45);
        /* Cerrado: completamente colapsado, sin altura, sin padding, sin borde */
        max-height: 0;
        overflow: hidden;
        padding: 0 18px;
        border-bottom: 0 solid var(--cch-accent);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition:
            max-height .3s cubic-bezier(.4, .0, .2, 1),
            padding    .3s cubic-bezier(.4, .0, .2, 1),
            opacity    .2s ease,
            border-bottom-width .3s ease,
            visibility 0s linear .3s;
    }
    .cc-header-nav.is-open {
        max-height: calc(100vh - var(--cch-height-sm));
        overflow-y: auto;
        padding: 14px 18px 24px;
        border-bottom-width: 2px;
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transition:
            max-height .35s cubic-bezier(.4, .0, .2, 1),
            padding    .35s cubic-bezier(.4, .0, .2, 1),
            opacity    .25s ease,
            border-bottom-width .3s ease,
            visibility 0s linear 0s;
    }

    .cc-header-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin-bottom: 14px;
    }
    .cc-header-link {
        display: block;
        padding: 14px 16px;
        font-size: 17px;
        border-radius: 10px;
    }
    .cc-header-link::after { display: none; }
    .cc-header-link.is-active { background: rgba(239,171,34,.18); }

    .cc-header-cta {
        justify-content: center;
        padding: 14px 22px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .cc-header-logo { max-width: 170px; }
    .cc-header-logo img { max-height: calc(var(--cch-height-sm) - 18px); }
}
