:root {
    font-size: 10px;
}

.site-header {
    position: fixed;
    width: 100%;
    transition: color 0.3s ease-in-out;
    color: white;
}

.site-header.light {
    color: black;
}

.site-header.light .header-logo img {
    filter: invert(1);
}


.logged-in.admin-bar .site-header {
    margin-top: 3.2rem;
    top: 3rem
}

.site-header {
    position: fixed;
    top: 4.8rem;
    left: 0;
    right: 0;
    border-radius: 100px;
    transition: background 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.site-header.light {
    background: rgba(255, 255, 255, 0.15);
}

.site-header.dark {
    background: rgba(30, 30, 30, 0.322);
}

.site-header.scrolled {
    background-color: var(--header-color);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3rem 3rem;
}

img.header-logo {
    width: clamp(114px, 1.14rem, 128px);
}

nav#site-navigation {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: clamp(44px, 2.91vw, 60px);
}

.menu-item {
    display: inline-block;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.btnOuter {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    /* высота кнопки, можно адаптировать */
    position: relative;
}

.btnTextGroup {
    position: relative;
    height: 40px;
    overflow: hidden;
    padding: 0 1px;
}

.btnText,
.btnTextDupe {
    display: block;
    font-size: clamp(14px, 1.4rem, 20px);
    text-transform: uppercase;
    transition: transform 0.4s ease, opacity 0.4s ease;
    line-height: 40px;
    /* должно совпадать с высотой .btnOuter */
    white-space: nowrap;
    color: #fff;
    width: 100%;
}

.btnText {
    transform: translateY(0);
    opacity: 1;
}

.btnTextDupe {
    position: absolute;
    left: 0;
    top: 100%;
    transform: translateY(0);
    opacity: 0;
    font-weight: bold;
}

/* Ховер — меняем местами */
.menu-item:hover .btnText {
    transform: translateY(-100%);
    opacity: 0;
}

.menu-item:hover .btnTextDupe {
    transform: translateY(-100%);
    opacity: 1;
}

.search-film,
.mob-menu-btn {
    display: none;
}

.site-header {
    transition: top .4s ease;
}

header.site-header.dark.scrolled,
header.site-header.light.scrolled {
    background: #000000ba !important;
    top: 1rem;
}

img.search-icon {
    cursor: pointer;
    width: clamp(24px, 2.4rem, 40px);
}

.search-film {
    transition: width .4s ease;
}

.search-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
}

.search-form button {
    padding: 10px 20px;
}

.search-popup {
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 999;
    opacity: 0;
    background: #ffffff;
    backdrop-filter: blur(26px);
    transition: opacity .5s ease, visibility 0.4s ease;
    justify-content: center;
    align-items: center;
}

.search-popup.visible {
    display: flex;
    opacity: 1;
    z-index: 9999;
    transition: opacity 0.4s ease;
    /* overflow-y: scroll; */
}

.search-popup.unvisible {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    visibility: hidden;
}

.form-wrapper {
    width: 100%;
    max-width: clamp(200px, 50vw, 1300px);
    margin: auto;
    position: absolute;
    z-index: 222;
    top: 50vh;
    /* или сколько тебе нужно для нижнего положения */
    transition: top 0.4s ease-in-out;
    /* чуть дольше, чтобы было заметно */
}

.form-wrapper.topped {
    top: 6vh;
}

.form-wrapper form {
    position: relative;
}

/* .search-popup__close-wrapper {
    width: 3rem;
    height: 3rem;
    position: fixed;
    right: 5.6vw;
    top: 6vh;
} */

.search-popup__close-wrapper {
    width: calc(var(--content-flex-width) - 6rem);
    height: 3rem;
    position: fixed;
    right: 0;
    margin: auto;
    left: 0;
    top: 68px;
    display: flex;
    justify-content: end;
}

.search-popup__close-wrapper.close-scrolled {
    right: 0;
    top: 3.4vh;
}

.flex-container {
    display: flex;
    justify-content: center;
    flex-direction: row;
    align-items: center;
    min-height: 100vh;
}

.search-popup__close {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.search-popup__close::before,
.search-popup__close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 2px;
    background-color: #000;
    /* поменяй на #fff если нужен белый */
    transition: transform 0.3s ease;
    transform-origin: center;
}

.search-popup__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.search-popup__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.search-popup__close:hover::before {
    transform: translate(-50%, -50%) rotate(135deg);
}

.search-popup__close:hover::after {
    transform: translate(-50%, -50%) rotate(225deg);
}

input.site-search {
    position: relative;
    font-size: 2rem;
    outline: none;
    border: none;
    background: transparent;
    border-bottom: 2px solid #000000;
}


button.clear-search {
    position: absolute;
    top: 1px;
    right: -7px;
    margin: auto;
    background: #fff;
    border: none;
    text-transform: uppercase;
    padding: 0;
    height: 44px;
    color: #989898;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease;
}

button.clear-search.active {
    opacity: 1;
    visibility: initial;
}

body.no-scroll {
    overflow: hidden;
    position: relative;
    /* на всякий случай */
    height: 100%;
}

.search-results {
    position: absolute;
    opacity: 1;
    top: 20vh;
    max-width: clamp(200px, 50vw, 130rem);
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    height: 100%;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #000;
    cursor: pointer;
    color: #000;
    font-size: 1.4rem;
    line-height: 1.3;
}

.search-result-item:hover {
    background: #000000;
    color: #fff;
}

.burger,
.mobile-menu {
    display: none;
}

