/* Custom Header Builder — frontend styles */

.chb-topbar {
    background: var(--chb-topbar-bg);
    color: var(--chb-topbar-text);
    font-size: 13px;
    padding: 6px 0;
}
.chb-topbar a { color: var(--chb-topbar-text); text-decoration: none; }
.chb-topbar a:hover { opacity: .8; }
.chb-topbar .chb-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.chb-topbar-right { display: flex; gap: 16px; }

.chb-header {
    background: var(--chb-bg);
    color: var(--chb-text);
    border-bottom: var(--chb-border);
    box-shadow: var(--chb-shadow);
    position: relative;
    z-index: 999;
    width: 100%;
}
.chb-header.chb-sticky {
    position: sticky;
    top: 0;
}

.chb-header .chb-container {
    max-width: var(--chb-container);
    margin: 0 auto;
    padding: 0 20px;
    min-height: var(--chb-height);
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
}

.chb-brand { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }
.chb-logo img {
    height: var(--chb-logo-height);
    width: auto;
    display: block;
}
.chb-site-title {
    font-size: var(--chb-site-title-size, 22px);
    font-weight: 700;
    color: var(--chb-text);
    text-decoration: none;
}
.chb-page-title {
    font-size: var(--chb-page-title-size, 16px);
    font-weight: 600;
    color: var(--chb-page-title);
    line-height: 1.2;
    padding-left: 14px;
    border-left: 1px solid rgba(0,0,0,.1);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chb-nav-wrap { flex: 1 1 auto; }
.chb-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.chb-menu li { position: relative; }
.chb-menu a {
    color: var(--chb-link);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 4px;
    display: inline-block;
    transition: color .2s ease;
}
.chb-menu a:hover,
.chb-menu .current-menu-item > a { color: var(--chb-link-hover); }

/* Sub-menu */
.chb-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--chb-bg);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: 4px;
    display: none;
    z-index: 1000;
}
.chb-menu li:hover > .sub-menu,
.chb-menu li:focus-within > .sub-menu { display: block; }
.chb-menu .sub-menu li { width: 100%; }
.chb-menu .sub-menu a { padding: 8px 16px; display: block; }

/* Layouts */
.chb-layout-logo-center .chb-container { flex-direction: column; padding: 12px 20px; }
.chb-layout-logo-center .chb-nav-wrap { width: 100%; }
.chb-layout-logo-center .chb-menu { justify-content: center; }
.chb-layout-logo-right .chb-brand { order: 3; }
.chb-layout-logo-right .chb-nav-wrap { order: 1; }
.chb-layout-logo-right .chb-menu { justify-content: flex-start; }
.chb-layout-split .chb-container { justify-content: space-between; }
.chb-layout-split .chb-menu { justify-content: space-between; flex: 1; }

/* Mobile toggle (hamburguesa de 3 rayitas) */
.chb-toggle {
    display: none !important;
    margin-left: auto;
    background: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    padding: 8px;
    box-sizing: content-box;
    width: var(--chb-toggle-size, 26px);
    height: auto;
    flex-direction: column;
    justify-content: center;
    gap: calc(var(--chb-toggle-size, 26px) * 0.22);
    align-items: center;
}
.chb-toggle:focus,
.chb-toggle:focus-visible,
.chb-toggle:hover,
.chb-toggle:active {
    border: 0;
    outline: none;
    box-shadow: none;
}
.chb-toggle span {
    display: block;
    width: var(--chb-toggle-size, 26px);
    height: calc(var(--chb-toggle-size, 26px) * 0.12);
    min-height: 2px;
    background: var(--chb-toggle-color, var(--chb-text, #222));
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.chb-header.is-open .chb-toggle span:nth-child(1) { transform: translateY(calc(var(--chb-toggle-size, 26px) * 0.34)) rotate(45deg); }
.chb-header.is-open .chb-toggle span:nth-child(2) { opacity: 0; }
.chb-header.is-open .chb-toggle span:nth-child(3) { transform: translateY(calc(var(--chb-toggle-size, 26px) * -0.34)) rotate(-45deg); }

