:root {
    --bet-header-height: 84px;
    --bet-header-mobile-height: 132px;
    --bet-header-max-width: 1440px;
    --bet-header-inline-space:  20px;
    --bet-header-bg: linear-gradient(180deg, #2d2d2d 0%, #050505 100%);
    --bet-header-panel: #080b12;
    --bet-header-text: #c5cce0;
    --bet-header-text-strong: #ffffff;
    --bet-header-accent: #ffd60e;
    --bet-header-accent-hover: #ffe669;
    --bet-header-success: #3ccc87;
    --bet-header-border: rgba(255, 255, 255, 0.1);
    --bet-header-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    --bet-header-transition: 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --bet-menu-bottom-space: calc(70px + env(safe-area-inset-bottom, 0px));
}

.wp-site-blocks {
    padding-top: var(--bet-header-height);
}

.header-fixed {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    margin: 0;
    background: var(--bet-header-bg);
    border-bottom: 1px solid transparent;
    transition:
            border-color var(--bet-header-transition),

            top 180ms ease;
}

.header-fixed.is-scrolled {
    border-bottom-color: var(--bet-header-border);
}

.header-inner {
    display: grid;
    grid-template-columns: minmax(108px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(14px, 2vw, 32px);
    width: min(100%, var(--bet-header-max-width));
    min-height: var(--bet-header-height);
    margin: 0 auto;
    padding: 12px var(--bet-header-inline-space);
    box-sizing: border-box;
}

/* Logo */

.header-logo {
    position: relative;
    justify-self: start;
    margin: 0;
}

.header-logo .custom-logo-link,
.header-logo a {
    display: inline-flex;
    align-items: center;
}

.header-logo img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container{
    background: var(--bet-header-bg);
}

/* Desktop navigation */

.header-nav-wrap {
    width: 100%;
    margin: 0;
    justify-self: center;
}

.header-nav-wrap .wp-block-navigation__container {

    justify-content: center;
    gap: clamp(14px, 1.8vw, 30px);
}

.header-nav-wrap .wp-block-navigation-item__content {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 6px 0;
    color: var(--bet-header-text);
    font-size: clamp(16px, 1.15vw, 19px);
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: .2s ease;
}

.header-nav-wrap .wp-block-navigation-item__content::after {
    position: absolute;
    right: 0;
    bottom: 3px;
    left: 0;
    height: 2px;
    content: "";
    background: var(--bet-header-accent);
    border-radius: 999px;
    opacity: 0;
    transform: scaleX(0.45);
    transition: 180ms ease;
}

.header-nav-wrap .wp-block-navigation-item__content:hover,
.header-nav-wrap .wp-block-navigation-item__content:focus-visible,
.header-nav-wrap .current-menu-item > .wp-block-navigation-item__content {
    color: var(--bet-header-text-strong);
    font-weight: 400;
}

.header-nav-wrap .wp-block-navigation-item__content:hover::after,
.header-nav-wrap .wp-block-navigation-item__content:focus-visible::after,
.header-nav-wrap .current-menu-item > .wp-block-navigation-item__content::after {
    opacity: 1;
    transform: scaleX(1);
}

.header-nav-wrap .wp-block-navigation__submenu-icon {
    color: currentColor;
    transition: transform 180ms ease;
}

.header-nav-wrap .wp-block-navigation-item__description {
    display: block;
    margin-top: 3px;
    color: #97a4c3;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: none;
}

/* Header actions */

.header-actions.wp-block-buttons {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
    margin: 0;
}

.header-actions .wp-block-button {
    flex: 0 0 auto;
    margin: 0;
}

.header-actions .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: 180ms ease;
}


.header-actions .btn-prime .wp-block-button__link {
    color: #fff;
    background: transparent;
    border-color: var(--bet-header-success);
}

.header-actions .btn-prime .wp-block-button__link:hover,
.header-actions .btn-prime .wp-block-button__link:focus-visible {
    color: #07110c;
    background: var(--bet-header-success);
    border-color: var(--bet-header-success);
}

.admin-bar .header-fixed {
    top: 32px;
}

/* Desktop submenu */

@media (min-width: 783px) {

    .header-nav-wrap .wp-block-navigation__submenu-container {
        top: calc(100% + 10px);
        min-width: 230px;
        padding: 10px;
        color: var(--bet-header-text);
        border: 1px solid var(--bet-header-border);
        border-radius: 14px;
        backdrop-filter: blur(14px);
    }

    .header-nav-wrap .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
        width: 100%;
        min-height: 40px;
        padding: 9px 12px;
        border-radius: 9px;
        color: var(--bet-header-text);
        background-color: transparent;
        font-size: 15px;
    }

    .header-nav-wrap .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after {
        display: none;
    }

    .header-nav-wrap .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
    .header-nav-wrap .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
        color: #000;
        background-color: var(--bet-header-accent);
    }
}

