/* shutto翻訳 カスタム言語切替ウィジェット */
.shutto-widget,
.shutto_translate_widget,
#shutto_translate_widget {
    display: none !important;
}

.lang-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: inline-flex !important;
    width: auto;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
}

/* 閉じているときは FAB 幅だけ。ホバー時の隙間は透明ブリッジで維持 */
.lang-widget:hover::before,
.lang-widget.is-open::before,
.lang-widget:focus-within::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 52px;
    width: 160px;
    height: 12px;
}

.lang-widget__fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1.5px solid #e8e8e8;
    font-size: 24px;
    line-height: 1;
}

.lang-widget__fab .flag,
.lang-widget__fab-flag {
    pointer-events: none;
    font-size: 24px;
    line-height: 1;
    min-width: 1em;
    min-height: 1em;
    display: block;
}

/* shutto 処理後に絵文字が消えても data-current で表示を維持 */
.lang-widget__fab-flag[data-current="ja"]:empty::before,
#langFabFlag[data-current="ja"]:empty::before {
    content: "🇯🇵";
    font-size: 24px;
}

.lang-widget__fab-flag[data-current="en"]:empty::before,
#langFabFlag[data-current="en"]:empty::before {
    content: "🇬🇧";
    font-size: 24px;
}

.lang-widget[data-stt-disabled] .lang-widget__fab-flag,
.lang-widget[data-stt-disabled] #langFabFlag {
    color: inherit !important;
    opacity: 1 !important;
}

.lang-widget__dropdown {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: 160px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: all 0.28s ease;
    pointer-events: none;
}

.lang-widget:hover .lang-widget__dropdown,
.lang-widget.is-open .lang-widget__dropdown,
.lang-widget:focus-within .lang-widget__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-widget__dropdown-header {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    padding: 8px 16px 4px;
    letter-spacing: 0.05em;
}

.lang-widget__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.lang-widget__option:hover {
    background: #f5f5f5;
}

.lang-widget__option.is-active,
.lang-widget__option[data-stt-active] {
    font-weight: 700;
    background: #f0f7ff;
}

.lang-widget__divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.lang-widget[data-stt-disabled] .lang-widget__dropdown-header,
.lang-widget[data-stt-disabled] .lang-widget__option .label {
    color: #999 !important;
}

@media screen and (max-width: 1023px) {
    .lang-widget {
        bottom: 72px;
        right: 12px;
    }
}
