/* =========================================================
   KihCarpet + GTranslate Language Switcher
   ========================================================= */

.kih-header-language,
.kih-header-language * {
    box-sizing: border-box;
}


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

.kih-header-language {
    position: relative;
}


.kih-header-language__main {
    display: flex;

    align-items: center;

    height: 100%;
}


/* =========================================================
   BUTTON
   ========================================================= */

.kih-header-language__toggle {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    min-height: 44px;

    margin: 0 !important;

    padding:
        6px
        10px
        !important;

    border: 0 !important;

    border-radius: 11px;

    background:
        transparent !important;

    color:
        #2e4d38 !important;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    line-height: 1.2;

    cursor: pointer;

    outline: none !important;

    box-shadow: none !important;

    transition:
        background .18s ease,
        color .18s ease;
}


.kih-header-language__toggle:hover,
.kih-header-language__toggle:focus,
.kih-header-language__toggle:focus-visible,
.kih-header-language.is-open
.kih-header-language__toggle {

    background:
        #edf8f0 !important;

    color:
        #087c35 !important;

    outline: none !important;

    box-shadow: none !important;
}


/* =========================================================
   ICON
   ========================================================= */

.kih-header-language__icon {
    display: inline-flex;

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

    flex:
        0 0 29px;

    width: 29px;
    height: 29px;

    border:
        1px solid
        #cae7d2;

    border-radius:
        8px;

    background:
        #eaf7ee;

    color:
        #169044;

    font-size: 10px;

    font-weight: 800;

    line-height: 1;
}


/* =========================================================
   ARROW
   ========================================================= */

.kih-header-language__arrow {
    display: inline-block;

    margin-left: 1px;

    color:
        #6f8575;

    font-size: 12px;

    transition:
        transform .18s ease;
}


.kih-header-language.is-open
.kih-header-language__arrow {
    transform:
        rotate(180deg);
}


/* =========================================================
   DROPDOWN
   ========================================================= */

.kih-header-language__panel {
    position: absolute;

    top:
        calc(100% + 4px);

    right: 0;

    z-index: 10030;

    width: 210px;

    padding: 8px;

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

    border:
        1px solid
        #d8e8dc;

    border-radius:
        14px;

    box-shadow:
        0 17px 45px
        rgba(
            20,
            63,
            33,
            .16
        );

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(-5px);

    transition:
        opacity .17s ease,
        visibility .17s ease,
        transform .17s ease;
}


.kih-header-language.is-open
.kih-header-language__panel {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0);
}


/* =========================================================
   REAL GTRANSLATE LINKS
   ========================================================= */

.kih-header-language__links {
    display: flex;

    flex-direction: column;

    gap: 4px;

    width: 100%;
}


.kih-header-language-source__item {
    display: block;

    width: 100%;
}


.kih-header-language__links
a[data-gt-lang] {

    display: flex !important;

    align-items: center;

    gap: 10px;

    width: 100%;

    min-height: 43px;

    margin: 0 !important;

    padding:
        7px
        10px
        !important;

    border:
        1px solid
        transparent;

    border-radius:
        9px;

    background:
        transparent;

    color:
        #405c49 !important;

    font-family: inherit;

    font-size: 13px;

    font-weight: 500;

    line-height: 1.3;

    text-decoration:
        none !important;

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


.kih-header-language__links
a[data-gt-lang]:hover {

    background:
        #edf8f0;

    border-color:
        #d3e8d8;

    color:
        #087b35 !important;
}


/* Флаг */

.kih-header-language__links
a[data-gt-lang]
img {

    flex:
        0 0 auto;

    width: 26px !important;
    height: 19px !important;

    margin: 0 !important;

    object-fit: cover;

    border-radius: 3px;

    box-shadow:
        0 0 0 1px
        rgba(
            0,
            0,
            0,
            .07
        );
}


/* Текущий язык */

.kih-header-language__links
a.is-kih-current-language {

    background:
        #e8f6ec;

    border-color:
        #c7e4cf;

    color:
        #087b35 !important;

    font-weight: 700;
}


.kih-header-language__links
a.is-kih-current-language::after {

    content: "✓";

    margin-left: auto;

    color:
        #19a148;

    font-weight: 800;
}


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

@media (min-width: 768px) {

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

        min-height: 36px;

        padding:
            4px
            7px
            !important;

        font-size: 13px;
    }


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

        flex-basis: 25px;

        width: 25px;
        height: 25px;

        font-size: 9px;
    }

}


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

@media (max-width: 767px) {

    /*
     * В мобильном accordion
     * это обычный последний пункт меню.
     */
    .kih-header-language {

        width: 100%;

        margin:
            2px
            0
            0 !important;
    }


    .kih-header-language__main {
        width: 100%;
    }


    .kih-header-language__toggle {

        width: 100%;

        min-height: 47px;

        justify-content: flex-start;

        padding:
            7px
            9px
            !important;

        font-size: 14px;
    }


    .kih-header-language__text {
        flex: 1;

        text-align: left;
    }


    .kih-header-language__arrow {
        margin-left: auto;

        margin-right: 10px;
    }


    /*
     * На мобильном dropdown
     * раскрывается вниз как accordion.
     */
    .kih-header-language__panel {

        position: static;

        display: none;

        width: auto;

        margin:
            3px
            0
            7px
            20px;

        padding:
            4px
            0
            4px
            9px;

        background:
            #f8fbf8;

        border:
            0;

        border-left:
            2px solid
            #bee0c7;

        border-radius:
            0;

        box-shadow:
            none;

        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        transform: none;
    }


    .kih-header-language.is-open
    .kih-header-language__panel {

        display: block;
    }


    .kih-header-language__links
    a[data-gt-lang] {

        min-height: 42px;

        font-size: 13px;
    }


    .kih-header-language.is-open
    .kih-header-language__arrow {

        transform:
            rotate(180deg);
    }

}