/* ============================================================
   ClickBox Header  |  Montserrat  |  v2
   ============================================================ */

:root {
    --cbh-h:        80px;
    --cbh-h-mob:    64px;
    --cbh-bg:       linear-gradient(90deg, #1a0ea8 0%, #3b2de0 100%);
    --cbh-glow:     #5b4aff;
    --cbh-ease:     cubic-bezier(.4,0,.2,1);
    --cbh-z:        9000;
}

/* ── SIN body offset — el hero va DEBAJO del header transparente ── */
body { padding-top: 0 !important; }

/* ── Admin bar fix (usuarios logueados ven la barra WP de 32px) ── */
.admin-bar #cb-header {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    .admin-bar #cb-header { top: 46px !important; }
}
@media screen and (max-width: 600px) {
    .admin-bar #cb-header { top: 0 !important; }
}

/* ============================================================
   HEADER  —  transparente sobre el hero, azul al hacer scroll
   ============================================================ */
#cb-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--cbh-h) !important;
    z-index: var(--cbh-z) !important;
    background: transparent !important;       /* transparente sobre el hero */
    font-family: 'Montserrat', sans-serif !important;
    transform: translateY(0);
    transition: transform .4s var(--cbh-ease), background .35s var(--cbh-ease), box-shadow .35s;
    will-change: transform;
    box-sizing: border-box !important;
}

/* Al hacer scroll y reaparecer (subiendo) → fondo azul sólido */
#cb-header.is-scrolled {
    background: var(--cbh-bg) !important;
    box-shadow: 0 4px 32px rgba(0,0,0,.4) !important;
}

/* Oculto al bajar */
#cb-header.is-hidden { transform: translateY(-100%) !important; }

.cb-header__inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 44px;
    height: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px;
}

/* ── LOGO ── */
.cb-header__logo-link {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    text-decoration: none !important;
    transition: opacity .3s;
    line-height: 0;
}

.cb-header__logo-link:hover { opacity: .82 !important; }

/* Sin atributos inline — CSS controla el tamaño completamente */
#cb-header .cb-header__logo,
.cb-header__logo-link img.cb-header__logo {
    display: block !important;
    height: 64px !important;      /* tamaño logo desktop */
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================================
   DESKTOP NAV
   ============================================================ */
.cb-header__nav {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
}

.cb-header__menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.cb-header__item { position: relative !important; }

/* Base link */
#cb-header .cb-header__nav .cb-header__link,
#cb-header .cb-header__nav a.cb-header__link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    transition: background .25s, color .25s !important;
    white-space: nowrap !important;
    position: relative !important;
}

/* ─ Hover: fondo blanco suave + subrayado ─
   Estrategia doble para ganar sobre cualquier tema padre */
#cb-header .cb-header__nav .cb-header__link:hover,
#cb-header .cb-header__nav .cb-header__link:focus,
#cb-header .cb-header__nav a.cb-header__link:hover,
#cb-header .cb-header__nav a.cb-header__link:active,
#cb-header .cb-header__item--has-sub:hover > .cb-header__link {
    background:       rgba(255,255,255,.18) !important;
    background-color: rgba(255,255,255,.18) !important;
    color:            #ffffff !important;
    border-color:     transparent !important;
    box-shadow:       none !important;
}

/* Subrayado animado bajo los links */
#cb-header .cb-header__nav .cb-header__link::after {
    content: '' !important;
    position: absolute !important;
    bottom: 6px !important;
    left: 20px !important;
    right: 20px !important;
    height: 2px !important;
    background: #ffffff !important;
    border-radius: 2px !important;
    transform: scaleX(0) !important;
    transform-origin: center !important;
    transition: transform .3s var(--cbh-ease) !important;
}

#cb-header .cb-header__nav .cb-header__link:hover::after,
#cb-header .cb-header__nav .cb-header__link:focus::after {
    transform: scaleX(1) !important;
}

