@php
    $c = (array) ($site->contact ?? []);
    $social = (array) ($site->social ?? []);
    $hours = (array) ($site->hours ?? []);
    $navPages = $navPages ?? collect();
@endphp
<footer class="gr-footer">
    <div class="vs-container gr-footer-top" data-aos="fade-up">
        <a href="/" class="gr-logo" style="color:#fff;justify-content:center;">
            @if($site->logoUrl())<img src="{{ $site->logoUrl() }}" alt="">@else<span class="gr-logo-mark"><i class="fas fa-scissors"></i></span>@endif
            <span>{{ $site->name }}</span>
        </a>
        @if($site->tagline)<p class="gr-footer-tag">{{ $site->tagline }}</p>@endif
        <div class="gr-social">
            @foreach(['facebook','instagram','twitter','youtube','tiktok'] as $net)
                @if(!empty($social[$net]))<a href="{{ $social[$net] }}" target="_blank" rel="noopener"><i class="fab fa-{{ $net }}"></i></a>@endif
            @endforeach
        </div>
    </div>
    <div class="vs-container gr-footer-grid">
        <div><h4>Explore</h4><ul>@foreach($navPages as $p)<li><a href="{{ $p->is_home ? '/' : '/'.$p->slug }}">{{ $p->title }}</a></li>@endforeach<li><a href="/portal">Client Portal</a></li></ul></div>
        <div><h4>Contact</h4><ul class="gr-footer-contact">
            @if(!empty($c['address']))<li><i class="fas fa-location-dot"></i> {{ $c['address'] }}</li>@endif
            @if(!empty($c['phone']))<li><i class="fas fa-phone"></i> {{ $c['phone'] }}</li>@endif
            @if(!empty($c['email']))<li><i class="fas fa-envelope"></i> {{ $c['email'] }}</li>@endif
        </ul></div>
        @if($hours)<div><h4>Hours</h4><ul class="gr-footer-hours">@foreach($hours as $row)<li><span>{{ $row['day'] ?? '' }}</span><span>{{ $row['time'] ?? '' }}</span></li>@endforeach</ul></div>@endif
    </div>
    <div class="gr-footer-bar"><div class="vs-container">
        <span>© {{ now()->year }} {{ $site->name }}</span><span style="opacity:.6">Powered by Shifa One</span>
    </div></div>
</footer>
