header {
    position: sticky;
    top: var(--admin-bar-offset, 0px);
    background-color: #FFFFFF;
    z-index: 1000;
}

.cb-header {
    width: 100%;
    padding: 16px;
}
.cb-header__inner {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 10000;
    background-color: #fff;
}
.cb-header__logo {
    height: 50px;
    width: auto;
    display: block;
}
.cb-header__logo-link {
    flex-shrink: 0;
}
.cb-header__site-title {
    font-weight: 700;
    font-size: 18px;
    color: #000;
}

/* Menu */
.cb-header__nav {
    flex: 1;
}
.cb-header__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.cb-header__menu > li > a {
    color: #000;
    text-align: center;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 26px;
    text-transform: capitalize;
    padding: 8px;
    display: block;
    text-decoration: none;
    transition: all .2s ease;
}
.cb-header__menu li {
    position: relative;
}

.cb-header__menu li .sub-menu {
    list-style: none;
    margin: 0;
    padding: 32px 0px;
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    width: 240px;
    background: #fff;
    display: none;
    z-index: 50;
    flex-direction: column;
    border-top: 1px solid #dfdfdf;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04),
        0 8px 24px 0 rgba(0, 0, 0, 0.08);
}

.cb-header__menu > li > .sub-menu {
    border-bottom-left-radius: 4px;
}
.cb-header__menu > li > .sub-menu > li > .sub-menu {
    border-bottom-right-radius: 4px;
}

.cb-header__menu li .sub-menu li {
    width: 100%;
    padding: 0px 32px;
}

.cb-header__menu li .sub-menu li a {
    display: block;
    padding: 0px;
    color: #000;
    font-size: 14px;
    line-height: 22px;
    text-transform: capitalize;
    text-decoration: none;
    transition: all .2s ease;
}
.cb-header__menu li .sub-menu li.menu-item-has-children > a {
    display: flex;
    align-items: center;
}
.cb-header__menu li .sub-menu li.menu-item-has-children > a::after {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-block;
    margin-left: auto;
    background-color: #5C5C5C;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
        no-repeat center / contain;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
        no-repeat center / contain;
}
.cb-header__menu li:hover > .sub-menu {
    display: flex;
}
.cb-header__menu li .sub-menu:hover {
    display: flex;
}
.cb-header__menu li .sub-menu li:hover > .sub-menu {
    display: flex;
}
.cb-header__menu li .sub-menu::before {
    content: "";
    position: absolute;
    top: -21px;
    left: 0;
    height: 20px;
    width: 100%;
}

.cb-header__menu-search {
    flex-shrink: 0;
}

/* Bridge gap between parent and right-flyout submenu to prevent hover loss */
.cb-header__menu li .sub-menu li .sub-menu::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 0;
    width: 20px;
    height: 100%;
}

/* Second-level submenu position and styling (desktop) */
.cb-header__menu li .sub-menu li .sub-menu {
    top: -33px;
    left: 239px;
    background: #f5f5f5;
    border-top: 1px solid #f5f5f5;
    box-shadow: 2px 1px 3px 0 rgba(0, 0, 0, 0.04),
        8px 12px 24px 0 rgba(0, 0, 0, 0.08);
    max-height: 315px;
    overflow-y: auto;
}

.cb-header__menu li .sub-menu li .sub-menu::-webkit-scrollbar {
    width: 4px;
}
.cb-header__menu li .sub-menu li .sub-menu::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0px;
}
.cb-header__menu li .sub-menu li .sub-menu::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 0px;
}

/* Chevron for items with dropdown */
.cb-header__menu > li.menu-item-has-children > a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.cb-header__menu > li.menu-item-has-children > a::after {
    content: "";
    width: 18px;
    height: 18px;
    display: inline-block;
    background-color: #5C5C5C;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
        no-repeat center / contain;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
        no-repeat center / contain;
}

/* Hover colors */
.cb-header__menu > li:hover > a,
.cb-header__menu > li > a:hover {
    color: #8D0F10;
}
.cb-header__menu li .sub-menu li a:hover {
    color: #8D0F10;
}

/* Right side */
.cb-header__right {
    display: flex;
    align-items: center;
}

