/* ── Language switcher (header) ─────────────────────────────── */

:root {
    --hd-lang-bg: rgba(255, 255, 255, 0.78);
    --hd-lang-border: rgba(15, 23, 42, 0.12);
    --hd-lang-text: rgba(15, 23, 42, 0.68);
    --hd-lang-text-hover: #0f172a;
    --hd-lang-active-bg: #0f172a;
    --hd-lang-active-text: #ffffff;
    --hd-lang-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.mil-frame {
    z-index: 12;
}

.mil-menu-frame {
    z-index: 20;
}

.mil-preloader {
    z-index: 30;
}

.mil-frame-top {
    position: relative;
}

.hd-lang-slot {
    display: inline-flex;
    align-items: center;
    pointer-events: all;
    position: absolute;
    top: 50%;
    right: 104px;
    transform: translateY(-50%);
    z-index: 3;
}

.hd-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--hd-lang-border);
    border-radius: 999px;
    background: var(--hd-lang-bg);
    box-shadow: var(--hd-lang-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    pointer-events: all;
}

.hd-lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 34px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hd-lang-text);
    text-decoration: none;
    padding: 0 12px;
    font-weight: 700;
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    pointer-events: all;
    position: relative;
    z-index: 1;
}

.hd-lang-switcher a:hover {
    color: var(--hd-lang-text-hover);
    background: rgba(255, 255, 255, 0.52);
    transform: translateY(-1px);
}

.hd-lang-switcher a.hd-active {
    color: var(--hd-lang-active-text);
    background: var(--hd-lang-active-bg);
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
}

.hd-lang-switcher span {
    font-size: 11px;
    color: rgba(15, 23, 42, 0.18);
}

.mil-frame-top .hd-lang-slot {
    margin: 0;
}

.mil-menu-frame .mil-frame-top .hd-lang-slot {
    right: 104px;
}

.mil-menu-frame .hd-lang-switcher {
    --hd-lang-bg: rgba(255, 255, 255, 0.08);
    --hd-lang-border: rgba(255, 255, 255, 0.16);
    --hd-lang-text: rgba(255, 255, 255, 0.68);
    --hd-lang-text-hover: #ffffff;
    --hd-lang-active-bg: #ffffff;
    --hd-lang-active-text: #111827;
    --hd-lang-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.mil-home-1-light .mil-menu-frame .hd-lang-switcher {
    --hd-lang-bg: rgba(255, 255, 255, 0.74);
    --hd-lang-border: rgba(15, 23, 42, 0.12);
    --hd-lang-text: rgba(15, 23, 42, 0.68);
    --hd-lang-text-hover: #0f172a;
    --hd-lang-active-bg: #0f172a;
    --hd-lang-active-text: #ffffff;
    --hd-lang-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.mil-home-1-light .mil-menu-frame .hd-lang-switcher span {
    color: rgba(15, 23, 42, 0.18);
}

/* ── Language gate (modal overlay) ─────────────────────────── */

.hd-lang-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(248, 246, 241, 0.68);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hd-lang-overlay.hd-visible {
    display: flex;
}

.hd-lang-modal {
    width: min(560px, 100%);
    padding: 52px 44px 44px;
    background: linear-gradient(135deg, rgba(248, 246, 241, 0.98) 0%, rgba(239, 232, 219, 0.98) 100%);
    border: 1px solid rgba(24, 24, 24, 0.08);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(24, 24, 24, 0.14);
    text-align: center;
}

.hd-lang-kicker {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(24, 24, 24, 0.42);
}

.hd-lang-modal h3 {
    margin: 0 0 28px;
    font-size: 28px;
    font-weight: 400;
    color: rgb(24, 24, 24);
    letter-spacing: -0.03em;
}

.hd-lang-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hd-lang-option {
    padding: 18px 14px;
    border: 1px solid rgba(24, 24, 24, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    text-align: center;
}

.hd-lang-option:hover {
    border-color: rgba(255, 152, 0, 0.38);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(24, 24, 24, 0.12);
}

.hd-lang-option strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgb(24, 24, 24);
}

.hd-lang-option span {
    display: none;
}

/* ── Floating language picker ───────────────────────────────── */

.hd-float-picker {
    display: none !important;
}

.hd-float-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: rgba(14, 14, 14, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hd-float-toggle::before {
    content: "🌐";
    font-size: 13px;
}

.hd-float-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(24, 24, 24, 0.96);
}

.hd-float-list {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: rgba(14, 14, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-width: 170px;
    display: none;
}

.hd-float-picker.hd-open .hd-float-list {
    display: block;
}

.hd-float-list li {
    display: block;
}

.hd-float-list button {
    width: 100%;
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.hd-float-list button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.hd-float-list button.hd-active {
    color: rgb(255, 152, 0);
    font-weight: 600;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 991px) {
    .mil-frame-top .hd-lang-slot {
        right: 70px;
    }
}

@media (max-width: 767px) {
    .hd-lang-switcher {
        gap: 4px;
        padding: 4px;
    }

    .hd-lang-switcher a {
        min-width: 38px;
        min-height: 30px;
        padding: 0 10px;
        font-size: 10px;
        letter-spacing: 0.14em;
    }

    .hd-lang-modal {
        padding: 38px 22px 24px;
    }

    .hd-lang-modal h3 {
        margin-bottom: 20px;
        font-size: 24px;
    }

    .hd-lang-actions {
        grid-template-columns: 1fr;
    }

    .mil-frame-top .hd-lang-slot,
    .mil-menu-frame .mil-frame-top .hd-lang-slot {
        right: 66px;
    }
}