/* Chevron */
.cb-header__chevron {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    transition: transform .3s var(--cbh-ease) !important;
}

.cb-header__item--has-sub:hover > .cb-header__link .cb-header__chevron {
    transform: rotate(180deg) !important;
}

/* ── Dropdown ── */
.cb-header__submenu {
    list-style: none !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-8px) !important;
    min-width: 215px !important;
    background: linear-gradient(135deg, #1a0ea8, #3b2de0) !important;
    border-radius: 10px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,.45) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity .25s var(--cbh-ease), transform .25s var(--cbh-ease), visibility .25s !important;
    z-index: calc(var(--cbh-z) + 5) !important;
}

/* Flecha */
.cb-header__submenu::before {
    content: '' !important;
    position: absolute !important;
    top: -6px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 12px !important;
    height: 12px !important;
    background: #1a0ea8 !important;
    border-left: 1px solid rgba(255,255,255,.12) !important;
    border-top: 1px solid rgba(255,255,255,.12) !important;
    rotate: 45deg !important;
}

.cb-header__item--has-sub:hover > .cb-header__submenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
}

.cb-header__submenu li a {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: rgba(255,255,255,.75) !important;
    text-decoration: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.9375rem !important;
    font-weight: 400 !important;
    padding: 11px 22px !important;
    background: transparent !important;
    transition: background .2s, color .2s, padding-left .2s !important;
}

.cb-header__submenu li a::before {
    content: '•' !important;
    color: var(--cbh-glow) !important;
    flex-shrink: 0 !important;
    transition: transform .2s !important;
}

.cb-header__submenu li a:hover {
    background: rgba(255,255,255,.12) !important;
    color: #ffffff !important;
    padding-left: 28px !important;
}

.cb-header__submenu li a:hover::before { transform: scale(1.5) !important; }

/* ============================================================
   BURGER — visible SOLO en móvil (max-width approach)
   ============================================================ */

/* Desktop (≥768): siempre oculto */
@media (min-width: 768px) {
    #cb-burger,
    .cb-burger,
    #cb-header #cb-burger,
    #cb-header .cb-burger {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Estilos base del burger (se aplican solo cuando es visible en móvil) */
.cb-burger {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: background .25s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.cb-burger:hover { background: rgba(255,255,255,.15); }

.cb-burger__line {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform .35s var(--cbh-ease), opacity .25s;
    transform-origin: center;
}

.cb-burger.is-active .cb-burger__line:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.cb-burger.is-active .cb-burger__line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.cb-burger.is-active .cb-burger__line:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   MOBILE SIDEBAR
   ============================================================ */
.cb-sidebar {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cbh-z) + 100);
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s .45s;
}

.cb-sidebar.is-open {
    pointer-events: auto;
    visibility: visible;
    transition: visibility 0s;
}

