/* ── Language Selector ── */
.i18n-wrapper {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 20px;
    z-index: 10001;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    contain: layout paint;
    pointer-events: auto;
    isolation: isolate;
}

.i18n-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #e2e8f0;
    font-size: 22px;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .45);
    transition: transform .2s, box-shadow .2s;
    pointer-events: auto;
    touch-action: manipulation;
}

.i18n-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(0, 0, 0, .55);
}

.i18n-menu {
    position: absolute;
    bottom: 56px;
    left: 0;
    min-width: 210px;
    max-height: 420px;
    overflow-y: auto;
    background: rgba(15, 23, 42, .88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
    pointer-events: auto;
}

.i18n-menu.open {
    display: flex;
}

.i18n-menu button {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, color .15s;
}

.i18n-menu button:hover {
    background: rgba(251, 191, 36, .12);
    color: #fbbf24;
}

.i18n-menu button.active {
    background: rgba(251, 191, 36, .18);
    color: #fbbf24;
    font-weight: 600;
}

.i18n-menu button .flag {
    font-size: 20px;
    line-height: 1
}

.i18n-menu::-webkit-scrollbar {
    width: 6px;
}

.i18n-menu::-webkit-scrollbar-track {
    background: transparent;
}

.i18n-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .15);
    border-radius: 3px;
}

@media(max-width:480px) {
    .i18n-wrapper {
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        left: 12px;
    }

    .i18n-toggle {
        width: 40px;
        height: 40px;
        font-size: 19px;
    }

    .i18n-menu {
        min-width: 180px;
        max-height: 320px;
    }
}
