/* KOSMOSTORE GLOBAL HEADER SEARCH START */


.header {
    position: relative;
}

.header__row,
.header__inner {
    position: relative;
}


/*
 * Компактная строка поиска в шапке.
 */

.global-header-search {
    position: relative;
    z-index: 30;

    flex: 0 1 220px;

    width: 220px;
    min-width: 170px;

    margin: 0 0 0 14px;

    font-family: inherit;
}


.global-header-search__field {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        40px;

    width: 100%;
    height: 40px;

    overflow: hidden;

    border:
        1px solid
        rgba(80, 126, 164, 0.42);

    border-radius: 13px;

    background:
        rgba(4, 18, 34, 0.76);

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.025);

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}


.global-header-search__field:focus-within {
    border-color:
        rgba(101, 157, 199, 0.7);

    background:
        rgba(4, 20, 38, 0.96);

    box-shadow:
        0 0 0 3px
        rgba(72, 133, 181, 0.08),

        inset 0 1px 0
        rgba(255, 255, 255, 0.035);
}


.global-header-search__input {
    display: block;

    width: 100%;
    min-width: 0;
    height: 100%;

    padding:
        0 8px
        0 14px;

    color: #edf4fa;

    border: 0;
    outline: 0;

    background: transparent;

    font-family: inherit;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.055em;
    line-height: 1;

    text-transform: uppercase;

    appearance: none;
}


.global-header-search__input::placeholder {
    color:
        rgba(165, 181, 196, 0.62);

    opacity: 1;
}


.global-header-search__input::-webkit-search-cancel-button {
    display: none;
}


/*
 * Яркая фирменная кнопка с лупой.
 */

.global-header-search__button {
    display: flex;

    width: 40px;
    height: 40px;

    align-items: center;
    justify-content: center;

    padding: 0;
    margin: -1px -1px -1px 0;

    color: #ffffff;

    border:
        1px solid
        rgba(255, 148, 139, 0.66);

    border-radius: 11px;

    outline: 0;

    background:
        var(
            --red,
            #e4473f
        );

    box-shadow:
        0 8px 20px
        rgba(75, 9, 14, 0.29),

        inset 0 1px 0
        rgba(255, 255, 255, 0.18);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        filter 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


.global-header-search__button svg {
    display: block;

    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}


.global-header-search__button:hover,
.global-header-search__button:focus-visible {
    border-color:
        rgba(255, 196, 190, 0.96);

    box-shadow:
        0 10px 25px
        rgba(74, 8, 13, 0.37),

        0 0 18px
        rgba(228, 71, 63, 0.24),

        inset 0 1px 0
        rgba(255, 255, 255, 0.22);

    filter: brightness(1.1);

    transform:
        translateY(-1px);
}


.global-header-search__button:active {
    filter: brightness(0.96);

    transform:
        translateY(0)
        scale(0.97);
}


/*
 * Если на старой шапке есть отдельная
 * кнопка открытия поиска, скрываем её.
 */

.header.has-global-header-search
.search-button[data-search-open] {
    display: none !important;
}


/*
 * Средние экраны.
 */

@media (max-width: 1220px) {
    .global-header-search {
        flex-basis: 190px;

        width: 190px;
        min-width: 155px;

        margin-left: 8px;
    }

    .global-header-search__input {
        padding-left: 12px;

        font-size: 10px;
    }
}


/*
 * На планшете форма немного компактнее.
 */

@media (
    min-width: 761px
)
and (
    max-width: 1020px
) {
    .global-header-search {
        flex-basis: 166px;

        width: 166px;
        min-width: 145px;

        margin-left: 5px;
    }
}


/*
 * Мобильная версия:
 * сначала отображается только кнопка с лупой.
 */

@media (max-width: 760px) {
    .global-header-search {
        flex:
            0 0 42px;

        width: 42px;
        min-width: 42px;

        margin-left: auto;
    }

    .global-header-search__field {
        grid-template-columns:
            0
            42px;

        width: 42px;
        height: 42px;

        border-color: transparent;

        background: transparent;

        box-shadow: none;
    }

    .global-header-search__input {
        width: 0;

        padding: 0;

        opacity: 0;
        pointer-events: none;
    }

    .global-header-search__button {
        width: 42px;
        height: 42px;

        margin: 0;

        border-radius: 12px;
    }


    /*
     * Раскрытый мобильный поиск.
     */

    .global-header-search.is-open {
        position: absolute;
        z-index: 100;

        top: 50%;
        right: 52px;
        left: 68px;

        width: auto;
        min-width: 0;

        margin: 0;

        transform:
            translateY(-50%);
    }

    .global-header-search.is-open
    .global-header-search__field {
        grid-template-columns:
            minmax(0, 1fr)
            42px;

        width: 100%;

        border-color:
            rgba(80, 126, 164, 0.6);

        background:
            rgba(3, 16, 30, 0.99);

        box-shadow:
            0 14px 34px
            rgba(0, 0, 0, 0.36);
    }

    .global-header-search.is-open
    .global-header-search__input {
        width: 100%;

        padding:
            0 10px
            0 13px;

        opacity: 1;
        pointer-events: auto;
    }
}


@media (max-width: 430px) {
    .global-header-search.is-open {
        right: 48px;
        left: 56px;
    }

    .global-header-search.is-open
    .global-header-search__input {
        font-size: 9px;
    }
}


@media (prefers-reduced-motion: reduce) {
    .global-header-search__field,
    .global-header-search__button {
        transition: none;
    }
}


/* KOSMOSTORE GLOBAL HEADER SEARCH END */

/* KOSMOSTORE MOBILE HEADER STABILITY START */


.global-header-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: 10px;
}


