<script lang="ts">
	import { page } from '$app/stores';
	import { mobileNavItems, isActiveRoute } from './nav';
</script>

<nav
	aria-label="Hauptnavigation"
	class="hidden md:flex lg:hidden gap-2 items-center p-2"
>
	{#each mobileNavItems as item (item.href)}
		{@const active = isActiveRoute(item.href, $page.url.pathname)}
		<a
			href={item.href}
			aria-current={active ? 'page' : undefined}
			class="px-4 py-2 rounded-[var(--radius-md)] text-[13px] font-[var(--font-sans)] {active
				? 'bg-[var(--green-tint)] text-[var(--green-dark)] font-medium'
				: 'hover:bg-[var(--color-subtle)]'}"
		>
			<span>{item.icon}</span>
			{item.label}
		</a>
	{/each}
</nav>