.cb-header__cta {
    display: flex;
    padding: 8px 20px;
    align-items: center;
    gap: 6px;
    border-radius: 44px;
    background: #000;
    text-decoration: none;
    transition: all .2s ease;
}
.cb-header__cta:hover,
.cb-header__cta:active {
    background: #8D0F10;
}
.cb-header__cta:hover .cb-header__cta-number,
.cb-header__cta:active .cb-header__cta-number {
    color: #8D0F10;
}
.cb-header__cta-text {
    color: #fff;
    text-align: center;
    font-size: 16.5px;
    font-style: normal;
    font-weight: 700;
    line-height: 26px;
    text-transform: capitalize;
}
.cb-header__cta-number {
    border-radius: 24px;
    background: #fff;
    display: flex;
    padding: 2px 6px 2px 6px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 900;
    color: #000;
    transition: all .2s ease;
}
.cb-header__search {
    flex-shrink: 0;
    padding: 7px;
    cursor: pointer;
}
.cb-header__search-icon {
    width: 20px;
    height: 20px;
    display: block;
    cursor: pointer;
}
.cb-header__search--right {
    display: none;
}
.cb-header__hamburger {
    display: none;
    cursor: pointer;
}

/* Search modal wrapper */
.cb-header-search-modal {
    display: none;
    width: 100%;
    padding: 32px;
    position: absolute;
    top: calc(var(--header-offset, 120px) - var(--admin-bar-offset, 0px));
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
    border-top: 1px solid #dfdfdf;
    background: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04),
        0 8px 24px 0 rgba(0, 0, 0, 0.08);
}

.cb-header-search-modal.is-open {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-height: calc(100vh - var(--header-offset, 120px));
    overflow-y: auto;
}

/* Overlay backdrop */
.cb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9990;
}
.cb-overlay.is-visible {
    display: block;
}
.cb-header-search-modal__inner {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
}

