:root {
    --bph-bg: #ffffff;
    --bph-green: #009917;
    --bph-dark: #242424;
    --bph-muted: #6c6c6c;
    --bph-line: rgba(36, 36, 36, 0.12);
    --bph-header-h: 94px;
    --bph-header-h-scrolled: 76px;
    --bph-pad-x: clamp(22px, 4vw, 72px);
}

.bph-spacer {
    display: block;
    width: 100%;
    height: var(--bph-header-h);
}

.bph-header,
.bph-header *,
.bph-overlay,
.bph-overlay * {
    box-sizing: border-box;
}

.bph-header {
    position: fixed;
    z-index: 2147483000;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--bph-header-h);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid transparent;
    color: var(--bph-dark);
    isolation: isolate;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition:
        height 220ms cubic-bezier(.22,.61,.36,1),
        border-color 220ms ease,
        box-shadow 220ms ease,
        background-color 220ms ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.bph-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    background: var(--bph-green);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    transition: transform 420ms cubic-bezier(.22,.61,.36,1), opacity 200ms ease;
}

.bph-header.is-scrolled {
    height: var(--bph-header-h-scrolled);
    background: rgba(255, 255, 255, 0.985);
    border-bottom-color: var(--bph-line);
    box-shadow: 0 10px 34px rgba(36, 36, 36, 0.07);
}

.bph-header.is-scrolled::after {
    transform: scaleX(1);
    opacity: 1;
}

.bph-header-inner {
    width: 100%;
    height: 100%;
    padding: 0 var(--bph-pad-x);
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto auto;
    align-items: center;
    gap: clamp(20px, 3vw, 52px);
}

.bph-brand,
.bph-overlay-brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    line-height: 0;
    text-decoration: none;
}

.bph-brand img {
    display: block;
    width: auto;
    height: 56px;
    max-width: 210px;
    object-fit: contain;
    filter: none !important;
    opacity: 1;
    transition: height 220ms cubic-bezier(.22,.61,.36,1), transform 220ms ease, opacity 180ms ease;
}

/* Brand assets must always retain their original colors.
   No CSS filter is applied to PNG, SVG or other logo formats. */
.bph-brand img.bph-logo-raster,
.bph-brand img.bph-logo-svg,
.bph-overlay-brand img.bph-logo-raster,
.bph-overlay-brand img.bph-logo-svg {
    filter: none !important;
    opacity: 1 !important;
}

.bph-header.is-scrolled .bph-brand img {
    height: 47px;
}

.bph-brand:hover img {
    transform: translateY(-1px);
    opacity: 1;
}

.bph-desktop-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.bph-action {
    position: relative;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--bph-dark);
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.135em;
    text-transform: uppercase;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.bph-action span {
    position: relative;
    z-index: 1;
}

.bph-action:hover,
.bph-action:focus-visible {
    transform: translateY(-1px);
}

.bph-action-outline {
    color: var(--bph-dark) !important;
    background: transparent;
}

.bph-action-outline:hover,
.bph-action-outline:focus-visible {
    color: #fff !important;
    background: var(--bph-dark);
    border-color: var(--bph-dark);
}

.bph-action-primary {
    color: #fff !important;
    background: var(--bph-green);
    border-color: var(--bph-green);
    box-shadow: 0 8px 22px rgba(0, 153, 23, 0.16);
}

.bph-action-primary:hover,
.bph-action-primary:focus-visible {
    box-shadow: 0 11px 26px rgba(0, 153, 23, 0.23);
}

.bph-menu-toggle,
.bph-close {
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--bph-dark);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    font: inherit;
}

.bph-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    min-width: 92px;
    min-height: 48px;
}

.bph-menu-label,
.bph-close-label {
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.bph-hamburger {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bph-dark);
    border-radius: 50%;
    transition: background-color 190ms ease, border-color 190ms ease, transform 190ms ease;
}

.bph-hamburger span {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--bph-dark);
    transform: translateX(-50%);
    transition: transform 210ms ease, width 210ms ease, background-color 190ms ease;
}

.bph-hamburger span:first-child {
    transform: translate(-50%, -4px);
}

.bph-hamburger span:last-child {
    width: 12px;
    transform: translate(calc(-50% + 3px), 4px);
}

.bph-menu-toggle:hover .bph-hamburger,
.bph-menu-toggle:focus-visible .bph-hamburger {
    background: var(--bph-green);
    border-color: var(--bph-green);
    transform: rotate(7deg);
}

.bph-menu-toggle:hover .bph-hamburger span,
.bph-menu-toggle:focus-visible .bph-hamburger span {
    width: 18px;
    background: #fff;
}

.bph-menu-toggle:hover .bph-hamburger span:last-child,
.bph-menu-toggle:focus-visible .bph-hamburger span:last-child {
    transform: translate(-50%, 4px);
}

