@if(($multilang_enabled ?? false) && count($multilang_languages ?? []) > 1)
<div class="relative group">
    <button type="button" class="flex items-center justify-center w-9 h-9 rounded-full border-2 border-current text-slate-600 hover:text-slate-900 hover:border-slate-400 transition focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-slate-400" aria-label="{{ __('Changer de langue') }}" aria-expanded="false" aria-haspopup="true" id="lang-switcher-btn">
        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"/></svg>
    </button>
    <div class="absolute right-0 top-full mt-2 py-2 min-w-[140px] bg-white rounded-xl border border-slate-200 shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50" role="menu">
        @foreach($multilang_languages as $code => $label)
            <a href="{{ route('locale.switch', $code) }}" class="block px-4 py-2.5 text-sm {{ ($multilang_current ?? '') === $code ? 'font-semibold text-slate-900 bg-slate-50' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900' }} transition" role="menuitem">{{ $label }}</a>
        @endforeach
    </div>
</div>
@endif
