/* ===== Header bar: identical on index + explore (esp. mobile) ===== */
#header.header.fixed-top,
#header.fixed-top,
body.index-page #header.header.fixed-top,
body.inner-page #header.header.fixed-top {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 997 !important;
    /* Index critical uses 10px; main.css explore uses 20px / uneven top-bottom */
    padding: 10px 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    background-color: rgba(20, 20, 20, 0.94) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease !important;
}

@media (min-width: 992px) and (pointer: fine) {
    #header.header.fixed-top,
    #header.fixed-top,
    body.index-page #header.header.fixed-top,
    body.inner-page #header.header.fixed-top {
        background-color: rgba(30, 30, 30, 0.45) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }
}

@media (max-width: 991.98px), (pointer: coarse) {
    #header.header.fixed-top,
    #header.fixed-top,
    #header.fixed-top.scrolled,
    #header.fixed-top.header-scrolled,
    body.inner-page #header.fixed-top,
    body.scrolled #header.fixed-top,
    #header.header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(20, 20, 20, 0.94) !important;
        box-shadow: none !important;
        padding: 10px 0 !important;
    }
}

#header .logo img {
    max-height: 40px !important;
    width: auto !important;
    height: auto !important;
}

:root {
    --site-coupon-banner-h: 0px;
}

body.has-site-coupon-banner {
    --site-coupon-banner-h: 52px;
}

body.has-site-coupon-banner #header.fixed-top,
body.has-site-coupon-banner #header.header.fixed-top {
    top: var(--site-coupon-banner-h) !important;
}

.site-coupon-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: linear-gradient(90deg, #6B7B4C 0%, #55633c 100%);
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.site-coupon-banner__inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--site-coupon-banner-h);
    padding: 0.3rem 0.65rem;
    max-width: none !important;
    width: 100% !important;
}

.site-coupon-banner__message {
    display: flex;
    align-items: center;
    min-width: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-coupon-banner__message span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-coupon-banner__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.site-coupon-banner__code-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    border: 1px dashed rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 0.75rem;
    line-height: 1.15;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    transform-origin: center;
    /* no continuous animation — PSI flagged non-composited animations */
}

.site-coupon-banner__hint {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.85;
    text-transform: none;
}

.site-coupon-banner__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.site-coupon-banner__code-btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.site-coupon-banner__code-btn.is-copied {
    transform: none;
    background: #e8f0d8;
    color: #2f3a1f;
    border-style: solid;
    border-color: #e8f0d8;
}

.site-coupon-banner__code-btn.is-copied .site-coupon-banner__hint {
    display: none;
}

@media (max-width: 767px) {
    body.has-site-coupon-banner {
        --site-coupon-banner-h: 48px;
    }

    .site-coupon-banner {
        font-size: 0.75rem;
    }

    .site-coupon-banner__inner {
        gap: 0.4rem;
        padding: 0.25rem 0.5rem;
    }

    .site-coupon-banner__code-btn {
        font-size: 0.6875rem;
        padding: 0.12rem 0.45rem;
    }

    .site-coupon-banner__hint {
        font-size: 0.55rem;
    }
}

/* Scrolled state — desktop only visual change; mobile stays solid like index */
@media (min-width: 992px) and (pointer: fine) {
    #header.fixed-top.scrolled,
    #header.fixed-top.header-scrolled,
    body.scrolled #header.fixed-top {
        background-color: rgba(20, 20, 20, 0.85) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15) !important;
    }
}

body.inner-page {
    padding-top: 72px !important;
}

body.inner-page.has-site-coupon-banner {
    padding-top: calc(72px + var(--site-coupon-banner-h)) !important;
}

/* Logo left, menu + tools right (index & explore same) */
#header.header {
    width: 100% !important;
}
#header .header-container,
#header .header-container.container-fluid,
#header .header-container.container-xl {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 0.75rem !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    gap: 0.75rem;
    min-height: 44px !important;
}
/* Kill main.css mobile “pill” margins/padding on explore */
@media (max-width: 1199.98px) {
    #header.header,
    #header.fixed-top,
    .header.fixed-top {
        padding: 10px 0 !important;
    }
    #header .header-container,
    .header .header-container {
        margin: 0 !important;
        padding: 0 0.75rem !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}
/* main.css sets .logo { order:1 } under 1200px — that pushes logo to the RIGHT on explore */
#header .logo {
    order: 0 !important;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.msi-header-right {
    display: none !important;
    order: 1 !important;
    align-items: center;
    gap: 1rem;
    margin-left: auto !important;
    flex: 0 1 auto;
    min-width: 0;
}
.msi-header-right .navmenu ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.15rem;
}
.msi-header-right .navmenu a {
    display: block;
    padding: 0.55rem 0.7rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}
.msi-header-right .navmenu a:hover,
.msi-header-right .navmenu a.active {
    color: #fff;
}
#header .msi-menu-toggle {
    order: 2 !important;
    margin-left: auto !important;
}
#header .navmenu,
#header .btn-getstarted {
    order: unset !important;
}

@media (max-width: 767px) {
    body.inner-page {
        padding-top: 68px !important;
    }

    body.inner-page.has-site-coupon-banner {
        padding-top: calc(68px + var(--site-coupon-banner-h)) !important;
    }
}

/* —— Mobile drawer (outside header; no backdrop-filter trap) —— */
.msi-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 10060;
    flex-shrink: 0;
}

.msi-menu-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.msi-menu-toggle.is-open .msi-menu-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.msi-menu-toggle.is-open .msi-menu-toggle__bar:nth-child(2) {
    opacity: 0;
}

.msi-menu-toggle.is-open .msi-menu-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.msi-drawer {
    position: fixed;
    inset: 0;
    z-index: 10070;
    pointer-events: none;
}

.msi-drawer.is-open {
    pointer-events: auto;
}

.msi-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(10, 12, 14, 0.55);
    opacity: 0;
    transition: opacity 0.28s ease;
    cursor: pointer;
}

.msi-drawer.is-open .msi-drawer__backdrop {
    opacity: 1;
}

.msi-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(86vw, 340px);
    background: #1a1d21;
    color: #fff;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    padding: calc(0.75rem + var(--site-coupon-banner-h, 0px)) 1.25rem 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.msi-drawer.is-open .msi-drawer__panel {
    transform: translate3d(0, 0, 0);
}

.msi-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.msi-drawer__title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.msi-drawer__close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.msi-drawer__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.msi-drawer__nav a {
    display: block;
    padding: 0.85rem 0.25rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.msi-drawer__nav a.is-active,
.msi-drawer__nav a:hover {
    color: #fff;
}

.msi-drawer__tools {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msi-drawer__langs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.msi-drawer__langs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.2rem;
    padding: 0 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}

.msi-drawer__langs a.is-active {
    background: #fff;
    color: #1a1d21;
    border-color: #fff;
}

.msi-drawer__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: #6B7B4C;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    text-align: center;
}

.msi-drawer__link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
}

.msi-drawer__link--muted {
    opacity: 0.7;
}

html.msi-menu-open,
html.msi-menu-open body {
    overflow: hidden;
    touch-action: none;
}

@media (min-width: 1200px) {
    .msi-drawer,
    .msi-menu-toggle {
        display: none !important;
    }
    .msi-header-right {
        display: flex !important;
    }
}
