<nav
  class="fixed w-full bg-white/95 backdrop-blur-sm z-50 border-b border-gray-100"
  id="nav"
>
  <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
    <div class="flex items-center justify-between h-20">
      <a
        href="javascript:location.reload()"
        class="text-3xl font-['Montserrat'] text-primary"
      >
        {{ settings.seo.title.split(' - ')[0] }}
      </a>

      <!-- Mobile Hamburger -->
      <div class="md:hidden">
        <button
          id="mobile-menu-button"
          type="button"
          class="text-gray-600 hover:text-primary focus:outline-none"
        >
          <i class="ri-menu-line text-2xl"></i>
        </button>
      </div>

      <!-- Desktop Navigation -->
      <div class="hidden md:flex space-x-8">
        {% for link in sections.navigation.links %}
        <a href="{{ link.url }}" class="text-gray-600 hover:text-primary"
          >{{ link.label }}</a
        >
        {% endfor %}
      </div>

      <!-- Desktop CTA -->
      <div class="hidden md:flex items-center space-x-6">
        {% for link in sections.navigation.items %}
        <a href="{{ link.url }}" class="text-gray-700 hover:text-primary"
          >{{ link.label }}</a
        >
        {% endfor %} {% if sections.navigation.ctaItems and
        sections.navigation.ctaItems|length > 0 %} {% for ctaItem in
        sections.navigation.ctaItems %}
        <a
          href="{{ ctaItem.url }}"
          class="px-6 py-2 bg-primary text-white rounded hover:bg-primary/90"
        >
          {{ ctaItem.label }}
        </a>
        {% endfor %} {% endif %}
      </div>
    </div>
  </div>

  <!-- Mobile Menu -->
  <ul
    id="mobile-menu"
    class="hidden absolute top-full left-0 w-full bg-white border-t border-gray-200 shadow-md flex flex-col gap-4 p-4 md:hidden"
  >
    <div class="px-6 pt-4 pb-6 space-y-3">
      {% for link in sections.navigation.items %}
      <li>
        <a
          href="{{ link.url }}"
          onclick="toggleMobileMenu()"
          class="block text-gray-600 hover:text-primary py-2"
          >{{ link.label }}</a
        >
      </li>
      {% endfor %} {% if sections.navigation.ctaItems and
      sections.navigation.ctaItems|length > 0 %} {% for ctaItem in
      sections.navigation.ctaItems %}
      <li>
        <a
          href="{{ ctaItem.url }}"
          onclick="toggleMobileMenu()"
          class="block text-center px-8 py-3 bg-primary text-white rounded hover:bg-primary/90"
        >
          {{ ctaItem.label }}
        </a>
      </li>
      {% endfor %} {% endif %}
    </div>
  </ul>

  <script>
    function toggleMobileMenu() {
      var menu = document.getElementById("mobile-menu");
      menu.classList.toggle("hidden");
    }
    document
      .getElementById("mobile-menu-button")
      .addEventListener("click", toggleMobileMenu);
  </script>
</nav>