.bph-action:focus-visible,
.bph-menu-toggle:focus-visible,
.bph-close:focus-visible,
.bph-menu-list a:focus-visible,
.bph-overlay-cta:focus-visible,
.bph-socials a:focus-visible,
.bph-brand:focus-visible,
.bph-overlay-brand:focus-visible {
    outline: 2px solid var(--bph-green);
    outline-offset: 4px;
}

/* Layer hardening ---------------------------------------------------------
   JS mounts the visual layers directly under <body>. This prevents Divi
   sections/rows/modules with transform, filter, opacity or local z-index from
   trapping the fixed header inside their own stacking context. */
body > .bph-header,
body > .bph-overlay {
    margin: 0 !important;
    max-width: none !important;
    contain: none !important;
}

body > .bph-header {
    z-index: 2147483000 !important;
}

body > .bph-overlay {
    z-index: 2147483600 !important;
}

body.bph-menu-open > .bph-overlay {
    display: block !important;
}

/* Fullscreen menu */
.bph-overlay {
    position: fixed;
    z-index: 2147483600;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--bph-bg);
    color: var(--bph-dark);
    isolation: isolate;
    transform: translate3d(0, -10px, 0);
    -webkit-transform: translate3d(0, -10px, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 260ms ease,
        transform 360ms cubic-bezier(.22,.61,.36,1),
        visibility 360ms step-end;
    overflow: hidden;
}

.bph-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    transition:
        opacity 260ms ease,
        transform 360ms cubic-bezier(.22,.61,.36,1),
        visibility 0s step-start;
}

.bph-overlay-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: clamp(6px, 0.65vw, 12px);
    height: 100%;
    background: var(--bph-green);
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 520ms cubic-bezier(.22,.61,.36,1) 90ms;
}

.bph-overlay.is-open .bph-overlay-accent {
    transform: scaleY(1);
}

body.bph-menu-open {
    overflow: hidden;
}

.bph-overlay-shell {
    position: relative;
    z-index: 2;
    min-height: 100%;
    padding: 28px var(--bph-pad-x) 32px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 22px;
}

.bph-overlay-top,
.bph-overlay-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.bph-overlay-brand img {
    width: auto;
    height: 58px;
    max-width: 220px;
    object-fit: contain;
    filter: none !important;
    opacity: 1;
}

.bph-close {
    display: inline-flex;
    align-items: center;
    gap: 13px;
}

.bph-close-icon {
    position: relative;
    width: 48px;
    height: 48px;
    display: inline-flex;
    border: 1px solid var(--bph-dark);
    border-radius: 50%;
    transition: transform 190ms ease, background-color 190ms ease, border-color 190ms ease;
}

.bph-close-icon span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--bph-dark);
    transition: background-color 190ms ease;
}

.bph-close-icon span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.bph-close-icon span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.bph-close:hover .bph-close-icon,
.bph-close:focus-visible .bph-close-icon {
    background: var(--bph-green);
    border-color: var(--bph-green);
    transform: rotate(7deg);
}

.bph-close:hover .bph-close-icon span,
.bph-close:focus-visible .bph-close-icon span {
    background: #fff;
}

.bph-overlay-main {
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 22px 0;
}

.bph-nav {
    width: min(1120px, 100%);
}

.bph-menu-list,
.bph-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bph-menu-list {
    counter-reset: bph-item;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(6px, 1.15vh, 15px);
}

.bph-menu-list > li {
    counter-increment: bph-item;
    position: relative;
    margin: 0;
    padding-left: 42px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 420ms ease, transform 420ms cubic-bezier(.22,.61,.36,1);
}

