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

<?php $__env->startSection('content'); ?>

    <?php if (isset($component)) { $__componentOriginale19f62b34dfe0bfdf95075badcb45bc2 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale19f62b34dfe0bfdf95075badcb45bc2 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.breadcrumb','data' => ['items' => [['label' => 'Cart', 'url' => route('cart')], ['label' => 'Checkout']]]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('breadcrumb'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['items' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute([['label' => 'Cart', 'url' => route('cart')], ['label' => 'Checkout']])]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale19f62b34dfe0bfdf95075badcb45bc2)): ?>
<?php $attributes = $__attributesOriginale19f62b34dfe0bfdf95075badcb45bc2; ?>
<?php unset($__attributesOriginale19f62b34dfe0bfdf95075badcb45bc2); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale19f62b34dfe0bfdf95075badcb45bc2)): ?>
<?php $component = $__componentOriginale19f62b34dfe0bfdf95075badcb45bc2; ?>
<?php unset($__componentOriginale19f62b34dfe0bfdf95075badcb45bc2); ?>
<?php endif; ?>

    <section class="py-12 lg:py-16">
        <div class="container-shop">
            <h1 class="font-serif text-3xl font-medium sm:text-4xl">Checkout</h1>

            <div class="mt-10 grid gap-10 lg:grid-cols-[1fr_420px]">

                
                <form class="space-y-10" action="<?php echo e(route('checkout.store')); ?>" method="POST">
                    <?php echo csrf_field(); ?>

                    <fieldset>
                        <legend class="mb-5 font-serif text-xl font-medium">Contact Information</legend>
                        <div class="grid gap-5 sm:grid-cols-2">
                            <div>
                                <label for="customer_name" class="field-label">Full Name <span class="text-terra-500">*</span></label>
                                <input id="customer_name" name="customer_name" type="text" value="<?php echo e(old('customer_name', $user->name ?? '')); ?>" class="field-input" required placeholder="Ananya Sharma">
                            </div>
                            <div>
                                <label for="customer_email" class="field-label">Email Address <span class="text-terra-500">*</span></label>
                                <input id="customer_email" name="customer_email" type="email" value="<?php echo e(old('customer_email', $user->email ?? '')); ?>" class="field-input" required placeholder="you@example.com">
                            </div>
                            <div class="sm:col-span-2">
                                <label for="customer_phone" class="field-label">Phone Number <span class="text-terra-500">*</span></label>
                                <input id="customer_phone" name="customer_phone" type="tel" value="<?php echo e(old('customer_phone', $user->phone ?? '')); ?>" class="field-input" required placeholder="+91 98765 43210">
                            </div>
                        </div>
                    </fieldset>

                    <fieldset>
                        <legend class="mb-5 font-serif text-xl font-medium">Shipping Address</legend>
                        <div class="grid gap-5 sm:grid-cols-2">
                            <div class="sm:col-span-2">
                                <label for="shipping_address" class="field-label">Street Address <span class="text-terra-500">*</span></label>
                                <input id="shipping_address" name="shipping_address" type="text" value="<?php echo e(old('shipping_address', $user->address ?? '')); ?>" placeholder="Flat / House No., Street, Landmark" class="field-input" required>
                            </div>
                            <div>
                                <label for="city" class="field-label">City <span class="text-terra-500">*</span></label>
                                <input id="city" name="city" type="text" value="<?php echo e(old('city', $user->city ?? '')); ?>" class="field-input" required placeholder="Bengaluru">
                            </div>
                            <div>
                                <label for="state" class="field-label">State <span class="text-terra-500">*</span></label>
                                <input id="state" name="state" type="text" value="<?php echo e(old('state', $user->state ?? 'Karnataka')); ?>" class="field-input" required placeholder="Karnataka">
                            </div>
                            <div class="sm:col-span-2">
                                <label for="pincode" class="field-label">PIN Code <span class="text-terra-500">*</span></label>
                                <input id="pincode" name="pincode" type="text" inputmode="numeric" value="<?php echo e(old('pincode', $user->pincode ?? '')); ?>" class="field-input" required placeholder="560001">
                            </div>
                        </div>
                    </fieldset>

                    <fieldset>
                        <legend class="mb-5 font-serif text-xl font-medium">Payment Option</legend>
                        <div class="space-y-3">
                            <label class="flex cursor-pointer items-center justify-between border border-sand-300 px-5 py-4 transition-colors has-[:checked]:border-moss-700 has-[:checked]:bg-moss-50 rounded-lg">
                                <span class="flex items-center gap-3.5">
                                    <input type="radio" name="payment_method" value="cod" class="h-4 w-4 cursor-pointer border-sand-300 text-moss-700 focus:ring-moss-600" checked>
                                    <span>
                                        <span class="block text-sm font-semibold text-ink-900">Cash on Delivery (COD)</span>
                                        <span class="block text-xs text-ink-500">Pay cash upon delivery to your doorstep</span>
                                    </span>
                                </span>
                            </label>
                            <label class="flex cursor-pointer items-center justify-between border border-sand-300 px-5 py-4 transition-colors has-[:checked]:border-moss-700 has-[:checked]:bg-moss-50 rounded-lg">
                                <span class="flex items-center gap-3.5">
                                    <input type="radio" name="payment_method" value="online" class="h-4 w-4 cursor-pointer border-sand-300 text-moss-700 focus:ring-moss-600">
                                    <span>
                                        <span class="block text-sm font-semibold text-ink-900">Online Payment / UPI</span>
                                        <span class="block text-xs text-ink-500">Instant pay via Google Pay, PhonePe, Paytm or Credit Card</span>
                                    </span>
                                </span>
                            </label>
                        </div>
                    </fieldset>

                    <div>
                        <label for="notes" class="field-label">Delivery Notes (Optional)</label>
                        <textarea id="notes" name="notes" rows="2" class="field-input" placeholder="Any special delivery instructions..."></textarea>
                    </div>

                    <button type="submit" class="btn-primary w-full justify-center !py-4 !text-base cursor-pointer">
                        <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'lock','class' => 'h-5 w-5']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'lock','class' => 'h-5 w-5']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> Place Order — ₹<?php echo e(number_format($total, 2)); ?>

                    </button>
                </form>

                
                <aside class="h-fit border border-cream-200 bg-cream-50 p-8 lg:sticky lg:top-28 rounded-xl" aria-label="Order summary">
                    <h2 class="font-serif text-xl font-medium">Your Order Summary</h2>
                    <ul class="mt-6 space-y-5">
                        <?php $__currentLoopData = $cart; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li class="flex items-center gap-4">
                                <div class="relative w-16 shrink-0 bg-cream-100 rounded border border-cream-200 p-1">
                                    <img src="<?php echo e(asset($item['image'])); ?>" alt="<?php echo e($item['name']); ?>" width="900" height="900" class="aspect-square w-full object-contain">
                                    <span style="position: absolute; top: -6px; right: -6px; background-color: #186297; color: #ffffff; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; border: 2px solid #ffffff; z-index: 10;">
                                        <?php echo e($item['quantity']); ?>

                                    </span>
                                </div>
                                <div class="flex-1">
                                    <p class="text-sm font-semibold text-ink-900"><?php echo e($item['name']); ?></p>
                                    <p class="text-xs text-ink-500 mt-0.5">Size: <span class="font-medium text-ink-700"><?php echo e($item['size']); ?></span> &middot; <strong class="text-moss-800 font-bold">Qty: <?php echo e($item['quantity']); ?></strong></p>
                                </div>
                                <div class="text-right">
                                    <p class="text-sm font-semibold text-ink-900">₹<?php echo e(number_format($item['price'] * $item['quantity'])); ?></p>
                                    <?php if($item['quantity'] > 1): ?>
                                        <p class="text-[11px] text-ink-500">₹<?php echo e(number_format($item['price'])); ?> each</p>
                                    <?php endif; ?>
                                </div>
                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                    <dl class="mt-6 space-y-3 border-t border-sand-200 pt-5 text-sm">
                        <div class="flex justify-between"><dt class="text-ink-500">Subtotal</dt><dd class="font-medium">₹<?php echo e(number_format($subtotal, 2)); ?></dd></div>
                        <?php if($discount > 0): ?>
                            <div class="flex justify-between text-moss-700"><dt>Discount Coupon</dt><dd class="font-semibold">- ₹<?php echo e(number_format($discount, 2)); ?></dd></div>
                        <?php endif; ?>
                        <div class="flex justify-between"><dt class="text-ink-500">Shipping</dt><dd class="font-medium text-moss-700"><?php echo e($shipping === 0 ? 'Free' : '₹' . $shipping); ?></dd></div>
                        <div class="flex justify-between border-t border-sand-200 pt-4 text-base"><dt class="font-semibold">Total Payable</dt><dd class="font-serif text-xl font-semibold text-ink-900">₹<?php echo e(number_format($total, 2)); ?></dd></div>
                    </dl>
                    <div class="mt-6 space-y-2.5 border-t border-sand-200 pt-5">
                        <?php $__currentLoopData = [
                            ['icon' => 'shield', 'text' => '100% secure checkout'],
                            ['icon' => 'refresh', 'text' => '7-day easy returns'],
                            ['icon' => 'truck', 'text' => 'Fast delivery across India'],
                        ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $line): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <p class="flex items-center gap-2.5 text-xs text-ink-500"><?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => $line['icon'],'class' => 'h-4 w-4 text-moss-600']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($line['icon']),'class' => 'h-4 w-4 text-moss-600']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> <?php echo e($line['text']); ?></p>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </aside>
            </div>
        </div>
    </section>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/koushikkona/Documents/Projects/divne/resources/views/pages/checkout.blade.php ENDPATH**/ ?>