/* ==========================================
   LANGUAGE SWITCHER
   ========================================== */

.language-switcher{
    position:relative;
    display:flex;
    align-items:center;
    margin:14px;
    font-family:inherit;
    user-select:none;
    z-index:9999;
}

/* ------------------------------
   BUTTON
-------------------------------- */

.lang-btn{

    display:flex;
    align-items:center;
    gap:8px;

    height:44px;

    padding:0 10px;

    background:#ffffff;

    border:1px solid #6f7df6;
    border-radius:5px;

    cursor:pointer;

    transition:
        border-color .25s,
        box-shadow .25s,
        background .25s;

}

.lang-btn:hover{

    box-shadow:
        0 8px 22px rgba(111,125,246,.22);

}

/* ------------------------------
   FLAG
-------------------------------- */

.lang-btn img{

    width:32px;
    height:24px;

    object-fit:cover;

border:1px solid #ddd;

    border-radius:2px;

    flex:none;

}

/* ------------------------------
   CODE
-------------------------------- */

.lang-code{

    font-size:14px;
    font-weight:700;

    color:#6f7df6;

    letter-spacing:.08em;

    text-transform:uppercase;

}

/* ------------------------------
   ARROW
-------------------------------- */

.lang-arrow{

    width:20px;
    height:20px;

    margin-left:2px;

    color:#6f7df6;

    transition:
        transform .25s ease,
        stroke .25s ease;

}

/* OPEN */

.language-switcher.open .lang-arrow{

    transform:rotate(180deg);

    color:#bf6153;

}

.language-switcher.open .lang-btn{

    border-color:#bf6153;

}

/* ------------------------------
   DROPDOWN
-------------------------------- */

.lang-menu{

    position:absolute;

    top:52px;
    right:0;

    width:220px;

    max-height:420px;

    overflow-y:auto;

background:#6270e8;

    border-radius:5px;

    box-shadow:
        0 16px 40px rgba(0,0,0,.18);

    opacity:0;

    visibility:hidden;

    transform:translateY(-8px);

    transition:
        opacity .22s,
        transform .22s,
        visibility .22s;
pointer-events:auto;
z-index:10000;

}

/* OPEN */

.language-switcher.open .lang-menu{

    opacity:1;

    visibility:visible;

    transform:translateY(0);

}

/* ------------------------------
   ITEM
-------------------------------- */

.lang-item{

background:none;
border:none;
width:100%;
text-align:left;
font:inherit;
box-sizing:border-box;
user-select:none;

transition:
    background .18s,
    color .18s;

    display:flex;

    align-items:center;

    gap:12px;

    padding:10px 20px;

    cursor:pointer;

    box-shadow:inset 0 -1px rgba(255,255,255,.08);

}

.lang-item:last-child{

    box-shadow:none;

}

.lang-item:hover{

background:rgba(255,255,255,.08);

}

.lang-item:focus{

    outline:none;

background:rgba(255,255,255,.08);

}

.lang-item img{

    width:32px;
    height:24px;

border:1px solid rgba(255,255,255,.35);

    border-radius:2px;

    flex:none;

}

.lang-name{

    color:#fff;

    font-size:15px;

    font-weight:600;

    white-space:nowrap;

}

/* ------------------------------
   ACTIVE
-------------------------------- */

.lang-item.active{

    background:#bc6657;

}

.lang-item.active:hover{

    background:#bc6657;

}

/* ------------------------------
   SCROLLBAR
-------------------------------- */

.lang-menu::-webkit-scrollbar{

    width:6px;

}

.lang-menu::-webkit-scrollbar-thumb{

    background:rgba(255,255,255,.45);

    border-radius:10px;

}

.lang-menu::-webkit-scrollbar-track{

    background:transparent;

}

/* Firefox */

.lang-menu{

    scrollbar-width:thin;

}

/* ------------------------------
   MOBILE
-------------------------------- */

@media (max-width:900px){

    .lang-menu{

        right:-20px;

    }

}

@media (max-width:640px){

    .lang-btn{

        height:38px;

        padding:0 10px;

        gap:8px;

    }

    .lang-code{

        font-size:13px;

    }

    .lang-menu{

        width:220px;

    }

}

/* =========================================================
   RTL LANGUAGE MENU
========================================================= */

html[dir="rtl"] .lang-btn{
    flex-direction: row-reverse;
}

html[dir="rtl"] .lang-code{
    text-align: right;
}

html[dir="rtl"] .lang-arrow{
    margin-left: 0;
    margin-right: 2px;
}

html[dir="rtl"] .lang-menu{
    left: 0;
    right: auto;

    direction: rtl;      /* полоса прокрутки справа */
}

html[dir="rtl"] .lang-item{
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .lang-name{
    text-align: right;
}

@media (max-width:900px){

    html[dir="rtl"] .lang-menu{
        left: -20px;
        right: auto;
    }

}