/* =========================================================
   KihCarpet Sticky + Compact Header
   Stable Hysteresis Version
   ========================================================= */


/* =========================================================
   COMMON STICKY
   ========================================================= */

.kih-site-header {
    position: sticky;

    top:
        var(
            --kih-sticky-top,
            0px
        ) !important;

    z-index: 99990;

    /*
     * Не позволяем браузеру использовать
     * Header как scroll-anchor при изменении
     * его высоты.
     *
     * Это дополнительно убирает рывки.
     */
    overflow-anchor: none;

    /*
     * Уменьшает визуальное мерцание
     * при compositing Chrome.
     */
    backface-visibility: hidden;

    -webkit-backface-visibility: hidden;

    transition:
        box-shadow .22s ease,
        background .22s ease;
}


body.admin-bar
.kih-site-header {
    top:
        var(
            --kih-sticky-top,
            0px
        ) !important;
}


.kih-site-header.is-kih-scrolled {
    background:
        rgba(
            255,
            255,
            255,
            .985
        );

    box-shadow:
        0 7px 25px
        rgba(
            18,
            67,
            34,
            .13
        );
}


/*
 * Контейнер используется
 * для popup поиска.
 */
.kih-site-header__inner {
    position: relative;
}


/* =========================================================
   COMPACT SEARCH BUTTON
   ========================================================= */

.kih-site-header__compact-search {
    display: none;

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

    flex:
        0 0 40px;

    width: 40px;
    height: 40px;

    margin:
        0 !important;

    padding:
        0 !important;

    border:
        1px solid
        #d0e5d5 !important;

    border-radius:
        11px;

    background:
        #f2f9f4 !important;

    color:
        #087c35 !important;

    cursor: pointer;

    outline:
        none !important;

    box-shadow:
        none !important;

    transition:
        background .18s ease,
        border-color .18s ease,
        transform .18s ease;
}


.kih-site-header__compact-search:hover,
.kih-site-header__compact-search:focus,
.kih-site-header__compact-search:focus-visible,
.kih-site-header__compact-search:active {

    background:
        #e5f5e9 !important;

    border-color:
        #a8d8b5 !important;

    color:
        #066d2d !important;

    outline:
        none !important;

    box-shadow:
        none !important;
}


.kih-site-header__compact-search:active {
    transform:
        scale(.96);
}


