

<?php $__env->startSection('title', 'Shopping Cart'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-6">
    <div class="rounded-3xl bg-white p-8 shadow-sm">
        <h1 class="text-2xl font-semibold">Your Cart</h1>
        <p class="text-slate-600 mt-2">Review your selected products before checkout.</p>
    </div>

    <?php if($items->isEmpty()): ?>
        <div class="rounded-3xl bg-white p-8 shadow-sm text-slate-600">Your cart is empty. Browse products and add items to get started.</div>
    <?php else: ?>
        <div class="space-y-4">
            <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="rounded-3xl bg-white p-5 shadow-sm grid gap-4 md:grid-cols-[120px_1fr_auto] items-center">
                    <img src="<?php echo e($item['product']->image); ?>" alt="<?php echo e($item['product']->name); ?>" class="h-28 w-28 rounded-3xl object-cover">
                    <div class="space-y-2">
                        <h2 class="text-lg font-semibold"><?php echo e($item['product']->name); ?></h2>
                        <p class="text-sm text-slate-500">Quantity: <?php echo e($item['quantity']); ?></p>
                        <p class="text-slate-900 font-semibold">₹<?php echo e(number_format($item['product']->display_price * $item['quantity'], 2)); ?></p>
                    </div>
                    <form method="POST" action="<?php echo e(route('cart.remove', $item['product']->id)); ?>" class="text-right">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="rounded-full bg-rose-600 px-4 py-2 text-white text-sm hover:bg-rose-700">Remove</button>
                    </form>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <div class="rounded-3xl bg-white p-6 shadow-sm flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
            <div>
                <p class="text-sm text-slate-500">Estimated total</p>
                <p class="text-2xl font-semibold text-slate-900">₹<?php echo e(number_format($items->sum(fn($item) => $item['product']->display_price * $item['quantity']), 2)); ?></p>
            </div>
            <a href="<?php echo e(route('home')); ?>" class="rounded-full bg-slate-900 px-6 py-3 text-white text-sm font-semibold hover:bg-slate-800">Continue Shopping</a>
        </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\phunt\resources\views/cart/index.blade.php ENDPATH**/ ?>