@php
    $current = app()->getLocale();
    $locales = ['en' => 'EN', 'es' => 'ES', 'pt_BR' => 'PT'];
@endphp
<nav class="{{ $class ?? 'flex flex-wrap gap-2 justify-end items-center text-xs sm:text-sm' }}" role="navigation" aria-label="{{ __('app.common.language') }}">
@foreach ($locales as $code => $label)
    <a href="{{ route('locale.switch', ['locale' => $code]) }}"
       class="{{ ($linkClass ?? 'px-2 py-0.5 rounded transition-opacity hover:opacity-100') }} {{ $current === $code ? 'font-bold underline opacity-100' : 'opacity-75' }}">{{ $label }}</a>
@endforeach
</nav>
