@php
    $c = (array) ($site->contact ?? []);
    $social = (array) ($site->social ?? []);
    $hours = (array) ($site->hours ?? []);
    $navPages = $navPages ?? collect();
@endphp
<footer class="cl-footer">
    <div class="vs-container cl-footer-grid">
        <div class="cl-footer-col">
            <a href="/" class="cl-logo" style="color:#fff">
                @if($site->logoUrl())<img src="{{ $site->logoUrl() }}" alt="">@else<span class="cl-logo-mark"><i class="fas fa-plus"></i></span>@endif
                <span>{{ $site->name }}</span>
            </a>
            @if($site->tagline)<p class="cl-footer-about">{{ $site->tagline }}</p>@endif
            <div class="cl-social">
                @foreach(['facebook','instagram','twitter','youtube','linkedin'] 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="cl-footer-col"><h4>Quick links</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 class="cl-footer-col"><h4>Contact</h4><ul class="cl-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 class="cl-footer-col"><h4>Working hours</h4><ul class="cl-footer-hours">@foreach($hours as $row)<li><span>{{ $row['day'] ?? '' }}</span><span>{{ $row['time'] ?? '' }}</span></li>@endforeach</ul></div>@endif
    </div>
    <div class="cl-footer-bar"><div class="vs-container">
        <span>© {{ now()->year }} {{ $site->name }}. All rights reserved.</span>
        <span style="opacity:.6">Powered by VET One</span>
    </div></div>
</footer>
