/* =========================================================
   KihCarpet Live Search
   ========================================================= */

.kih-site-header__search {
    position: relative;
}


/* =========================================================
   PANEL
   ========================================================= */

.kih-live-search {
    position: absolute;

    top: calc(100% + 8px);
    left: 0;
    right: 0;

    z-index: 100050;

    display: none;

    overflow: hidden;

    background: #fff;

    border:
        1px solid
        #d2e4d6;

    border-radius: 15px;

    box-shadow:
        0 18px 55px
        rgba(15, 65, 31, .18);
}


.kih-live-search.is-open {
    display: block;
}


/* =========================================================
   HEADER
   ========================================================= */

.kih-live-search__header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 12px;

    min-height: 37px;

    padding:
        7px
        11px;

    background:
        #f7faf8;

    border-bottom:
        1px solid
        #e1ebe4;

    color:
        #76847a;

    font-size: 10.5px;
}


/* =========================================================
   RESULTS
   ========================================================= */

.kih-live-search__results {
    max-height:
        min(
            570px,
            calc(100vh - 180px)
        );

    overflow-y: auto;

    overscroll-behavior: contain;

    scrollbar-width: thin;

    scrollbar-color:
        #8dc69c
        #f1f6f2;
}


.kih-live-search__results::-webkit-scrollbar {
    width: 6px;
}


.kih-live-search__results::-webkit-scrollbar-track {
    background:
        #f1f6f2;
}


.kih-live-search__results::-webkit-scrollbar-thumb {
    background:
        #8dc69c;

    border-radius:
        999px;
}


/* =========================================================
   ITEM
   ========================================================= */

.kih-live-search__item {
    display: grid;

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

    gap: 10px;

    align-items: start;

    padding:
        8px
        10px;

    border-bottom:
        1px solid
        #edf2ee;

    background: #fff;
}


.kih-live-search__item:hover {
    background:
        #fbfdfb;
}


/* =========================================================
   IMAGE
   ========================================================= */

.kih-live-search__image {
    display: block;

    width: 58px;
    height: 70px;

    overflow: hidden;

    border:
        1px solid
        #dce8df;

    border-radius: 8px;

    background:
        #f2f5f3;
}


.kih-live-search__image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   CONTENT
   ========================================================= */

.kih-live-search__content {
    min-width: 0;
}


.kih-live-search__name {
    display: block;

    margin-bottom: 4px;

    color:
        #183f27 !important;

    font-size: 12.5px;

    line-height: 1.3;

    font-weight: 750;

    text-decoration: none !important;
}


.kih-live-search__name:hover {
    color:
        #0d853a !important;
}


/* =========================================================
   VARIANTS AREA
   ========================================================= */

.kih-live-search__variants {
    margin:
        4px
        0
        7px;
}


.kih-live-search__variants-title {
    margin-bottom: 5px;

    color:
        #647369;

    font-size: 9.5px;

    font-weight: 650;
}


.kih-live-search__variant-list {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    max-height: 126px;

    overflow-y: auto;

    padding:
        1px
        3px
        2px
        0;

    scrollbar-width: thin;

    scrollbar-color:
        #a6cfb1
        transparent;
}


/* =========================================================
   VARIANT CARD
   ========================================================= */

.kih-live-search__variant-chip {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 1px;

    min-width: 58px;

    min-height: 42px;

    padding:
        4px
        7px;

    background:
        #edf8f0;

    border:
        1px solid
        #c3e2cb;

    border-radius: 8px;

    color:
        #087c34 !important;

    line-height: 1.1;

    text-align: center;

    text-decoration: none !important;

    transition:
        background .14s ease,
        border-color .14s ease,
        transform .14s ease,
        box-shadow .14s ease;
}


.kih-live-search__variant-chip:hover {
    position: relative;

    z-index: 2;

    background:
        #def3e4;

    border-color:
        #73bf89;

    transform:
        translateY(-2px);

    box-shadow:
        0 5px 12px
        rgba(23, 119, 55, .11);
}


