<div class="collapse navbar-collapse" id="navbarNav">
  <ul class="navbar-nav ms-auto">
    <li class="nav-item">
      <a class="nav-link{{ if .IsHome }} active{{ end }}" aria-current="page" href="{{ "/" | relLangURL }}">Home</a>
    </li>
    {{ range .Site.Menus.main }}
    <li class="nav-item">
      <a class="nav-link{{ if $.IsMenuCurrent "main" . }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
    </li>
    {{ end }}

    {{/* Language Switcher - Show only alternative language */}}
    {{ if .IsTranslated }}
      {{ range .Translations }}
        <li class="nav-item">
          <a class="nav-link" href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
        </li>
      {{ end }}
    {{ else }}
      {{/* Fallback to home page if no translation exists */}}
      {{ range .Site.Languages }}
        {{ if ne $.Language.Lang .Lang }}
          <li class="nav-item">
            <a class="nav-link" href="{{ .Lang | relLangURL }}">{{ .LanguageName }}</a>
          </li>
        {{ end }}
      {{ end }}
    {{ end }}
  </ul>
</div>
