<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Keranjang Belanja | Empal Gentong Haji Apud</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        'terracotta': { 50: '#fff7f5', 500: '#f85333', 600: '#e03a1d', 700: '#bc2e16' }
                    },
                    fontFamily: {
                        serif: ['Playfair Display', 'serif'],
                        sans: ['Plus Jakarta Sans', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');
        html { scroll-behavior: smooth; }
    </style>
</head>
<body class="bg-stone-50 text-gray-800 font-sans pt-32 pb-20">

    <nav class="bg-white/95 backdrop-blur-sm shadow-sm fixed w-full z-50 top-0 border-b border-stone-100">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-24 items-center">
                <div class="flex items-center gap-3">
                    <div class="w-12 h-12 bg-amber-700 rounded-full flex items-center justify-center text-white font-bold text-xl shadow-inner">H</div>
                    <span class="font-serif text-3xl font-bold text-amber-800">Haji Apud.</span>
                </div>
                <div class="flex items-center gap-6">
                    <a href="<?php echo e(url('/')); ?>" class="text-gray-600 hover:text-terracotta-600 font-medium flex items-center gap-2">
                        <i class="fas fa-arrow-left"></i> Lanjut Belanja
                    </a>
                </div>
            </div>
        </div>
    </nav>

    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <h1 class="font-serif text-4xl font-bold text-gray-950 mb-10">Keranjang Belanja</h1>

        <?php if(count($cart) > 0): ?>
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-10">
                <div class="lg:col-span-2 bg-white rounded-3xl border border-stone-100 shadow-sm p-8">
                    <div class="overflow-x-auto">
                        <table class="w-full text-left border-collapse">
                            <thead>
                                <tr class="border-b border-stone-200 text-stone-500 text-sm uppercase tracking-wider">
                                    <th class="pb-4 font-semibold">Produk</th>
                                    <th class="pb-4 font-semibold text-center">Harga</th>
                                    <th class="pb-4 font-semibold text-center">Jumlah</th>
                                    <th class="pb-4 font-semibold text-right">Subtotal</th>
                                </tr>
                            </thead>
                            <tbody class="divide-y divide-stone-100">
                                <?php $__currentLoopData = $cart; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr class="text-gray-800">
                                    <td class="py-6 flex items-center gap-4">
                                        <div class="w-16 h-16 bg-stone-100 rounded-xl flex items-center justify-center text-stone-400">
                                            <i class="fas fa-image text-2xl"></i>
                                        </div>
                                        <div>
                                            <p class="font-bold text-lg"><?php echo e($item['name']); ?></p>
                                            <p class="text-sm text-stone-500">Berat: <?php echo e($item['weight']); ?>g</p>
                                        </div>
                                    </td>
                                    <td class="py-6 text-center font-medium text-stone-600">
                                        Rp <?php echo e(number_format($item['price'], 0, ',', '.')); ?>

                                    </td>
                                    <td class="py-6 text-center">
                                        <span class="bg-stone-100 px-4 py-2 rounded-lg font-bold"><?php echo e($item['quantity']); ?></span>
                                    </td>
                                    <td class="py-6 text-right font-bold text-terracotta-600 text-lg">
                                        Rp <?php echo e(number_format($item['price'] * $item['quantity'], 0, ',', '.')); ?>

                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="bg-white rounded-3xl border border-stone-100 shadow-sm p-8 h-fit sticky top-32">
                    <h2 class="text-2xl font-bold text-gray-950 mb-6">Ringkasan Pesanan</h2>
                    
                    <div class="space-y-4 mb-8">
                        <div class="flex justify-between text-stone-600">
                            <span>Total Item</span>
                            <span class="font-semibold"><?php echo e(count($cart)); ?> Produk</span>
                        </div>
                        <div class="flex justify-between text-stone-600">
                            <span>Estimasi Ongkir</span>
                            <span class="text-sm italic">Dihitung saat checkout</span>
                        </div>
                        <div class="border-t border-stone-200 pt-4 flex justify-between items-center">
                            <span class="font-bold text-lg">Total Belanja</span>
                            <span class="font-extrabold text-2xl text-terracotta-600">Rp <?php echo e(number_format($total, 0, ',', '.')); ?></span>
                        </div>
                    </div>

                    <!-- TOMBOL SUDAH DIPERBARUI MENJADI LINK -->
                    <a href="<?php echo e(route('checkout.index')); ?>" class="w-full bg-terracotta-600 hover:bg-terracotta-700 text-white py-4 rounded-xl font-bold text-lg transition-colors shadow-lg flex items-center justify-center gap-2 cursor-pointer block text-center">
                        Lanjut ke Checkout <i class="fas fa-arrow-right"></i>
                    </a>
                </div>
            </div>
        <?php else: ?>
            <div class="bg-white rounded-3xl border border-stone-100 shadow-sm p-16 text-center flex flex-col items-center">
                <div class="w-24 h-24 bg-stone-100 rounded-full flex items-center justify-center text-stone-300 mb-6">
                    <i class="fas fa-shopping-basket text-4xl"></i>
                </div>
                <h2 class="text-2xl font-bold text-gray-950 mb-2">Keranjang Anda masih kosong</h2>
                <p class="text-stone-500 mb-8">Sepertinya Anda belum memilih kelezatan apa pun.</p>
                <a href="<?php echo e(url('/')); ?>" class="bg-gray-950 hover:bg-terracotta-600 text-white px-8 py-4 rounded-xl font-semibold transition-colors">
                    Mulai Belanja
                </a>
            </div>
        <?php endif; ?>

    </div>
</body>
</html><?php /**PATH C:\Users\USER\Documents\web\hapudstore\haji-apud-store\resources\views/cart.blade.php ENDPATH**/ ?>