@php
    $navPages = $navPages ?? collect();
    $cur = '/' . ltrim(request()->path() === '/' ? '' : request()->path(), '/');
    $opts = (array) ($site->options ?? []);
    $ctaLabel = $opts['cta_label'] ?? 'Book now';
    $ctaUrl   = $opts['cta_url'] ?? '#contact';
@endphp
<header class="gr-header" :class="{ 'is-scrolled': scrolled }">
    <div class="vs-container gr-nav-in">
        <a href="/" class="gr-logo">
            @if($site->logoUrl())<img src="{{ $site->logoUrl() }}" alt="{{ $site->name }}">
            @else<span class="gr-logo-mark"><i class="fas fa-scissors"></i></span>@endif
            <span>{{ $site->name ?: 'Wellness Spa' }}</span>
        </a>
        <nav class="gr-nav">
            @foreach($navPages as $p)
                @php($href = $p->is_home ? '/' : '/' . $p->slug)
                <a href="{{ $href }}" class="{{ $cur === $href ? 'is-active' : '' }}">{{ $p->title }}</a>
            @endforeach
            <a href="/portal">Portal</a>
        </nav>
        <a href="{{ $ctaUrl }}" class="gr-cta">{{ $ctaLabel }}</a>
        <button class="gr-burger" @click="menu=true" aria-label="Menu"><i class="fas fa-bars"></i></button>
    </div>

    <div class="vs-drawer" :class="{ 'is-open': menu }" x-cloak>
        <div class="vs-drawer-overlay" @click="menu=false"></div>
        <div class="vs-drawer-panel">
            <button class="vs-drawer-close" @click="menu=false"><i class="fas fa-times"></i></button>
            <nav>
                @foreach($navPages as $p)<a href="{{ $p->is_home ? '/' : '/'.$p->slug }}" @click="menu=false">{{ $p->title }}</a>@endforeach
                <a href="/portal" @click="menu=false">Portal</a>
                <a href="{{ $ctaUrl }}" class="gr-cta" @click="menu=false" style="margin-top:14px;justify-content:center;">{{ $ctaLabel }}</a>
            </nav>
        </div>
    </div>
</header>