/* =========================================================
   VARIANT VALUE
   ========================================================= */

.kih-live-search__variant-value {
    color:
        #096f31;

    font-size: 10px;

    font-weight: 800;
}


/* =========================================================
   VARIANT PRICE
   ========================================================= */

.kih-live-search__variant-price {
    color:
        #1a9b48;

    font-size: 9px;

    font-weight: 750;

    white-space: nowrap;
}


/* =========================================================
   OUT OF STOCK
   ========================================================= */

.kih-live-search__variant-chip.is-out-of-stock {
    background:
        #f7f7f7;

    border-color:
        #dedede;

    opacity: .72;
}


.kih-live-search__variant-chip.is-out-of-stock
.kih-live-search__variant-value {
    color:
        #8f9691;

    text-decoration:
        line-through;
}


.kih-live-search__variant-chip.is-out-of-stock
.kih-live-search__variant-price {
    color:
        #999;
}


.kih-live-search__variant-stock {
    color:
        #a65750;

    font-size: 7.5px;

    font-weight: 700;

    text-transform:
        uppercase;
}


/* =========================================================
   META
   ========================================================= */

.kih-live-search__meta {
    display: flex;

    flex-wrap: wrap;

    gap:
        3px
        9px;

    margin-top: 2px;

    color:
        #879188;

    font-size: 9.5px;
}


.kih-live-search__stock {
    color:
        #15863d;
}


/* =========================================================
   BASE PRICE
   ========================================================= */

.kih-live-search__price {
    padding-top: 4px;

    color:
        #129441;

    font-size: 13px;

    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   FOOTER
   ========================================================= */

.kih-live-search__footer {
    padding: 7px;

    background:
        #f8fbf9;

    border-top:
        1px solid
        #e0ebe3;
}


.kih-live-search__all {
    display: flex;

    justify-content: space-between;

    align-items: center;

    min-height: 36px;

    padding:
        6px
        10px;

    background:
        #eaf7ee;

    border:
        1px solid
        #c7e4cf;

    border-radius: 8px;

    color:
        #087832 !important;

    font-size: 11px;

    font-weight: 750;

    text-decoration: none !important;
}


.kih-live-search__all:hover {
    background:
        #ddf2e3;
}


/* =========================================================
   STATES
   ========================================================= */

.kih-live-search__state {
    padding:
        28px
        15px;

    color:
        #718078;

    font-size: 12px;

    text-align: center;
}


.kih-live-search__spinner {
    width: 23px;
    height: 23px;

    margin:
        0 auto
        8px;

    border:
        2px solid
        #d7e8dc;

    border-top-color:
        #178e43;

    border-radius: 50%;

    animation:
        kihSearchSpinner
        .7s linear infinite;
}


@keyframes kihSearchSpinner {

    to {
        transform:
            rotate(360deg);
    }
}


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

@media (max-width: 767px) {

    .kih-live-search {
        top:
            calc(100% + 5px);

        border-radius:
            11px;
    }


    .kih-live-search__results {
        max-height:
            min(
                510px,
                calc(100vh - 145px)
            );
    }


    .kih-live-search__item {
        grid-template-columns:
            48px
            minmax(0, 1fr);

        gap: 7px;

        padding: 7px;
    }


    .kih-live-search__image {
        width: 48px;
        height: 59px;
    }


    .kih-live-search__name {
        font-size: 11.5px;
    }


    /*
     * Общая цена товара
     * переходит под контент.
     */
    .kih-live-search__price {
        grid-column: 2;

        padding-top: 1px;

        font-size: 11.5px;
    }


    .kih-live-search__variant-list {
        gap: 4px;

        max-height: 145px;
    }


    .kih-live-search__variant-chip {
        min-width: 54px;

        min-height: 41px;

        padding:
            4px
            5px;
    }


    .kih-live-search__variant-value {
        font-size: 9.5px;
    }


    .kih-live-search__variant-price {
        font-size: 8.5px;
    }


    .kih-live-search__variants-title {
        font-size: 9px;
    }

}