<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['product', 'carousel' => false]));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter((['product', 'carousel' => false]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>

<?php
    $price = is_object($product) ? $product->price : $product['price'];
    $compareAt = is_object($product) ? $product->compare_at : ($product['compare_at'] ?? null);
    $slug = is_object($product) ? $product->slug : $product['slug'];
    $name = is_object($product) ? $product->name : $product['name'];
    $tag = is_object($product) ? $product->tag : ($product['tag'] ?? '');
    $badge = is_object($product) ? $product->badge : ($product['badge'] ?? null);
    $rating = is_object($product) ? $product->rating : ($product['rating'] ?? 5.0);
    $reviews = is_object($product) ? $product->reviews_count : ($product['reviews'] ?? 100);
    $image = is_object($product) ? $product->image : $product['image'];
    $imageAlt = is_object($product) ? ($product->image_alt ?? $product->image) : ($product['image_alt'] ?? $product['image']);
    $id = is_object($product) ? $product->id : ($product['id'] ?? 1);

    $off = $compareAt ? round((1 - $price / $compareAt) * 100) : null;
?>

<article <?php echo e($attributes->class(['group flex flex-col bg-white', 'w-64 shrink-0 snap-start sm:w-72' => $carousel])); ?>>
    <a href="<?php echo e(route('product', $slug)); ?>" class="relative block overflow-hidden bg-cream-50 rounded-xl border border-cream-200 p-3">
        <?php if($badge): ?>
            <span class="absolute top-3 left-3 z-10 bg-terra-500 px-2.5 py-1 text-[10px] font-semibold tracking-[0.14em] text-white uppercase rounded-xs"><?php echo e($badge); ?></span>
        <?php endif; ?>
        <div class="aspect-square w-full flex items-center justify-center">
            <img src="<?php echo e(asset($image)); ?>" alt="<?php echo e($name); ?>" width="900" height="900"
                class="h-full w-full object-contain transition-opacity duration-300 group-hover:opacity-0" loading="lazy">
            <img src="<?php echo e(asset($imageAlt)); ?>" alt="" width="900" height="900" aria-hidden="true"
                class="absolute inset-0 p-3 h-full w-full object-contain opacity-0 transition-opacity duration-300 group-hover:opacity-100" loading="lazy">
        </div>
    </a>

    <div class="flex flex-1 flex-col pt-4 pb-2">
        <?php if (isset($component)) { $__componentOriginale32d02d1a95a04916bc939ee53f28428 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale32d02d1a95a04916bc939ee53f28428 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.stars','data' => ['rating' => $rating,'reviews' => $reviews]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('stars'); ?>
<?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(['rating' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($rating),'reviews' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($reviews)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale32d02d1a95a04916bc939ee53f28428)): ?>
<?php $attributes = $__attributesOriginale32d02d1a95a04916bc939ee53f28428; ?>
<?php unset($__attributesOriginale32d02d1a95a04916bc939ee53f28428); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale32d02d1a95a04916bc939ee53f28428)): ?>
<?php $component = $__componentOriginale32d02d1a95a04916bc939ee53f28428; ?>
<?php unset($__componentOriginale32d02d1a95a04916bc939ee53f28428); ?>
<?php endif; ?>
        <h3 class="mt-2 font-serif text-base font-medium text-ink-900">
            <a href="<?php echo e(route('product', $slug)); ?>" class="transition-colors hover:text-moss-600"><?php echo e($name); ?></a>
        </h3>
        <p class="mt-0.5 text-xs text-ink-500 line-clamp-1"><?php echo e($tag); ?></p>
        <p class="mt-2 flex items-baseline gap-2 text-sm">
            <span class="font-semibold text-ink-900">₹<?php echo e(number_format($price)); ?></span>
            <?php if($compareAt): ?>
                <s class="text-ink-400">₹<?php echo e(number_format($compareAt)); ?></s>
                <span class="text-xs font-semibold text-terra-500"><?php echo e($off); ?>% off</span>
            <?php endif; ?>
        </p>

        <form action="<?php echo e(route('cart.add')); ?>" method="POST" class="mt-4 flex flex-col gap-2 min-[480px]:flex-row min-[480px]:items-stretch">
            <?php echo csrf_field(); ?>
            <input type="hidden" name="product_id" value="<?php echo e($id); ?>">
            <div class="flex items-center justify-between border border-sand-300 rounded-lg overflow-hidden" data-qty>
                <button type="button" class="flex h-full w-8 cursor-pointer items-center justify-center text-ink-500 transition-colors hover:text-ink-900" data-qty-minus aria-label="Decrease quantity">
                    <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'minus','class' => 'h-3.5 w-3.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' => 'minus','class' => 'h-3.5 w-3.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; ?>
                </button>
                <input type="text" name="quantity" value="1" inputmode="numeric" aria-label="Quantity" class="w-8 border-0 bg-transparent p-0 text-center text-sm font-medium focus:ring-0 focus:outline-none">
                <button type="button" class="flex h-full w-8 cursor-pointer items-center justify-center text-ink-500 transition-colors hover:text-ink-900" data-qty-plus aria-label="Increase quantity">
                    <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'plus','class' => 'h-3.5 w-3.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' => 'plus','class' => 'h-3.5 w-3.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; ?>
                </button>
            </div>
            <button type="submit" class="btn-primary flex-1 !px-3 !py-2.5 !text-[11px] cursor-pointer">Add to Cart</button>
        </form>
    </div>
</article>
<?php /**PATH /Users/koushikkona/Documents/Projects/divne/resources/views/components/product-card.blade.php ENDPATH**/ ?>