/* Language Switcher — общий компонент для публичных страниц.
   Отдельный файл, чтобы подключать на templates-list/category/detail/blog/services
   без необходимости тащить весь Public/css/style.css. */

.language-switcher { position: relative; }

.language-switcher .ls-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 20px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: all 0.3s;
}
.language-switcher .ls-toggle:hover { background: rgba(255, 255, 255, 0.1); }

.language-switcher .ls-current { font-weight: 600; letter-spacing: 0.5px; }

.language-switcher .ls-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    max-height: 360px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    background: rgba(15, 20, 32, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1001;
}
.language-switcher.open .ls-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher .ls-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
    font-size: 0.9rem;
}
.language-switcher .ls-item:hover { background: rgba(255, 255, 255, 0.06); }
.language-switcher .ls-item.active {
    background: rgba(24, 120, 215, 0.15);
    color: #1878d7;
}

.language-switcher .ls-flag {
    display: inline-block;
    width: 20px;
    height: 14px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Эмодзи-флаги через Unicode regional indicators */
.language-switcher .ls-flag::before {
    display: block;
    width: 20px;
    height: 14px;
    line-height: 14px;
    font-size: 14px;
    text-align: center;
}
.language-switcher .ls-flag.flag-gb::before { content: "\1F1EC\1F1E7"; }
.language-switcher .ls-flag.flag-us::before { content: "\1F1FA\1F1F8"; }
.language-switcher .ls-flag.flag-es::before { content: "\1F1EA\1F1F8"; }
.language-switcher .ls-flag.flag-fr::before { content: "\1F1EB\1F1F7"; }
.language-switcher .ls-flag.flag-de::before { content: "\1F1E9\1F1EA"; }
.language-switcher .ls-flag.flag-it::before { content: "\1F1EE\1F1F9"; }
.language-switcher .ls-flag.flag-pt::before { content: "\1F1F5\1F1F9"; }
.language-switcher .ls-flag.flag-ru::before { content: "\1F1F7\1F1FA"; }
.language-switcher .ls-flag.flag-ua::before { content: "\1F1FA\1F1E6"; }
.language-switcher .ls-flag.flag-pl::before { content: "\1F1F5\1F1F1"; }
.language-switcher .ls-flag.flag-tr::before { content: "\1F1F9\1F1F7"; }

@media (max-width: 768px) {
    .language-switcher { display: none; }
}
