{{--
/*
 * SERVOKNIT HEADER — APPROVED & LOCKED
 * Do not modify during unrelated redesigns.
 */
--}}
@php($nav = [['Home','home','home'],['About','about','about'],['Products','products.index','products.*'],['Insights','insights.index','insights.*'],['Contact','contact','contact']])
<header id="site-top" x-data="header" :class="{ 'is-scrolled': scrolled, 'menu-open': open }" class="site-header">
    <div class="nav-shell">
        <a href="{{ route('home') }}" class="logo-lockup" aria-label="Servoknit home"><span class="logo-wrap"><img src="{{ asset('images/Sarvoknit_logo.jpeg') }}" alt="Servoknit" width="1254" height="1254" loading="eager" decoding="async"></span><span class="logo-word">SERVO<strong>KNIT</strong></span></a>
        <nav class="desktop-nav" aria-label="Primary">
            @foreach($nav as [$label,$route,$active])
                @if($route === 'products.index')
                    <div class="nav-dropdown"><a href="{{ route($route) }}" @class(['nav-link','active'=>request()->routeIs($active)])>Products <span class="nav-chevron" aria-hidden="true"><svg viewBox="0 0 10 10" focusable="false"><path d="M2 3.5 5 6.5 8 3.5" /></svg></span></a><div class="dropdown-panel"><a href="{{ route('products.mutton-cloth') }}"><span>01</span>Mutton Cloth</a><a href="{{ route('products.stockinette') }}"><span>02</span>Stockinette</a></div></div>
                @else<a href="{{ route($route) }}" @class(['nav-link','active'=>request()->routeIs($active)]) @if(request()->routeIs($active)) aria-current="page" @endif>{{ $label }}</a>@endif
            @endforeach
        </nav>
        <div class="nav-actions"><a href="{{ route('contact',['intent'=>'quote']) }}" class="nav-enquiry">Request a quote <span aria-hidden="true">→</span></a><button x-ref="trigger" type="button" class="menu-toggle" @click="toggleMenu()" :aria-expanded="open" :aria-label="open ? 'Close navigation' : 'Open navigation'" aria-controls="mobile-menu"><span></span><span></span></button></div>
    </div>
    <div id="mobile-menu" x-cloak x-show="open" x-transition.opacity.duration.200ms class="mobile-menu" @keydown.tab="containFocus($event)" role="dialog" aria-modal="true" aria-label="Site navigation" data-lenis-prevent>
        <div class="mobile-menu-inner"><p class="mobile-menu-label">Navigation</p><nav>@foreach($nav as [$label,$route,$active])<a href="{{ route($route) }}" @click="closeMenu(false)" @class(['mobile-link','active'=>request()->routeIs($active)]) @if($loop->first) x-ref="firstLink" @endif><span>{{ str_pad($loop->iteration,2,'0',STR_PAD_LEFT) }}</span>{{ $label }}<i>→</i></a>@if($route === 'products.index')<div class="mobile-products"><a href="{{ route('products.mutton-cloth') }}" @click="closeMenu(false)">Mutton Cloth</a><a href="{{ route('products.stockinette') }}" @click="closeMenu(false)">Stockinette</a></div>@endif @endforeach</nav><a class="mobile-quote" href="{{ route('contact',['intent'=>'quote']) }}" @click="closeMenu(false)">Request a quote →</a></div>
    </div>
</header>
