/* ═══════════════════════════════════════════════════════════════
   VB Responsive Header — Frontend Stylesheet
   Author: Victor Busayo | v1.0.0
   All visual tokens are driven by --vbh-* CSS custom properties
   injected inline from the WordPress settings panel.
═══════════════════════════════════════════════════════════════ */

/* ── RESET ── */
.vbh-header *,
.vbh-header *::before,
.vbh-header *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── OUTER WRAPPER ── */
.vbh-header {
    width: 100%;
    background-color: var(--vbh-bg, #ffffff);
    box-shadow: var(--vbh-shadow, 0 1px 4px rgba(0,0,0,0.06));
    border-radius: var(--vbh-radius, 0);
    z-index: var(--vbh-z-index, 9999);
    font-family: var(--vbh-font-family, inherit);
}

/* Position variants */
.vbh-position-sticky { position: sticky; top: 0; }
.vbh-position-fixed  { position: fixed;  top: 0; left: 0; right: 0; }
.vbh-position-relative { position: relative; }

/* ── INNER CONTAINER ── */
.vbh-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--vbh-height-desktop, 72px);
}

/* ── LOGO ── */
.vbh-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.vbh-logo img,
.vbh-logo-widget img,
.vbh-logo a img {
    max-width:  var(--vbh-logo-max-width,  180px);
    max-height: var(--vbh-logo-max-height, 50px);
    width: auto;
    height: auto;
    display: block;
}

.vbh-logo-placeholder {
    font-size: 13px;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
    white-space: nowrap;
}

/* ── DESKTOP NAV ── */
.vbh-nav { display: flex; align-items: center; flex: 1; }

.vbh-nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.vbh-nav-list li { position: relative; }

.vbh-nav-list a,
.vbh-nav-list > li > a {
    display: block;
    padding: 0.45rem 0.9rem;
    font-size: var(--vbh-font-size, 15px);
    font-weight: var(--vbh-font-weight, 400);
    color: var(--vbh-text, #1a1a2e);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.vbh-nav-list a:hover,
.vbh-nav-list a:focus-visible,
.vbh-nav-list .current-menu-item > a,
.vbh-nav-list .current_page_item > a {
    color: var(--vbh-link-hover, #e94560);
    outline: none;
}

.vbh-nav-list a:focus-visible {
    box-shadow: 0 0 0 2px var(--vbh-link-hover, #e94560);
}

/* Drop-down sub-menus */
.vbh-nav-list .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--vbh-bg, #ffffff);
    border: 1px solid var(--vbh-border, rgba(0,0,0,0.08));
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    list-style: none;
    padding: 6px 0;
    z-index: 100;
    flex-direction: column;
}

.vbh-nav-list li:hover > .sub-menu,
.vbh-nav-list li:focus-within > .sub-menu { display: flex; }

.vbh-nav-list .sub-menu a {
    padding: 0.55rem 1.1rem;
    border-radius: 0;
    font-size: calc( var(--vbh-font-size, 15px) - 1px );
}

/* ── DESKTOP CTA ── */
.vbh-cta-desktop {
    flex-shrink: 0;
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: var(--vbh-cta-align, center);
    gap: var(--vbh-cta-gap, 8px);
    min-width:  var(--vbh-cta-min-width,  auto);
    min-height: var(--vbh-cta-min-height, auto);
    padding: var(--vbh-cta-padding-y, 0px) var(--vbh-cta-padding-x, 0px);
    box-sizing: border-box;
}

/* Every wrapper layer inside CTA gets flex so WP widget divs never collapse */
.vbh-cta-desktop .vbh-cta-widget,
.vbh-cta-desktop > div {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: var(--vbh-cta-align, center);
    gap: var(--vbh-cta-gap, 8px);
    min-width: inherit;
    box-sizing: border-box;
}

/* Elementor and Gutenberg inner wrapper layers */
.vbh-cta-desktop .elementor-widget-container,
.vbh-cta-desktop .elementor-widget-wrap,
.vbh-cta-desktop .wp-block-buttons,
.vbh-cta-desktop .wp-block-button {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: var(--vbh-cta-align, center);
    gap: var(--vbh-cta-gap, 8px);
}

/* Anchors and buttons stay inline on desktop — no forced full-width */
.vbh-cta-desktop a,
.vbh-cta-desktop button,
.vbh-cta-desktop .elementor-button,
.vbh-cta-desktop .wp-block-button__link {
    flex-shrink: 0;
    white-space: nowrap;
}

.vbh-cta-placeholder {
    font-size: 12px;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
    white-space: nowrap;
}

/* ── HAMBURGER (hidden on desktop) ── */
.vbh-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--vbh-border, rgba(0,0,0,0.08));
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
}

.vbh-hamburger:hover { background: rgba(0,0,0,0.04); }

.vbh-hamburger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--vbh-link-hover, #e94560);
}

