{%- comment -%}
Language switcher — footer legal bar, matching the marketing site's design
(src/site/partials/footer.html {{LANG_SWITCH}} + .bs-foot-lang in chrome.css):
two quiet text entries at legal-bar weight, hairline between them, the current
locale simply darker. Same position on both properties, so a visitor moving
between site and store finds one convention.

Renders ONLY where the market publishes more than one language — today that is
Japan alone (ja-JP + en-JP). Everywhere else the footer is unchanged.

Mechanically unlike the site: the site's locales are plain hrefs (/ja/...),
but a Shopify language lives inside a market, so switching is a POST of
locale_code to the localization form — links at /ja-jp/ would change MARKET,
repricing the buyer. The named submit buttons carry locale_code themselves, so
this needs no hidden input, no dropdown, and no JS: it does not use the
<localization-form> custom element at all, and works with scripts blocked.

The previous nav-pill dropdown version of this snippet (EN ▾ next to the cart,
plus a copy in the mobile overlay) was replaced by this at Max's request —
one footer instance now covers desktop and mobile, since the footer renders on
both. Buttons are styled as links; the current locale stays clickable, matching
the site, and carries aria-current.
{%- endcomment -%}

{%- if localization.available_languages.size > 1 -%}
  {%- form 'localization', id: id, class: 'bs-foot-lang-form' -%}
    <nav class="bs-foot-lang" aria-label="{{ 'localization.language_label' | t }}">
      {%- for language in localization.available_languages -%}
        <button type="submit"
                name="locale_code"
                value="{{ language.iso_code }}"
                lang="{{ language.iso_code }}"
                {% if language.iso_code == localization.language.iso_code %}aria-current="true"{% endif %}>
          {{- language.endonym_name | capitalize -}}
        </button>
      {%- endfor -%}
    </nav>
  {%- endform -%}
{%- endif -%}