@media (min-width: 2000px) {

    .btnText,
    .btnTextDupe {
        font-size: clamp(18px, 1.8rem, 24px);
    }

    img.header-logo {
        height: 7rem;
        width: fit-content;
    }

    img.search-icon {
        cursor: pointer;
        width: clamp(24px, 3.4rem, 40px);
    }

    input.site-search,
    .search-result-item {
        font-size: 2.4rem;
    }
}

@media (orientation: portrait) {

    .search-toggle.mobile {
        opacity: 0;
        transition: opacity 1s ease;
        pointer-events: none;
    }

    .menu-visible .search-toggle.mobile {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-navigation .btnTextGroup {
        text-align: center;
    }

    .content-flex-width {
        max-width: 90vw;
    }

    nav#site-navigation,
    .search-toggle.desktop {
        display: none;
    }

    .burger-btn {
        display: block;
    }

    .burger {
        width: 25px;
        height: 25px;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .burger__inner {
        width: 100%;
        height: 12px;
        position: relative;
    }

    .burger__line {
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        background: #000;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .burger__line--top {
        top: 0;
        transform-origin: center;
    }

    .burger__line--bottom {
        bottom: 0;
        transform-origin: center;
    }

    .site-header {
        position: fixed;
        top: 2rem;
    }

    /* Ховер-эффект */
    .burger:hover .burger__line--top {
        transform: translateY(-1px);
    }

    .burger:hover .burger__line--bottom {
        transform: translateY(1px);
    }

    /* Состояние active */
    .burger.active .burger__line--top {
        transform: translateY(5px) rotate(45deg);
    }

    .burger.active .burger__line--bottom {
        transform: translateY(-5px) rotate(-45deg);
    }

    /* .mobile-menu {
        position: absolute;
        background: #857d7d;
        width: 100vw;
        height: 100vh;
        top: -200vh;
        transition: top 1s ease;
    } */

    .burger__line {
        background: #fff;
    }

    .mobile-menu {
        position: absolute;
        top: -200vh;
        width: 100vw;
        height: 100vh;
        left: -5vw;
        right: 0;
        display: none;
        transition: top .4s ease;
        z-index: 998;
        background: #ffffff;
    }

    .no-scroll {
        overflow: hidden;
    }

    .mobile-menu.active {
        display: block;
        top: -200vh;
        /* за пределами */
    }

    .mobile-menu.shown {
        top: -6.2rem;
        /* финальное положение */
    }

    .mobile-menu.active.shown .content-flex-width {
        position: absolute;
        left: 0;
        right: 0;
        top: -10%;
        bottom: 0;
        margin: auto;
        height: fit-content;
    }

    .mobile-menu.shown {
        top: -6.2rem;
        height: 107vh;
        overflow: hidden;
    }

    button.burger.active {
        z-index: 999;
    }

    button.burger.active .burger__line {
        background: #000;
    }

    img.header-logo {
        max-width: 77px;
    }

    .search-toggle.mobile {
        display: block;
    }

    .btnText,
    .btnTextDupe {
        color: #000;
    }

    nav#mobile-navigation {
        display: flex;
        flex-direction: column;
    }

    .menu-site-branding {
        margin-top: 9rem;
        display: flex;
        justify-content: center;
        margin-bottom: 6rem;
    }

    .menu-contacts {
        color: #000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: 4rem;
        gap: 14px;
    }

    a.anim-scale.menu__contact,
    a.menu__contact {
        font-size: 1.6rem;
        color: #000;
        font-weight: 600;
        line-height: 1.2;
    }

    .menu__social-icons {
        margin-top: 2.5rem;
        display: flex;
        justify-content: center;
        gap: 2.5rem;
        align-items: center;
    }

    span.lang-switcher.lang-switcher-menu {
        color: #000;
    }

    .search-toggle.mobile {
        position: fixed;
        top: 2rem;
        left: 3rem;
    }

    .form-wrapper,
    .search-results {
        max-width: clamp(200px, 80vw, 1300px);
    }

    .search-form input {
        width: 100%;
        padding: 10px;
        margin-bottom: 10px;
        max-width: calc(80vw - 20px);
    }

    span.lang-switcher.lang-switcher-menu {
        font-size: 2.4rem;
        font-weight: bold;
    }

    a.btn.dark.bordered.mob-only {
        width: 100%;
        max-width: 100vw;
        height: 5rem;
        font-size: 1.8rem;
    }

    /* .search-popup__close-wrapper {
        right: 8.6vw;
        top: 3vh;
        display: flex;
        align-items: center;
    } */
    .search-popup__close-wrapper {
        right: 2rem;
        top: 36px;
        display: flex;
        align-items: center;
    }

    .search-popup__close {
        width: 25px;
        height: 25px;
    }
}

@media (min-width: 3000px) {
    img.header-logo {
        height: 12rem;
        width: fit-content;
    }

    .btnText,
    .btnTextDupe {
        font-size: 30px;
    }

    img.search-icon {
        width: 50px;
    }

    .header-container {
        padding: 3.3rem 4rem;
    }

    input.site-search {
        font-size: 5rem;
    }

    .search-result-item {
        font-size: 5rem;
    }

    .search-popup__close {
        position: relative;
        width: 60px;
        height: 60px;
        cursor: pointer;
    }

    .search-popup__close::before,
    .search-popup__close::after {
        width: 60px;
        height: 2px;
    }

    .search-result-item {
        padding: 2rem 1rem;
    }

    .form-wrapper {
        max-width: 1600px;
    }

    .search-results {
        max-width: 1600px;
    }
}