.vbh-bar {
    display: block;
    width: 18px;
    height: 1.5px;
    background-color: var(--vbh-hamburger, #1a1a2e);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
                opacity   0.3s cubic-bezier(0.4,0,0.2,1);
    transform-origin: center;
}

/* Hamburger → X animation */
.vbh-hamburger[aria-expanded="true"] .vbh-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.vbh-hamburger[aria-expanded="true"] .vbh-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.vbh-hamburger[aria-expanded="true"] .vbh-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ── MOBILE MENU (hidden by default) ── */
.vbh-mobile-menu {
    display: block;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
    border-top: 1px solid transparent;
    background: var(--vbh-mobile-bg, #ffffff);
}

.vbh-mobile-menu.vbh-open {
    max-height: 80vh;
    border-top-color: var(--vbh-border, rgba(0,0,0,0.08));
    overflow-y: auto;
}

.vbh-mobile-inner {
    padding: 0.5rem 1.5rem 1.5rem;
}

/* Mobile nav list */
.vbh-mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.vbh-mobile-nav-list li {
    border-bottom: 1px solid var(--vbh-border, rgba(0,0,0,0.06));
}

.vbh-mobile-nav-list li:last-child { border-bottom: none; }

.vbh-mobile-nav-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    font-size: var(--vbh-font-size, 15px);
    font-weight: var(--vbh-font-weight, 400);
    color: var(--vbh-text, #1a1a2e);
    text-decoration: none;
    transition: color 0.2s;
}

.vbh-mobile-nav-list a:hover,
.vbh-mobile-nav-list a:focus-visible {
    color: var(--vbh-link-hover, #e94560);
    outline: none;
}

/* Nested items in mobile */
.vbh-mobile-nav-list .sub-menu {
    list-style: none;
    padding-left: 1rem;
}

.vbh-mobile-nav-list .sub-menu a {
    font-size: calc( var(--vbh-font-size, 15px) - 1px );
    color: #6b7280;
    padding: 0.6rem 0;
}

/* ── CTA INSIDE MOBILE MENU ── */
.vbh-cta-mobile {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--vbh-border, rgba(0,0,0,0.08));
    display: flex;
    flex-direction: column;
    gap: var(--vbh-cta-gap, 8px);
}

/* Mobile widget wrapper layers — column stack */
.vbh-cta-mobile .vbh-cta-widget,
.vbh-cta-mobile > div {
    display: flex !important;
    flex-direction: column;
    gap: var(--vbh-cta-gap, 8px);
    width: 100%;
    box-sizing: border-box;
}

/* Elementor / Gutenberg wrappers inside mobile CTA */
.vbh-cta-mobile .elementor-widget-container,
.vbh-cta-mobile .elementor-widget-wrap,
.vbh-cta-mobile .wp-block-buttons,
.vbh-cta-mobile .wp-block-button {
    display: flex !important;
    flex-direction: column;
    gap: var(--vbh-cta-gap, 8px);
    width: 100%;
}

/* Slide-up animation for the CTA when menu opens */
.vbh-open .vbh-cta-mobile {
    animation: vbhSlideUp 0.35s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}

@keyframes vbhSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* All anchors/buttons inside mobile menu go full-width */
.vbh-cta-mobile a,
.vbh-cta-mobile button,
.vbh-cta-mobile .wp-block-button__link,
.vbh-cta-mobile .elementor-button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box;
}

/* ── SCREEN-READER TEXT (WCAG) ── */
.screen-reader-text {
    clip: rect(1px,1px,1px,1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

/* ── RESPONSIVE BREAKPOINT ── */
/* The JS reads --vbh-breakpoint from the root and sets the class
   dynamically. CSS media query is a safe fallback at 768px. */
@media (max-width: 768px) {

    .vbh-container {
        padding: 0 1.25rem;
        height: var(--vbh-height-mobile, 60px);
    }

    /* Hide desktop nav & CTA */
    .vbh-nav,
    .vbh-cta-desktop { display: none !important; }

    /* Show hamburger */
    .vbh-hamburger { display: flex; }
}

/* Utility: Elementor full-width fix */
.elementor-section-full_width .vbh-container,
.e-con-full .vbh-container { max-width: 100%; }