.cb-header-search-close {
    font-family: inherit;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.cb-header-search-close__label {
    color: #000;
    text-align: center;
    font-size: 16.5px;
    font-style: normal;
    font-weight: 700;
    line-height: 26px;
    text-transform: capitalize;
}
.cb-header-search-close__icon {
    width: 24px;
    height: 24px;
}

/* Search form */
.cb-search-form {
    display: flex;
    height: 48px;
    padding: 0 16px;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    border-radius: 4px;
    border: 1px solid #dfdfdf;
    background: #fff;
    width: 100%;
    max-width: 600px;
}

.cb-search-form-wrapper {
    width: 100%;
    display: flex;
    position: relative;
    justify-content: center;
}

.cb-search-form:focus-within {
    border-color: #000;
}
.cb-search-input {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 24px;
}
.cb-search-submit {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.cb-search-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 600px;
}
.cb-search-links a {
    color: #000;
    font-size: 16.5px;
    line-height: 26px;
    text-decoration: underline;
}

/* Hide mobile menu on desktop */
.cb-mobile-menu {
    display: none;
}

@media (max-width: 992px) {
    .cb-header {
        padding: 0px;
    }
    .cb-header__inner {
        padding: 4px;
    }
    .cb-header__logo {
        height: 40px;
    }
    .cb-header__left {
        display: flex;
        align-items: center;
    }
    .cb-header__hamburger {
        flex-shrink: 0;
        display: block;
        padding: 16px;
        cursor: pointer;
    }
    .cb-header__hamburger-icon {
        display: block;
        width: 24px;
        height: 24px;
        object-fit: contain;
    }
    .cb-header__nav {
        display: none;
    }
    .cb-header__search {
        padding: 16px;
        cursor: pointer;
    }
    .cb-header__search-icon {
        width: 24px;
        height: 24px;
    }
    .cb-header__search--right {
        display: block;
    }
    .cb-header__cta {
        padding: 8px 12px;
        position: relative;
    }
    .cb-header__cta-text {
        color: #fff;
        text-align: center;
        font-size: 14px;
        font-style: normal;
        font-weight: 700;
        line-height: 16px;
    }
    .cb-header__cta-number {
        position: absolute;
        top: -8px;
        right: 3px;
        padding: 0 6px;
        border-radius: 24px;
        border: 1px solid #dfdfdf;
        background: #fff;
        line-height: 14px;
    }

    .cb-header-search-modal {
        position: fixed;
        right: 0;
        top: var(--header-offset, 64px);
        left: calc(100% - 321px);
        bottom: 0;
        width: 321px;
        display: flex;
        padding: 24px;
        flex-direction: column;
        align-items: center;
        flex: 1 0 0;
        align-self: stretch;
        background: #dd3333;
        transform: translateX(100%);
        transition: transform 0.32s ease-out, opacity 0.32s ease-out;
        opacity: 0;
        pointer-events: none;
        z-index: 9999;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04),
            0 8px 24px 0 rgba(0, 0, 0, 0.08);
        border-top: none;
        border-radius: 0 0 4px 4px;
        overflow-y: auto;
    }
    .cb-header-search-modal.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        z-index: 9999;
        max-height: calc(100dvh - var(--header-offset, 64px));
    }

    .cb-header .cb-search-form {
        border: none;
        width: 100%;
    }
    .cb-header-search-modal__inner {
        gap: 24px;
        position: relative;
    }
    .cb-header-search-close {
        display: none;
    }
    .cb-search-links {
        width: 100%;
        gap: 24px;
        margin-top: 0;
    }
    .cb-search-links a {
        color: #fff;
        font-size: 16px;
        text-decoration: none;
    }

    /* Mobile menu drawer */
    .cb-mobile-menu {
        position: fixed;
        left: 0;
        top: var(--header-offset, 64px);
        height: calc(100dvh - var(--header-offset, 64px));
        width: 321px;
        background: #dd3333;
        transform: translateX(-100%);
        transition: transform 0.32s ease-out, opacity 0.32s ease-out;
        opacity: 0;
        pointer-events: none;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .cb-mobile-menu.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    .cb-mobile-menu__nav {
        width: 100%;
    }
    .cb-mobile-menu__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .cb-mobile-menu__list > li > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 24px;
        width: 100%;
        color: #fff;
        text-decoration: none;
        font-size: 17px;
        line-height: 26px;
        font-weight: 700;
    }
    .cb-mobile-menu__list > li.menu-item-has-children > a {
        display: flex;
        align-items: center;
        gap: 2px;
        position: relative;
        padding-right: 56px;
    }
    .cb-mobile-menu__list > li.menu-item-has-children > a::before {
        content: "";
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.1);
    }
    .cb-mobile-menu__list > li.menu-item-has-children > a::after {
        content: "";
        position: absolute;
        right: 23px;
        top: 50%;
        transform: translateY(-50%);
        transform-origin: 50% 50%;
        width: 18px;
        height: 18px;
        background-color: #FFFFFF;
        -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
            no-repeat center / contain;
        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
            no-repeat center / contain;
    }
    .cb-mobile-menu__list > li.menu-item-has-children.is-expanded > a::after {
        transform: translateY(-50%) rotate(180deg);
    }
    .cb-mobile-menu__list li .sub-menu {
        background: #ba1c1e;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.32s ease-out;
        list-style: none;
        padding: 0px 24px;
        margin: 0;
    }

    .cb-mobile-menu__list li .sub-menu li {
        border-top: 1px solid #8d0f10;
    }

    .cb-mobile-menu__list li .sub-menu li .sub-menu {
        padding: 0px 16px;
    }

    .cb-mobile-menu__list li .sub-menu li .sub-menu li {
        border-top: none;
    }
    .cb-mobile-menu__list li .sub-menu li .sub-menu li a {
        font-weight: 400;
        line-height: 26px;
        padding: 0px 0px 16px 0px;
    }
    .cb-mobile-menu__list li .sub-menu li .sub-menu li:first-of-type a {
        padding-top: 4px;
    }
    .cb-mobile-menu__list > li.menu-item-has-children.is-expanded {
        background: #ba1c1e;
    }

    .cb-mobile-menu__list li .sub-menu li a {
        display: block;
        padding-left: 32px;
        margin: 0;
        width: 100%;
        color: #fff;
        text-decoration: none;
        font-size: 16px;
        line-height: 26px;
        font-weight: 700;
        padding: 11px 12px 11px 8px;
        position: relative;
    }

    .cb-mobile-menu__list li .sub-menu > li.menu-item-has-children > a::after {
        content: "";
        position: absolute;
        right: 0px;
        top: 50%;
        transform: translateY(-50%);
        transform-origin: 50% 50%;
        width: 18px;
        height: 18px;
        background-color: #FFFFFF;
        -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
            no-repeat center / contain;
        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>")
            no-repeat center / contain;
    }
    .cb-mobile-menu__list
        li
        .sub-menu
        > li.menu-item-has-children.is-expanded
        > a::after {
        transform: translateY(-50%) rotate(180deg);
    }
    .cb-mobile-menu__list li .sub-menu li .sub-menu li a {
        padding-left: 0;
        padding-right: 0;
    }
    .cb-mobile-menu__list li .sub-menu li:last-child a {
        padding-bottom: 16px;
    }
}

@media (max-width: 880px) {
    .cb-header-search-close__label {
        display: none;
    }
}
