@extends('layouts.app')
@section('title', 'Sitemap - AutoPart')

@section('content')
<div class="bg-gray-50 min-h-screen pb-16">
    <div class="bg-brand-dark text-white py-12 mb-8">
        <div class="container mx-auto px-4 text-center">
            <h1 class="text-4xl font-extrabold uppercase tracking-widest mb-4">Site Map</h1>
            <div class="flex items-center justify-center space-x-2 text-sm text-gray-400">
                <a href="{{ url('/') }}" class="hover:text-brand-red transition-colors">Home</a>
                <i data-lucide="chevron-right" class="w-3.5 h-3.5"></i>
                <span class="text-white">Sitemap</span>
            </div>
        </div>
    </div>

    <div class="container mx-auto px-4">
        <div class="bg-white rounded-lg shadow-sm border border-gray-100 p-8 lg:p-12 max-w-4xl mx-auto">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-12">
                @foreach([
                    ['Main Pages', [['/' => 'Home'], ['/shop' => 'Shop'], ['/specials' => 'Special Offers'], ['/brands' => 'Our Brands'], ['/about' => 'About Us'], ['/contact' => 'Contact Us'], ['/blog' => 'Blog']]],
                    ['Categories', [['/shop?category=Engine+Parts' => 'Engine Parts'], ['/shop?category=Body+Parts' => 'Body Parts'], ['/shop?category=Lighting' => 'Lighting'], ['/shop?category=Wheels+%26+Tires' => 'Wheels & Tires'], ['/shop?category=Brakes+%26+Rotors' => 'Brakes & Rotors'], ['/shop?category=Maintenance' => 'Maintenance']]],
                    ['Account', [['/auth' => 'Login / Register'], ['/dashboard' => 'My Dashboard'], ['/cart' => 'Shopping Cart'], ['/checkout' => 'Checkout']]]
                ] as $section)
                <div>
                    <h3 class="text-lg font-extrabold text-brand-dark uppercase tracking-wider mb-4 pb-3 border-b border-gray-100 relative">
                        {{ $section[0] }}
                        <span class="absolute bottom-0 left-0 w-10 h-0.5 bg-brand-red"></span>
                    </h3>
                    <ul class="space-y-3">
                        @foreach($section[1] as $link)
                            @php $url = array_key_first($link); @endphp
                            <li>
                                <a href="{{ url($url) }}" class="text-gray-600 hover:text-brand-red transition-colors text-sm flex items-center space-x-2">
                                    <i data-lucide="chevron-right" class="w-3 h-3 text-brand-red"></i>
                                    <span>{{ $link[$url] }}</span>
                                </a>
                            </li>
                        @endforeach
                    </ul>
                </div>
                @endforeach
            </div>
        </div>
    </div>
</div>
@endsection
