/* BUSSINMODS — SimulationWorld floating glass header */

body > header.bm-sw-floating-header {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    height: 76px !important;
    min-height: 76px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    border: 1px solid transparent !important;
    border-radius: 0 !important;
    background: rgba(7, 8, 9, .88) !important;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    z-index: 10000 !important;
    transform: none !important;

    transition:
        width .45s cubic-bezier(.22, 1, .36, 1),
        top .45s cubic-bezier(.22, 1, .36, 1),
        height .45s cubic-bezier(.22, 1, .36, 1),
        border-radius .45s cubic-bezier(.22, 1, .36, 1),
        background .45s ease,
        box-shadow .45s ease,
        border-color .45s ease,
        transform .45s cubic-bezier(.22, 1, .36, 1) !important;
}

/* Floating pill state */
body > header.bm-sw-floating-header.bm-sw-scrolled {
    position: fixed !important;
    top: 14px !important;
    left: 50% !important;
    right: auto !important;

    width: min(1080px, calc(100% - 40px)) !important;
    height: 62px !important;
    min-height: 62px !important;

    margin: 0 !important;
    transform: translateX(-50%) !important;

    border: 1px solid rgba(255,255,255,.13) !important;
    border-radius: 22px !important;

    background: rgba(8,11,14,.58) !important;

    backdrop-filter: blur(30px) saturate(170%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(170%) !important;

    box-shadow:
        0 20px 60px rgba(0,0,0,.48),
        0 5px 20px rgba(0,0,0,.25),
        inset 0 1px 0 rgba(255,255,255,.07) !important;

    animation: bmFloatingHeaderIn .35s cubic-bezier(.22,1,.36,1);
}

@keyframes bmFloatingHeaderIn {
    from {
        opacity: .75;
        transform: translateX(-50%) translateY(-12px) scale(.94);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Compress header contents */
body > header.bm-sw-floating-header.bm-sw-scrolled > :first-child {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    display: flex;
    align-items: center;
}

body > header.bm-sw-floating-header.bm-sw-scrolled .logo img {
    max-height: 48px !important;
    width: auto;
    object-fit: contain;
}

body > header.bm-sw-floating-header.bm-sw-scrolled .nav-link,
body > header.bm-sw-floating-header.bm-sw-scrolled .nav-links > a,
body > header.bm-sw-floating-header.bm-sw-scrolled .nav > a,
body > header.bm-sw-floating-header.bm-sw-scrolled .nav-right > a,
body > header.bm-sw-floating-header.bm-sw-scrolled .bm-universal-nav > a,
body > header.bm-sw-floating-header.bm-sw-scrolled .main-navigation > a {
    height: 38px !important;
    min-height: 38px;
    padding-left: 9px !important;
    padding-right: 9px !important;
    box-sizing: border-box;
}

body > header.bm-sw-floating-header.bm-sw-scrolled .header-actions,
body > header.bm-sw-floating-header.bm-sw-scrolled .nav-right {
    transition: transform .35s cubic-bezier(.22,1,.36,1);
    transform: scale(.96);
    transform-origin: right center;
}

/* Keep menus above page content */
body > header.bm-sw-floating-header .category-dropdown,
body > header.bm-sw-floating-header .browse-menu,
body > header.bm-sw-floating-header .nav-dropdown {
    z-index: 10020;
}

/* Preserve the original header space when it becomes fixed */
.bm-sw-header-spacer {
    display: block !important;
    width: 100% !important;
    height: 76px;
    visibility: hidden;
    pointer-events: none;
}

/* Tablet */
@media (max-width: 900px) {
    body > header.bm-sw-floating-header.bm-sw-scrolled {
        width: calc(100% - 24px) !important;
        top: 10px !important;
        border-radius: 18px !important;
    }
}

/* Mobile */
@media (max-width: 600px) {
    body > header.bm-sw-floating-header.bm-sw-scrolled {
        width: calc(100% - 16px) !important;
        height: 58px !important;
        min-height: 58px !important;
        top: 8px !important;
        border-radius: 16px !important;
    }

    body > header.bm-sw-floating-header.bm-sw-scrolled > :first-child {
        width: calc(100% - 20px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body > header.bm-sw-floating-header,
    body > header.bm-sw-floating-header.bm-sw-scrolled {
        transition: none !important;
        animation: none !important;
    }
}

/* BUSSINMODS: vertical alignment correction only */
body > header.bm-sw-floating-header > .container.nav {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

body > header.bm-sw-floating-header .nav-right {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

body > header.bm-sw-floating-header .nav-right > * {
    align-self: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body > header.bm-sw-floating-header .nav-link,
body > header.bm-sw-floating-header .category-trigger,
body > header.bm-sw-floating-header .nav-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: 38px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

body > header.bm-sw-floating-header .header-search,
body > header.bm-sw-floating-header .theme-toggle {
    align-self: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* BUSSINMODS: consistent homepage and mod-details header layout */
body > header.bm-sw-floating-header > .container.nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    box-sizing: border-box !important;
}

body > header.bm-sw-floating-header .logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 64px !important;
    width: 64px !important;
    min-width: 64px !important;
    height: 100% !important;
}

body > header.bm-sw-floating-header .logo img {
    display: block !important;
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain !important;
}

body > header.bm-sw-floating-header .nav-right {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0 !important;
}

body > header.bm-sw-floating-header .nav-right > * {
    flex-shrink: 0 !important;
}

body > header.bm-sw-floating-header .nav-link,
body > header.bm-sw-floating-header .category-trigger,
body > header.bm-sw-floating-header .nav-button {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}