.kih-site-header__compact-search svg {
    display: block;

    width: 20px;
    height: 20px;

    fill: none;

    stroke:
        currentColor;

    stroke-width:
        1.9;

    stroke-linecap:
        round;
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 768px) {


    /* =====================================================
       INFO BAR
       ===================================================== */

    .kih-site-header__info {
        max-height:
            50px;

        overflow:
            hidden;

        opacity:
            1;

        transition:
            max-height .22s ease,
            opacity .16s ease,
            border-color .16s ease;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__info {

        max-height:
            0;

        opacity:
            0;

        border-bottom-color:
            transparent;

        pointer-events:
            none;
    }


    /* =====================================================
       MAIN ROW
       ===================================================== */

    .kih-site-header__inner {
        transition:
            min-height .22s ease,
            gap .22s ease,
            padding .22s ease;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__inner {

        min-height:
            58px;

        grid-template-columns:
            auto
            1fr
            auto;

        gap:
            22px;
    }


    /* =====================================================
       LOGO
       ===================================================== */

    .kih-site-header__logo-box {
        transition:
            width .22s ease,
            height .22s ease,
            flex-basis .22s ease,
            border-radius .22s ease;
    }


    .kih-site-header__brand-name {
        transition:
            font-size .22s ease;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__logo-box {

        flex-basis:
            40px;

        width:
            40px;

        height:
            40px;

        border-radius:
            10px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__brand-name {

        font-size:
            23px;
    }


    /* =====================================================
       SEARCH
       ===================================================== */

    .kih-site-header.is-kih-scrolled
    .kih-site-header__search {

        display:
            none;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__compact-search {

        display:
            inline-flex;
    }


    /* =====================================================
       ACTIONS
       ===================================================== */

    .kih-site-header.is-kih-scrolled
    .kih-site-header__actions {

        gap:
            3px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__action {

        min-height:
            40px;

        padding:
            5px
            9px;

        border-radius:
            10px;
    }


    /* =====================================================
       NAV
       ===================================================== */

    .kih-site-header.is-kih-scrolled
    .kih-site-header__nav-list {

        padding:
            3px 0
            !important;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__nav-link {

        min-height:
            36px;

        padding:
            4px
            8px;

        font-size:
            13px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__nav-icon {

        flex-basis:
            25px;

        width:
            25px;

        height:
            25px;

        font-size:
            11px;

        border-radius:
            7px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__submenu-toggle {

        height:
            30px;
    }


    /* =====================================================
       SEARCH POPUP
       ===================================================== */

    .kih-site-header.is-kih-scrolled.is-kih-search-open
    .kih-site-header__search {

        position:
            absolute;

        top:
            calc(
                100% + 9px
            );

        right:
            0;

        z-index:
            100020;

        display:
            block;

        width:
            min(
                680px,
                calc(
                    100vw - 70px
                )
            );

        padding:
            9px;

        background:
            rgba(
                255,
                255,
                255,
                .985
            );

        border:
            1px solid
            #d5e6d9;

        border-radius:
            16px;

        box-shadow:
            0 18px 55px
            rgba(
                18,
                63,
                31,
                .18
            );

        animation:
            kihSearchPopupIn
            .18s ease;
    }


    .kih-site-header.is-kih-scrolled.is-kih-search-open
    .kih-site-header__search-form {

        height:
            50px;

        background:
            #f7faf7;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {


    /* =====================================================
       WORDPRESS ADMIN BAR FIX
       ===================================================== */

    html.kih-wp-adminbar-hidden {
        margin-top:
            0 !important;
    }


    body.kih-wp-adminbar-hidden {
        margin-top:
            0 !important;

        padding-top:
            0 !important;
    }


    html.kih-wp-adminbar-hidden
    .kih-site-header,

    body.kih-wp-adminbar-hidden
    .kih-site-header {

        top:
            0 !important;
    }


    /* =====================================================
       INFO BAR
       ===================================================== */

    .kih-site-header__info {
        max-height:
            38px;

        overflow:
            hidden;

        opacity:
            1;

        transition:
            max-height .22s ease,
            opacity .16s ease;
    }


    .kih-site-header__info-inner {
        width:
            100%;

        min-height:
            35px;

        display:
            flex;

        flex-wrap:
            nowrap;

        justify-content:
            flex-start;

        align-items:
            center;

        gap:
            12px;

        padding:
            4px
            10px;

        overflow-x:
            auto;

        overflow-y:
            hidden;

        scrollbar-width:
            none;

        -webkit-overflow-scrolling:
            touch;
    }


    .kih-site-header__info-inner::-webkit-scrollbar {
        display:
            none;
    }


    .kih-site-header__info-item,
    .kih-site-header__schedule-button {

        flex:
            0 0 auto;

        min-height:
            26px;

        margin:
            0 !important;

        padding:
            2px
            2px
            !important;

        white-space:
            nowrap;

        font-size:
            11px;
    }


    .kih-site-header__schedule-button strong {
        display:
            none;
    }


    /* =====================================================
       MOBILE MAIN ROW
       ===================================================== */

    .kih-site-header__inner {
        width:
            100%;

        min-height:
            auto;

        display:
            grid;

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

        gap:
            7px
            5px;

        padding:
            8px
            10px;

        transition:
            padding .22s ease;
    }


    .kih-site-header__brand-link {
        gap:
            7px;
    }


    .kih-site-header__logo-box {
        flex:
            0 0 39px;

        width:
            39px;

        height:
            39px;

        border-radius:
            10px;

        transition:
            width .22s ease,
            height .22s ease,
            flex-basis .22s ease;
    }


    .kih-site-header__brand-name {
        max-width:
            145px;

        overflow:
            hidden;

        white-space:
            nowrap;

        text-overflow:
            ellipsis;

        font-size:
            20px;

        transition:
            font-size .22s ease;
    }


    /* =====================================================
       ACTIONS
       ===================================================== */

    .kih-site-header__actions {
        gap:
            2px;
    }


    .kih-site-header__action {
        width:
            37px;

        height:
            37px;

        min-height:
            37px;

        padding:
            5px;

        border-radius:
            10px;
    }


    .kih-site-header__action-text,
    .kih-site-header__account-arrow {

        display:
            none;
    }


    .kih-site-header__action-icon svg {
        width:
            20px;

        height:
            20px;
    }


    .kih-site-header__cart-icon svg {
        width:
            22px;

        height:
            22px;
    }


    /* =====================================================
       NORMAL SEARCH
       ===================================================== */

    .kih-site-header__search {
        grid-column:
            1 / -1;
    }


    .kih-site-header__search-form {
        height:
            43px;

        border-radius:
            11px;
    }


    .kih-site-header__search-button {
        flex:
            0 0 42px;

        width:
            42px;

        height:
            41px;
    }


    .kih-site-header__search-input {
        height:
            41px !important;

        font-size:
            13px !important;
    }


    /* =====================================================
       NORMAL MOBILE MENU
       ===================================================== */

    .kih-site-header__nav-inner {
        width:
            100%;

        padding:
            5px
            10px;
    }


    .kih-site-header__mobile-menu-button {
        min-height:
            38px;

        padding:
            5px
            12px
            !important;

        font-size:
            13px;

        border-radius:
            9px;
    }


    /* =====================================================
       COMPACT MOBILE
       ===================================================== */

    .kih-site-header.is-kih-scrolled
    .kih-site-header__info {

        max-height:
            0;

        opacity:
            0;

        pointer-events:
            none;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__inner {

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

        padding:
            5px
            8px;

        gap:
            4px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__logo-box {

        flex-basis:
            32px;

        width:
            32px;

        height:
            32px;

        border-radius:
            8px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__brand-name {

        max-width:
            120px;

        font-size:
            17px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__search {

        display:
            none;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__compact-search {

        display:
            inline-flex;

        flex-basis:
            34px;

        width:
            34px;

        height:
            34px;

        border-radius:
            9px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__compact-search svg {

        width:
            18px;

        height:
            18px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__action {

        width:
            34px;

        height:
            34px;

        min-height:
            34px;

        padding:
            4px;
    }


    /* =====================================================
       COMPACT MOBILE MENU BUTTON
       ===================================================== */

    .kih-site-header.is-kih-scrolled
    .kih-site-header__nav-inner {

        display:
            flex;

        flex-direction:
            column;

        align-items:
            flex-end;

        padding:
            3px
            8px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__mobile-menu-button {

        width:
            auto;

        min-width:
            89px;

        min-height:
            31px;

        padding:
            3px
            9px
            !important;

        font-size:
            11px;

        border-radius:
            8px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__hamburger {

        width:
            15px;

        height:
            15px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__hamburger i {

        width:
            15px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__nav-inner.is-mobile-open
    .kih-site-header__mobile-menu-button {

        width:
            100%;

        min-height:
            36px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__nav-inner.is-mobile-open
    .kih-site-header__nav {

        width:
            100%;
    }


    /* =====================================================
       SEARCH POPUP MOBILE
       ===================================================== */

    .kih-site-header.is-kih-scrolled.is-kih-search-open
    .kih-site-header__search {

        position:
            absolute;

        top:
            calc(
                100% + 6px
            );

        left:
            8px;

        right:
            8px;

        z-index:
            100020;

        display:
            block;

        width:
            auto;

        padding:
            7px;

        background:
            rgba(
                255,
                255,
                255,
                .99
            );

        border:
            1px solid
            #d3e5d7;

        border-radius:
            14px;

        box-shadow:
            0 15px 42px
            rgba(
                17,
                61,
                30,
                .20
            );

        animation:
            kihSearchPopupIn
            .18s ease;
    }


    .kih-site-header.is-kih-scrolled.is-kih-search-open
    .kih-site-header__search-form {

        height:
            45px;
    }


    .kih-site-header.is-kih-scrolled.is-kih-search-open
    .kih-site-header__search-input {

        display:
            block;

        height:
            43px !important;
    }


    .kih-site-header__account-menu {
        top:
            58px;
    }

    /*
     * Mobile anti-flicker stabilization.
     *
     * Layout-affecting transitions (max-height, padding, logo dimensions)
     * used to produce several intermediate header heights. Mobile Chrome
     * continuously corrected scrollY during those 220 ms, which could look
     * like shaking and, at the threshold, could repeatedly flip the state.
     *
     * Compact/normal now changes its geometry in one layout pass; only
     * non-layout visual transitions on the header itself remain animated.
     */
    .kih-site-header__info {
        transition:
            opacity .13s ease !important;
    }

    .kih-site-header__inner,
    .kih-site-header__logo-box,
    .kih-site-header__brand-name,
    .kih-site-header__nav-inner,
    .kih-site-header__mobile-menu-button,
    .kih-site-header__action,
    .kih-site-header__compact-search {
        transition:
            none !important;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 390px) {

    .kih-site-header__brand-name {
        max-width:
            115px;

        font-size:
            18px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__brand-name {

        max-width:
            100px;

        font-size:
            16px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__logo-box {

        flex-basis:
            30px;

        width:
            30px;

        height:
            30px;
    }


    .kih-site-header.is-kih-scrolled
    .kih-site-header__compact-search,

    .kih-site-header.is-kih-scrolled
    .kih-site-header__action {

        width:
            32px;

        height:
            32px;

        min-height:
            32px;
    }

}


/* =========================================================
   SEARCH ANIMATION
   ========================================================= */

@keyframes kihSearchPopupIn {

    from {

        opacity:
            0;

        transform:
            translateY(-6px);
    }


    to {

        opacity:
            1;

        transform:
            translateY(0);
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (
    prefers-reduced-motion:
    reduce
) {

    .kih-site-header,
    .kih-site-header *,
    .kih-site-header *::before,
    .kih-site-header *::after {

        transition-duration:
            .01ms !important;

        animation-duration:
            .01ms !important;
    }

}
/* KihCarpet sticky fix */
/*
 * KihCarpet Sticky Header Legacy Fix
 *
 * Файл оставлен для обратной совместимости.
 *
 * Все Sticky/Header/Admin Bar стили теперь находятся в:
 *
 * assets/header-sticky.css
 */