.global-menu-button {
    flex: 0 0 44px;
}


@media (max-width: 1000px) {
    html {
        scroll-padding-top: 78px;
    }

    .header,
    .header.is-fixed {
        position: fixed !important;
        z-index: 90 !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background:
            rgba(3, 9, 20, 0.96) !important;
        transform: none !important;
    }

    .header__inner,
    .header__row {
        min-height: 70px !important;
        height: 70px;
        gap: 8px !important;
    }

    .global-header-tools {
        position: relative;
        z-index: 120;
        gap: 8px;
        margin-left: auto;
    }

    .global-menu-button {
        position: relative;
        z-index: 150;
        display: block !important;
        flex: 0 0 42px;
        width: 42px !important;
        height: 42px !important;
        margin: 0 !important;
    }

    .global-menu-button span {
        pointer-events: none;
    }

    .global-header-search {
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        margin: 0 !important;
    }

    .global-header-search.is-open {
        position: fixed !important;
        z-index: 140 !important;
        top: 13px !important;
        right: 62px !important;
        left: 12px !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }

    .global-header-search.is-open
    .global-header-search__field {
        height: 44px;
    }

    .global-mobile-nav {
        position: fixed;
        z-index: 89;
        top: 70px;
        right: 0;
        left: 0;
        display: none;
        max-height:
            calc(100dvh - 70px);
        overflow-y: auto;
        padding:
            8px 16px
            calc(
                18px
                + env(
                    safe-area-inset-bottom,
                    0px
                )
            );
        background:
            rgba(3, 14, 27, 0.985);
        border-top:
            1px solid
            rgba(255, 255, 255, 0.06);
        box-shadow:
            0 22px 46px
            rgba(0, 0, 0, 0.34);
    }

    .global-mobile-nav.is-open {
        display: block !important;
    }

    .global-mobile-nav a {
        display: block;
        padding: 12px 4px;
        border-bottom:
            1px solid
            rgba(255, 255, 255, 0.06);
    }
}


@media (max-width: 430px) {
    .header__inner,
    .header__row {
        gap: 6px !important;
    }

    .global-header-tools {
        gap: 6px;
    }

    .global-header-search.is-open {
        right: 60px !important;
        left: 8px !important;
    }
}


/* KOSMOSTORE MOBILE HEADER STABILITY END */

/* KOSMOSTORE DESKTOP HEADER STABILITY START */


/*
 * На ПК шапка сразу находится в фиксированном режиме.
 *
 * Раньше она переключалась:
 * absolute -> fixed,
 * из-за чего при начале прокрутки был заметен скачок.
 */

@media (min-width: 1001px) {
    html {
        scroll-padding-top: 78px;
    }


    .header,
    .header.is-fixed {
        position: fixed !important;

        z-index: 90 !important;

        top: 0 !important;
        right: 0 !important;
        left: 0 !important;

        width: 100% !important;
        min-height: 78px !important;

        margin: 0 !important;

        border-bottom:
            1px solid
            rgba(
                255,
                255,
                255,
                0.07
            ) !important;

        background:
            rgba(
                3,
                9,
                20,
                0.94
            ) !important;

        backdrop-filter:
            blur(16px) !important;

        -webkit-backdrop-filter:
            blur(16px) !important;

        opacity: 1 !important;
        visibility: visible !important;

        transform: none !important;

        /*
         * Запрещаем анимацию положения и размера.
         * Допустимо только мягкое изменение тени.
         */
        transition:
            border-color 0.18s ease,
            background-color 0.18s ease,
            box-shadow 0.18s ease !important;
    }


    /*
     * Высота внутренней строки остаётся постоянной
     * независимо от наличия класса is-fixed.
     */

    .header__inner,
    .header__row,
    .header.is-fixed .header__inner,
    .header.is-fixed .header__row {
        min-height: 78px !important;
        height: 78px !important;

        padding-top: 0 !important;
        padding-bottom: 0 !important;

        transform: none !important;

        transition:
            none !important;
    }


    /*
     * Поиск и меню также не должны менять положение
     * после переключения класса шапки.
     */

    .global-header-tools,
    .header.is-fixed
    .global-header-tools,

    .global-header-search,
    .header.is-fixed
    .global-header-search,

    .nav,
    .header.is-fixed
    .nav,

    .brand,
    .header.is-fixed
    .brand {
        transform: none !important;
    }


    /*
     * Мобильное меню на ПК остаётся скрытым.
     */

    .global-mobile-nav {
        display: none !important;
    }
}


/* KOSMOSTORE DESKTOP HEADER STABILITY END */
