@php $navBase = request()->routeIs('website.show') ? '' : route('website.show', ['slug' => $academy->slug]); @endphp
<nav class="site-nav site-nav--solid" id="site-navbar">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="flex items-center justify-between h-20">
            {{-- Links Start --}}
            <div class="hidden lg:flex items-center gap-1 flex-1 justify-end">
                @foreach($sections->take(3) as $navSection)
                    <a href="{{ $navBase }}#section-{{ $navSection->section_key->value }}" class="px-3 py-2 text-sm font-medium text-white/80 hover:text-white rounded-lg hover:bg-white/5 transition-all">
                        {{ $navSection->title ?? $navSection->section_key->label() }}
                    </a>
                @endforeach
            </div>

            {{-- Centered Logo --}}
            <a href="{{ $navBase }}#section-hero" class="flex items-center gap-3 group mx-8">
                @if($academy->logo_path)
                    <img src="{{ asset('storage/' . $academy->logo_path) }}" alt="{{ $academy->name_ar }}" class="h-12 w-12 rounded-xl object-contain transition-transform group-hover:scale-110">
                @endif
                <span class="text-lg font-bold text-white hidden sm:block">{{ $academy->name_ar }}</span>
            </a>

            {{-- Links End --}}
            <div class="hidden lg:flex items-center gap-1 flex-1">
                @foreach($sections->skip(3)->take(3) as $navSection)
                    <a href="{{ $navBase }}#section-{{ $navSection->section_key->value }}" class="px-3 py-2 text-sm font-medium text-white/80 hover:text-white rounded-lg hover:bg-white/5 transition-all">
                        {{ $navSection->title ?? $navSection->section_key->label() }}
                    </a>
                @endforeach
                <a href="{{ $settings->navbar_cta_link ?? ($navBase . '#section-contact') }}" class="ms-2 site-btn site-btn--primary text-sm !py-1.5 !px-4">
                    {{ $settings->navbar_cta_text ?? 'سجّل الآن' }}
                </a>
            </div>

            <button type="button" class="lg:hidden p-2 rounded-lg text-white/80 hover:text-white hover:bg-white/10 transition-colors" onclick="document.getElementById('mobile-menu').classList.toggle('hidden')" aria-label="القائمة">
                <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
            </button>
        </div>
    </div>
    @include('website.navbars._mobile_menu')
</nav>