/* Overlay */
.cb-sidebar__overlay {
    position: absolute;
    inset: 0;
    background: rgba(8,4,50,.78);
    opacity: 0;
    transition: opacity .4s var(--cbh-ease);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cb-sidebar.is-open .cb-sidebar__overlay { opacity: 1; }

/* Panel */
.cb-sidebar__panel {
    position: absolute;
    top: 0; right: 0;
    width: min(340px, 88vw);
    height: 100%;
    background: linear-gradient(160deg, #1a0ea8 0%, #3b2de0 100%);
    box-shadow: -12px 0 56px rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(100%);
    transition: transform .45s var(--cbh-ease);
    will-change: transform;
}

.cb-sidebar.is-open .cb-sidebar__panel { transform: translateX(0); }

/* Head */
.cb-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.cb-sidebar__logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

/* Logo sidebar — sin atributos inline en HTML, tamaño por CSS */
.cb-sidebar__logo-link img.cb-sidebar__logo,
.cb-sidebar__logo {
    height: 52px !important;
    width: auto !important;
    max-width: none !important;
    display: block !important;
    object-fit: contain !important;
}

.cb-sidebar__close {
    background: rgba(255,255,255,.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    flex-shrink: 0;
    transition: background .25s, transform .3s;
    -webkit-tap-highlight-color: transparent;
}

.cb-sidebar__close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.cb-sidebar__close svg { width: 20px; height: 20px; }

/* Sidebar nav */
.cb-sidebar__nav { flex: 1; padding: 8px 0; overflow-y: auto; }

.cb-sidebar__menu { list-style: none; margin: 0; padding: 0; }

.cb-sidebar__item { border-bottom: 1px solid rgba(255,255,255,.07); }

.cb-sidebar__link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    letter-spacing: .04em !important;
    padding: 18px 28px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: background .2s, padding-left .25s !important;
    -webkit-tap-highlight-color: transparent;
}

.cb-sidebar__link:hover,
.cb-sidebar__link:focus {
    background:       rgba(255,255,255,.14) !important;
    background-color: rgba(255,255,255,.14) !important;
    color:            #ffffff !important;
    padding-left:     36px !important;
    outline:          none !important;
}

/* Sidebar chevron */
.cb-sidebar__chevron {
    width: 18px; height: 18px;
    flex-shrink: 0;
    transition: transform .35s var(--cbh-ease);
}

.cb-sidebar__sub-trigger[aria-expanded="true"] .cb-sidebar__chevron {
    transform: rotate(180deg);
}

/* Sidebar submenu */
.cb-sidebar__submenu {
    list-style: none;
    margin: 0; padding: 4px 0 8px;
    max-height: 0;
    overflow: hidden;
    background: rgba(0,0,0,.2);
    transition: max-height .4s var(--cbh-ease), opacity .35s;
    opacity: 0;
}

.cb-sidebar__submenu.cb-is-open { max-height: 400px; opacity: 1; }

.cb-sidebar__submenu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    padding: 12px 28px 12px 42px;
    transition: color .2s, background .2s;
}

.cb-sidebar__submenu li a::before { content: '–'; color: #5b4aff; flex-shrink: 0; }
.cb-sidebar__submenu li a:hover   { color: #ffffff; background: rgba(255,255,255,.07); }

/* Sidebar social */
.cb-sidebar__social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px 24px 34px;
    border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cb-sidebar__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #ffffff;
    text-decoration: none;
    transition: background .3s, transform .3s, box-shadow .3s;
    -webkit-tap-highlight-color: transparent;
}

.cb-sidebar__social-link svg { width: 19px; height: 19px; }
.cb-sidebar__social-link:hover { transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.cb-sidebar__social-link--facebook:hover  { background: #1877f2; }
.cb-sidebar__social-link--instagram:hover { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.cb-sidebar__social-link--linkedin:hover  { background: #0a66c2; }
.cb-sidebar__social-link--youtube:hover   { background: #ff0000; }
.cb-sidebar__social-link--whatsapp:hover  { background: #25d366; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Móvil ≤767 */
@media (max-width: 767px) {
    body { padding-top: 0 !important; }

    #cb-header { height: var(--cbh-h-mob) !important; }

    .cb-header__inner { padding: 0 18px !important; }

    /* Logo más grande en móvil */
    #cb-header .cb-header__logo,
    .cb-header__logo-link img.cb-header__logo {
        height: 48px !important;
    }

    .cb-header__nav { display: none !important; }

    /* Burger visible solo aquí */
    #cb-burger,
    .cb-burger,
    #cb-header #cb-burger {
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* Tablet 768–1199 */
@media (min-width: 768px) and (max-width: 1199px) {
    .cb-header__inner { padding: 0 28px !important; }

    #cb-header .cb-header__nav .cb-header__link,
    #cb-header .cb-header__nav a.cb-header__link {
        padding: 10px 14px !important;
        font-size: 0.875rem !important;
    }
}
