{{-- resources/views/partials/search-results.blade.php --}}
@if ($ads->count() > 0) {{-- Results Header --}}
Search Results

{{ $ads->total() ?? $ads->count() }} ads found

{{-- View Toggle & Sort Options --}}
{{-- Google AdSense Banner (Top) --}}
{{-- Ads Grid/List Container --}}
@foreach ($ads as $index => $ad) {{-- Ad Item --}}
{{-- Image Section --}}
@if ($ad->mainImage) {{ $ad->title }} @else No Image @endif
{{-- Wishlist Button --}} @php $isFavorited = auth()->check() && in_array($ad->id, $favoriteAdIds ?? []); @endphp {{-- Condition Badge --}} @if (isset($ad->condition)) {{ ucfirst($ad->condition) }} @endif
{{-- Ad Details --}}
{{ $ad->title ?? 'Untitled' }}
{{ $ad->state ?? 'Location N/A' }} {{ $ad->created_at->diffForHumans() }}
{{-- Price Section --}}
@if ($ad->is_free || (isset($ad->price) && $ad->price == 0)) FREE @else {{ config('app.currency_symbol', '$') }}{{ number_format($ad->price, 2) }} @endif
{{-- Seller Info (if available) --}} @if (isset($ad->user))
{{ $ad->user->name ?? 'Seller' }}
@endif
{{-- Quick Actions --}}
{{-- Insert AdSense between ads (every 6th item) --}} @if (($index + 1) % 6 == 0 && !$loop->last)
@endif @endforeach
{{-- Pagination --}} @if (method_exists($ads, 'links'))
{{ $ads->links() }}
@endif @else {{-- No Results Found - Enhanced Empty State --}}

No Ads Found

We couldn't find any ads matching your search. Try adjusting your filters or browse our categories.

Browse Categories
{{-- Suggested Categories --}}
@endif
{{-- JavaScript Enhancements --}} @push('scripts') @endpush {{-- Additional CSS --}} @push('styles') @endpush