/* ============================================================
   WHIEDA i18n — стили кнопки выбора языка и модалки
   ============================================================ */

/* ---------- Скрытие цен и PV на ВСЕХ языках, кроме RU ---------- */
html[lang]:not([lang="ru"]) .product-price-row,
html[lang]:not([lang="ru"]) .product-price-col,
html[lang]:not([lang="ru"]) .product-price,
html[lang]:not([lang="ru"]) .price-rub-row,
html[lang]:not([lang="ru"]) .price-rub,
html[lang]:not([lang="ru"]) .pm-price-row,
html[lang]:not([lang="ru"]) .pm-price,
html[lang]:not([lang="ru"]) .product-pv,
html[lang]:not([lang="ru"]) .pm-pv,
html[lang]:not([lang="ru"]) .product-points,
html[lang]:not([lang="ru"]) .product-bonus,
html[lang]:not([lang="ru"]) [data-hide-on-translation] {
    display: none !important;
}

/* ---------- DESKTOP: кнопка выбора языка ---------- */
.lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid var(--gold, #c9a961);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold-dark, #6b4d1f);
    transition: all 0.2s ease;
    font-family: inherit;
}
.lang-button:hover {
    background: #fff8e7;
}
.lang-button .lang-current-flag {
    font-size: 18px;
    line-height: 1;
}
.lang-button .lang-caret {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}
.lang-button[aria-expanded="true"] .lang-caret {
    transform: rotate(180deg);
}

/* ---------- DESKTOP: выпадающее меню ---------- */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e8e4d8;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
    color: #1a1814;
    user-select: none;
}
.lang-option:hover {
    background: #fff8e7;
}
.lang-option.active {
    background: #fff8e7;
    color: var(--gold-dark, #6b4d1f);
    font-weight: 600;
}
.lang-option.active::after {
    content: "✓";
    margin-left: auto;
    color: var(--gold, #c9a961);
    font-weight: 700;
}
.lang-option .lang-flag {
    font-size: 18px;
    line-height: 1;
}

/* ---------- MOBILE: пункт «Язык» в выезжающем меню ---------- */
.lang-mobile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    color: var(--gold-dark, #6b4d1f);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid #f0ece0;
}
.lang-mobile-item:active {
    opacity: 0.7;
}
.lang-mobile-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.lang-mobile-item .lang-current-flag {
    font-size: 18px;
}

/* ---------- MOBILE: полноэкранная модалка выбора языка ---------- */
.lang-modal {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 10000;
    display: none;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}
.lang-modal.open {
    display: flex;
    animation: langModalFadeIn 200ms ease-out;
}
@keyframes langModalFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-modal-close {
    align-self: flex-end;
    width: 40px;
    height: 40px;
    background: #f5f1e8;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--gold-dark, #6b4d1f);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lang-modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 24px 0 28px;
    color: #1a1814;
}
.lang-modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}
.lang-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: white;
    border: 1.5px solid #e8e4d8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.lang-card:hover {
    border-color: var(--gold, #c9a961);
}
.lang-card.active {
    background: #fff8e7;
    border-color: var(--gold, #c9a961);
}
.lang-card-flag {
    font-size: 26px;
    line-height: 1;
}
.lang-card-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a1814;
    flex: 1;
}
.lang-card.active .lang-card-name {
    font-weight: 600;
    color: var(--gold-dark, #6b4d1f);
}
.lang-card .check {
    color: var(--gold, #c9a961);
    font-size: 20px;
    font-weight: 700;
    display: none;
}
.lang-card.active .check {
    display: inline;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 768px) {
    .lang-switcher.desktop-only { display: none; }
}
@media (min-width: 769px) {
    .lang-mobile-item { display: none; }
}
