.floating-header,
.floating-header-nav {
    --floating-dropdown-duration: 220ms;
    --floating-mobile-close-hold: 200ms;
    --floating-mobile-panel-duration: 420ms;
    --floating-motion: cubic-bezier(0.22, 1, 0.36, 1);
    color: var(--floating-header-text-color, var(--black-color));
}

.floating-header__shell {
    transition: height 1s linear;
}

.floating-header__surface {
    --glass-shadow: none;
    background-color: var(--floating-header-background, var(--white-color));
    border: var(--floating-header-border-width, 0) solid var(--floating-header-border-color, transparent);
    box-sizing: border-box;
}

.floating-header__bar {
    height: calc(var(--header-height) - (var(--spacer) * 5));
}

.floating-header__actions {
    align-items: center;
}

.floating-header__menu-toggle,
.floating-header__dropdown-toggle,
.floating-header-nav__back,
.floating-header-nav__backdrop {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    outline-offset: calc(var(--spacer) * 2);
}

.floating-header__menu-toggle {
    padding: 0;
}

#hamburger.floating-header__menu-toggle .bar {
    background: var(--floating-header-icon-color, var(--secondary-color));
}

.floating-header__dropdown-toggle {
    align-items: center;
    display: inline-flex;
    gap: var(--spacer);
    padding: 0;
}

.floating-header__dropdown-toggle .bi {
    display: inline-block;
    flex: 0 0 auto;
    font-size: 0.65em;
    line-height: 1;
}

.floating-header__dropdown-toggle .bi-chevron-down {
    transform: rotate(0);
    transition: transform var(--floating-dropdown-duration) var(--floating-motion);
}

.floating-header__dropdown-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.floating-header__classic .wi-dropdown-list {
    left: 0;
    right: auto;
    transition-duration: var(--floating-dropdown-duration);
}

.floating-header__dropdown {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(var(--spacer) * -2));
    transition:
        clip-path var(--floating-dropdown-duration) var(--floating-motion),
        opacity 160ms ease-out,
        transform var(--floating-dropdown-duration) var(--floating-motion);
}

.floating-header__dropdown[data-dropdown-state="open"] {
    clip-path: inset(0);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.floating-header__dropdown [data-dropdown-content] {
    opacity: 0;
    transform: translateX(calc(var(--spacer) * -4));
    transition:
        opacity 180ms ease-out,
        transform var(--floating-dropdown-duration) var(--floating-motion);
}

.floating-header__dropdown[data-dropdown-state="open"] [data-dropdown-content] {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 140ms;
}

@media (max-width: 768px) {
    .floating-header__actions {
        display: none !important;
    }

    #nav-mobile.floating-header-nav {
        transition-delay: 0s;
        transition-duration: var(--floating-mobile-panel-duration);
        transition-timing-function: var(--floating-motion);
    }

    #nav-mobile.floating-header-nav::before {
        transition-delay: 0s;
        transition-duration: var(--floating-mobile-close-hold);
    }

    .floating-header-nav__backdrop {
        cursor: pointer;
        height: 100%;
        inset: 0;
        padding: 0;
        position: fixed;
        width: 100%;
        z-index: 0;
    }

    #nav-mobile .floating-header-nav__panel {
        --glass-shadow: none;
        background-color: var(--floating-header-background, var(--white-color));
        border: var(--floating-header-border-width, 0) solid var(--floating-header-border-color, transparent);
        border-top: 0;
        border-radius: 0 0 var(--dropdown-border-radius) var(--dropdown-border-radius);
        color: var(--floating-header-text-color, var(--black-color));
        margin-top: calc(var(--spacer) * -1);
        overflow: auto;
        position: relative;
        width: calc(100% - (var(--spacer) * 9));
        z-index: 1;
    }

    #nav-mobile.floating-header-nav--close-hold {
        margin-top: var(--header-height);
        top: 0;
    }

    #nav-mobile.floating-header-nav--close-hold::before {
        opacity: 1;
    }

    .floating-header.is-mobile-open .floating-header__surface {
        border-bottom-color: transparent;
        border-radius: var(--dropdown-border-radius) var(--dropdown-border-radius) 0 0 !important;
        transition: border-color var(--floating-dropdown-duration) var(--floating-motion), border-radius var(--floating-dropdown-duration) var(--floating-motion);
    }

    #nav-mobile .nav-list .nav {
        left: -110%;
    }

    #nav-mobile .floating-header__dropdown-toggle {
        display: flex;
        justify-content: space-between;
    }

    #nav-mobile .floating-header-nav__action .btn {
        box-sizing: border-box;
        display: inline-flex;
        justify-content: center;
        width: 100%;
    }

    #nav-mobile .floating-header-nav__back {
        align-items: center;
    }

    #nav-mobile .floating-header-nav__back .bi {
        flex: 0 0 auto;
        font-size: 0.65em;
        line-height: 1;
    }

    #nav-mobile.floating-header-nav--closing .nav-list .nav {
        left: -110%;
        opacity: 0;
        transition-delay: 0s;
        transition-duration: 180ms;
    }

    #nav-mobile.floating-header-nav--closing [data-dropdown-content] {
        opacity: 0;
        transform: translateX(calc(var(--spacer) * -4));
        transition-delay: 0s;
        transition-duration: 180ms;
    }

}

@media (prefers-reduced-motion: reduce) {
    .floating-header__shell,
    .floating-header__surface,
    .floating-header__dropdown,
    .floating-header__dropdown [data-dropdown-content],
    .floating-header__classic .wi-dropdown-list,
    .floating-header__dropdown-toggle .bi-chevron-down,
    #nav-mobile.floating-header-nav,
    #nav-mobile.floating-header-nav::before,
    #nav-mobile.floating-header-nav .nav-list .nav {
        transition-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}
