<!-- Desktop nav -->
<nav class="hidden md:flex gap-4 text-sm ml-2 w-full justify-end items-center">
  {% set all_href = (url_for('market.browse.browse_all') ~ qs)|host %}
  {% set all_active = (category_label == 'All Products') %}
  <div class="relative nav-group">
    <a
      href="{{ all_href }}"
      hx-get="{{ all_href }}"
      hx-target="#main-panel"
      hx-select="{{hx_select_search}}"
      hx-swap="outerHTML"
      hx-push-url="true"
      aria-selected="{{ 'true' if all_active else 'false' }}"
      class="block px-2 py-1 rounded text-center whitespace-normal break-words leading-snug bg-stone-200 text-black {{select_colours}}">
      All
    </a>
  </div>

  {% for cat, data in categories.items() %}
  {% set cat_href = (url_for('market.browse.browse_top', top_slug=data.slug) ~ qs)|host%}
  {% set cat_active = (cat == category_label) %}
  <div class="relative nav-group">
    <a
      href="{{ cat_href }}"
      hx-get="{{ cat_href }}"
      hx-target="#main-panel"
      hx-select="{{hx_select_search}}"
      hx-swap="outerHTML"
      hx-push-url="true"
      aria-selected="{{ 'true' if cat_active else 'false' }}"
      class="block px-2 py-1 rounded text-center whitespace-normal break-words leading-snug bg-stone-200 text-black {{select_colours}}"
    >
      {{ cat }}
    </a>
  </div>
  {% endfor %}
  {% include '_types/market/_admin.html' %}
</nav>