/* Compact desktop / small laptop */

@media (min-width: 783px) and (max-width: 1100px) {
    .header-inner {
        gap: 14px;
        padding-inline: 18px;
    }

    .header-logo img {
        width: 108px;
    }

    .header-nav-wrap .wp-block-navigation__container {
        gap: 14px;
    }

    .header-nav-wrap .wp-block-navigation-item__content {
        font-size: 16px;
    }

    .header-actions.wp-block-buttons {
        gap: 8px;
    }

    .header-actions .wp-block-button__link {
        min-height: 42px;
        padding-inline: 15px;
        font-size: 13px;
    }
}

/*
 * Mobile and tablet navigation.
 * 782px matches the WordPress admin-bar breakpoint. The stronger selectors in
 * this section intentionally override the native Navigation block breakpoint.
 */

@media (max-width: 782px) {

    .wp-site-blocks {
        padding-top: var(--bet-header-mobile-height);
    }
    .admin-bar .wp-site-blocks {
        padding-top: calc(var(--bet-header-mobile-height) + 46px);
    }

    .header-fixed {
        min-height: var(--bet-header-mobile-height);
    }

    .admin-bar .header-fixed {
        top: 46px;
    }

    .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "logo navigation"
            "actions actions";
        gap: 10px 16px;
        min-height: var(--bet-header-mobile-height);
        padding: 12px 16px 14px;
    }

    .header-logo {
        grid-area: logo;
    }

    .header-logo img {
        width: clamp(104px, 27vw, 126px);
        max-height: 42px;
    }

    .header-nav-wrap {
        grid-area: navigation;
        width: auto;
        justify-self: end;
    }

    .header-actions.wp-block-buttons {
        grid-area: actions;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .header-actions .wp-block-button,
    .header-actions .wp-block-button__link {
        width: 100%;
    }

    .header-actions .wp-block-button__link {
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 14px;
    }

    /* Keep the external logo and CTA buttons above the WordPress overlay. */

    .header-fixed.is-menu-open .header-logo,
    .header-fixed.is-menu-open .header-actions {
        z-index: 1302;
        pointer-events: auto;
    }

    .header-fixed.is-menu-open .header-logo a,
    .header-fixed.is-menu-open .header-actions a {
        pointer-events: auto;
    }

    /* Burger button */

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-open,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-open:not(.always-shown) {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        padding: 0;
        color: #fff;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        visibility: visible;
        transition: 180ms ease;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-open:hover,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-open:focus-visible {
        color: #000;
        background: var(--bet-header-accent);
        border-color: var(--bet-header-accent);
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-open svg {
        width: 27px;
        height: 27px;
    }

    .header-fixed.is-menu-open .wp-block-navigation__responsive-container-open {
        opacity: 0;
        pointer-events: none;
        transform: rotate(45deg) scale(0.82);
    }

    /* Navigation panel. The reserved bottom area remains available for a CTA. */

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container:not(.is-menu-open) {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 100;
        display: flex;
        width: 100%;
        max-width: none;

        height: 100dvh;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #232939;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        pointer-events: none;
        overscroll-behavior: contain;
        transition: 220ms ease;
    }

    .admin-bar .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container,
    .admin-bar .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container:not(.is-menu-open) {
        top: 46px;
        height: calc(100dvh - 46px);
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container.is-menu-open {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
        transition:
                transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 220ms ease,
                visibility 0s;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-close,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-dialog {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-width: none;
        margin: 0;
        padding: 0;
        background: #232939;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-dialog {
        position: relative;
    }

    /*
     * The native Navigation block adds its own large padding-top to an opened
     * overlay. The second, more specific selector overrides that rule so the
     * first menu item starts directly below the mobile header.
     */
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-content,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content {
        position: absolute;
        top: var(--bet-header-mobile-height);
        right: 0;
        bottom: 0;
        left: 0;
        box-sizing: border-box;
        display: block;
        width: auto;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0 18px var(--bet-menu-bottom-space);
        overflow-x: hidden;
        overflow-y: auto;
        background: #232939;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        scrollbar-color: var(--bet-header-accent) rgba(255, 255, 255, 0.1);
        scrollbar-width: thin;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-content::-webkit-scrollbar {
        width: 5px;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-content::-webkit-scrollbar-thumb {
        background: var(--bet-header-accent);
        border-radius: 999px;
    }

    /* Close button stays in the same top row as the logo. */

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-close {
        position: absolute;
        top: 14px;
        right: 16px;
        z-index: 1304;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        opacity: 0;

        transform: rotate(-35deg) scale(0.82);
        transition: 180ms ease;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
        top: 14px;
        right: 16px;
        margin: 0;
        opacity: 1;
        transform: rotate(0) scale(1);
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-close:hover,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-close:focus-visible {
        color: #111111;
        background: var(--bet-header-accent);
        border-color: var(--bet-header-accent);
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-close svg {
        width: 26px;
        height: 26px;
    }

    /* Mobile menu list */

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation__container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item__content {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 54px;
        padding: 13px 2px;
        color: #fff;
        font-size: 18px;
        font-weight: 500;
        line-height: 1.25;
        white-space: normal;
        transition:180ms ease;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item__content::after {
        display: none;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item__content:hover,
    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item__content:focus-visible,
    .header-fixed .header-nav-wrap .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
        padding-left: 8px;
        color: var(--bet-header-accent);
    }

    /* Mobile submenu accordion */

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 48px;
        align-items: center;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation-item__content {
        grid-column: 1;
        grid-row: 1;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation-submenu__toggle {
        grid-column: 2;
        grid-row: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 54px;
        color: var(--bet-header-accent);
        background: transparent;
        border: 0;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation-submenu__toggle .wp-block-navigation__submenu-icon {
        width: 14px;
        height: 14px;
        margin: 0;
        transition: transform 220ms ease;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation-submenu__toggle[aria-expanded="true"] .wp-block-navigation__submenu-icon {
        transform: rotate(180deg);
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container {
        position: static;
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        max-height: 0;
        overflow: hidden;
        color: #fff;
        background: transparent;
        border: 0;
        border-radius: 0;
        opacity: 0;
        visibility: hidden;
        transform: none;
        pointer-events: none;
        transition:
                max-height 360ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 180ms ease,
                visibility 0s linear 360ms;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation-item.has-child > .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .wp-block-navigation__submenu-container {
        max-height: 1200px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition:
                max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 220ms ease,
                visibility 0s;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item {
        display: block;
        border-bottom: 0;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
        min-height: 44px;
        padding: 10px 2px;
        color: #c9d1e4;
        font-size: 16px;
        font-weight: 400;
    }

    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
    .header-fixed .header-nav-wrap .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
        padding-left: 8px;
        color: var(--bet-header-accent);
    }

    html.bet-navigation-open,
    body.bet-navigation-open {
        overflow: hidden;
    }
}

/* WordPress changes the admin bar to absolute positioning below 600px. */

@media (max-width: 600px) {
    :root {
        --bet-menu-bottom-space: calc(100px + env(safe-area-inset-bottom, 0px));
    }

    html {
        margin-top: 0 !important;
    }

    body.admin-bar #wpadminbar {
        display: none !important;
    }

    body.admin-bar .header-fixed {
        top: 0;
    }

    body.admin-bar .header-nav-wrap .wp-block-navigation__responsive-container-close{
        top: -35px!important;;
    }


    body.admin-bar .wp-site-blocks,
    .wp-site-blocks {
        padding-top: 133px;
    }

    body.admin-bar .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container,
    body.admin-bar .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container:not(.is-menu-open) {
        top: 0;
        height: 100dvh;
    }
}

@media (max-width: 380px) {
    :root {
        --bet-header-mobile-height: 126px;
    }

    .header-inner {
        gap: 8px 10px;
        padding-inline: 12px;
    }

    .header-logo img {
        width: 104px;
    }

    .header-actions.wp-block-buttons {
        gap: 6px;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container-content,
    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content {
        padding-right: 14px;
        padding-left: 14px;
    }

    .header-fixed .header-nav-wrap .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
        right: 12px;
    }
}

.editor-styles-wrapper .wp-site-blocks {
    padding-top: 0;
}

.editor-styles-wrapper .header-fixed {
    position: relative;
    top: auto !important;
}
