@extends('site.templates.voyage.layout')

@section('content')
    <section class="v-page-head v-page-head--band">
        <div class="v-container">
            <h1 class="v-page-head__title">{{ isset($searchTerm) && $searchTerm !== '' ? '"' . $searchTerm . '" için sonuçlar' : 'Turlarımız' }}</h1>
            @include('site.templates.voyage.partials.search-band', [
                'tourTypes' => $tourTypes,
                'compact' => true,
                'popular' => [],
            ])
        </div>
    </section>

    @forelse($groups as $group)
        <section class="v-section">
            <div class="v-container">
                <header class="v-section__header v-section__header--row">
                    <h2 class="v-section__title">{{ $group['type']->name }}</h2>
                    <a class="v-btn v-btn--ghost v-btn--sm"
                       href="{{ $preview ? '#' : route('customer.agency.tours.list', ['agency' => $agency->slug, 'type' => $group['type']->route_slug]) }}">
                        Tümünü Gör <x-voyage.icon name="arrow-right" />
                    </a>
                </header>
                <div class="v-grid v-grid--cards">
                    @foreach($group['tours'] as $tour)
                        @include('site.templates.voyage.partials.tour-card', [
                            'tour' => $tour,
                            'type' => $group['type'],
                            'variant' => 'vertical',
                        ])
                    @endforeach
                </div>
            </div>
        </section>
    @empty
        <section class="v-section">
            <div class="v-container v-empty-state">
                <x-voyage.icon name="search" />
                <h2>Sonuç bulunamadı</h2>
                <p>Aradığınız kriterlere uygun tur bulunamadı. Farklı bir arama deneyin ya da bizimle iletişime geçin.</p>
                <a href="{{ $preview ? '#' : route('customer.agency.contact', $agency->slug) }}" class="v-btn v-btn--primary">Bize Ulaşın</a>
            </div>
        </section>
    @endforelse
@endsection