.bph-menu-list > li::before {
    content: counter(bph-item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.6em;
    color: var(--bph-green);
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.bph-overlay.is-open .bph-menu-list > li {
    opacity: 1;
    transform: translateY(0);
}

.bph-overlay.is-open .bph-menu-list > li:nth-child(1) { transition-delay: 90ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(2) { transition-delay: 125ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(3) { transition-delay: 160ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(4) { transition-delay: 195ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(5) { transition-delay: 230ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(6) { transition-delay: 265ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(7) { transition-delay: 300ms; }
.bph-overlay.is-open .bph-menu-list > li:nth-child(8) { transition-delay: 335ms; }

.bph-menu-list li {
    list-style: none;
}

.bph-menu-list > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--bph-dark) !important;
    font-size: clamp(30px, 4.8vw, 70px);
    line-height: 0.98;
    font-weight: 500;
    letter-spacing: -0.025em;
    text-decoration: none !important;
    transition: color 180ms ease, transform 180ms ease;
}

.bph-menu-list > li > a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background: var(--bph-green);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 260ms cubic-bezier(.22,.61,.36,1);
}

.bph-menu-list > li > a:hover,
.bph-menu-list > li > a:focus-visible,
.bph-menu-list > li.current-menu-item > a,
.bph-menu-list > li.current-menu-ancestor > a {
    color: var(--bph-green) !important;
    transform: translateX(6px);
}

.bph-menu-list > li > a:hover::after,
.bph-menu-list > li > a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.bph-menu-list > li.menu-item-has-children {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr);
    align-items: center;
    column-gap: 28px;
}

.bph-menu-list .sub-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 16px;
    max-width: 520px;
}

.bph-menu-list .sub-menu a {
    color: var(--bph-muted) !important;
    font-size: 10px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: color 170ms ease;
}

.bph-menu-list .sub-menu a:hover,
.bph-menu-list .sub-menu a:focus-visible,
.bph-menu-list .sub-menu .current-menu-item > a {
    color: var(--bph-green) !important;
}

.bph-overlay-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--bph-line);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 360ms ease 280ms, transform 360ms ease 280ms;
}

.bph-overlay.is-open .bph-overlay-bottom {
    opacity: 1;
    transform: translateY(0);
}

.bph-overlay-actions,
.bph-socials {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.bph-overlay-cta,
.bph-socials a {
    color: var(--bph-dark) !important;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none !important;
}

.bph-overlay-cta {
    padding: 11px 0;
    border-bottom: 1px solid var(--bph-dark);
    transition: color 170ms ease, border-color 170ms ease;
}

.bph-overlay-cta:hover,
.bph-overlay-cta:focus-visible,
.bph-overlay-cta-primary {
    color: var(--bph-green) !important;
    border-color: var(--bph-green);
}

.bph-socials a {
    color: var(--bph-muted) !important;
    transition: color 170ms ease;
}

.bph-socials a:hover,
.bph-socials a:focus-visible {
    color: var(--bph-green) !important;
}

/* Optional replacement of the standard Divi header */
body.bph-hide-divi-header #main-header,
body.bph-hide-divi-header #top-header {
    display: none !important;
}

/* IMPORTANT: .et-l--header is intentionally NOT hidden.
   Divi Theme Builder places custom headers (including our shortcode) inside it. */

body.bph-hide-divi-header #page-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* WordPress admin bar */
body.admin-bar .bph-header {
    top: 32px;
}

body.admin-bar .bph-overlay {
    top: 32px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}

@media (max-width: 980px) {
    :root {
        --bph-header-h: 78px;
        --bph-header-h-scrolled: 70px;
        --bph-pad-x: clamp(18px, 4.5vw, 34px);
    }

    .bph-header-inner {
        grid-template-columns: 1fr auto;
        gap: 18px;
    }

    .bph-desktop-actions,
    .bph-menu-label {
        display: none;
    }

    .bph-brand img,
    .bph-header.is-scrolled .bph-brand img {
        height: 46px;
        max-width: min(54vw, 180px);
    }

    .bph-menu-toggle {
        min-width: 48px;
        min-height: 48px;
    }

    .bph-overlay-shell {
        padding-top: 20px;
        padding-bottom: 22px;
    }

    .bph-overlay-brand img {
        height: 46px;
        max-width: 180px;
    }

    .bph-overlay-main {
        padding: 16px 0;
    }

    .bph-menu-list {
        gap: 11px;
    }

    .bph-menu-list > li {
        padding-left: 31px;
    }

    .bph-menu-list > li::before {
        top: 0.55em;
        font-size: 8px;
    }

    .bph-menu-list > li > a {
        font-size: clamp(28px, 8.2vw, 48px);
        line-height: 1;
    }

    .bph-menu-list > li.menu-item-has-children {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bph-menu-list .sub-menu {
        max-width: 100%;
        gap: 5px 12px;
    }

    .bph-overlay-bottom {
        align-items: flex-end;
    }
}

@media (max-width: 600px) {
    body.admin-bar .bph-header {
        top: 46px;
    }

    body.admin-bar .bph-overlay {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}

@media (max-width: 560px) {
    .bph-hamburger,
    .bph-close-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .bph-close-label {
        display: none;
    }

    .bph-overlay-top {
        align-items: center;
    }

    .bph-overlay-main {
        align-items: center;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .bph-overlay-main::-webkit-scrollbar {
        display: none;
    }

    .bph-menu-list > li > a {
        font-size: clamp(27px, 9vw, 40px);
    }

    .bph-menu-list .sub-menu a {
        font-size: 9px;
    }

    .bph-overlay-bottom {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        padding-top: 15px;
    }

    .bph-overlay-actions {
        gap: 7px 16px;
    }

    .bph-socials {
        gap: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bph-header,
    .bph-header::after,
    .bph-brand img,
    .bph-action,
    .bph-hamburger,
    .bph-hamburger span,
    .bph-overlay,
    .bph-overlay-accent,
    .bph-menu-list > li,
    .bph-menu-list > li > a,
    .bph-menu-list > li > a::after,
    .bph-overlay-bottom,
    .bph-close-icon {
        transition: none !important;
    }
}
