[Back]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <title>{{ config('app.name') }}</title>
    @vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="bg-gray-50 text-gray-900">
    <nav class="bg-white border-b">
        <div class="max-w-6xl mx-auto px-4 py-4 flex items-center justify-between">
            <a href="{{ route('landing') }}" class="font-bold text-lg">{{ config('app.name') }}</a>
            <div class="flex gap-4 items-center">
                @auth
                    <span class="text-sm text-gray-700">
                        {{ auth()->user()->name }}
                    </span>
                    @if(auth()->user()->is_admin)
                        <a href="{{ route('admin.products.index') }}" class="text-sm underline">Product Manage</a>
                        <a href="{{ route('admin.orders.index') }}" class="text-sm underline">Orders Manage</a>
                        <a href="{{ route('admin.customers.index') }}" class="text-sm underline">Customers</a>

                    @endif


                    <a href="{{ route('cart.index') }}" class="text-sm underline">Cart</a>
                    {{-- <a href="{{ route('dashboard') }}" class="text-sm underline">Dashboard</a> --}}
                    <a href="{{ route('customer.profile.edit') }}" class="text-sm underline">My Profile</a>


                    <form method="POST" action="{{ route('logout') }}" class="inline">
                        @csrf
                        <button type="submit" class="text-sm underline">Logout</button>
                    </form>
                @else
                    <a href="{{ route('login') }}" class="text-sm underline">Login</a>
                    {{-- <a href="{{ route('register') }}" class="text-sm underline">Register</a> --}}
                @endauth

            </div>
        </div>
    </nav>

    <main class="max-w-6xl mx-auto px-4 py-10">
        @if(session('success'))
            <div class="mb-6 p-4 rounded bg-green-100 border border-green-200">
                {{ session('success') }}
            </div>
        @endif

        {{ $slot ?? '' }}
        @yield('content')
    </main>

    <footer class="border-t bg-white">
        <div class="max-w-6xl mx-auto px-4 py-8 text-sm text-gray-500">
            © {{ date('Y') }} {{ config('app.name') }}
        </div>
    </footer>
</body>
</html>