

<?php $__env->startSection('title', 'Products'); ?>
<?php $__env->startSection('meta_description', 'All products – ' . ($store_name ?? config('app.name'))); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
    <h1 class="text-2xl font-bold text-gray-800 mb-6">All Products</h1>

    
    <div class="flex flex-col sm:flex-row gap-4 mb-6">
        <form action="<?php echo e(route('products.index')); ?>" method="GET" class="flex flex-wrap gap-2 items-center">
            <?php if(request('search')): ?><input type="hidden" name="search" value="<?php echo e(request('search')); ?>"><?php endif; ?>
            <?php if(request('category_id')): ?><input type="hidden" name="category_id" value="<?php echo e(request('category_id')); ?>"><?php endif; ?>
            <label class="text-sm font-medium text-gray-700">Sort:</label>
            <select name="sort" onchange="this.form.submit()" class="input py-2 w-auto text-sm">
                <option value="default" <?php echo e(request('sort') === 'default' ? 'selected' : ''); ?>>Default</option>
                <option value="price_asc" <?php echo e(request('sort') === 'price_asc' ? 'selected' : ''); ?>>Price: Low to High</option>
                <option value="price_desc" <?php echo e(request('sort') === 'price_desc' ? 'selected' : ''); ?>>Price: High to Low</option>
                <option value="rating" <?php echo e(request('sort') === 'rating' ? 'selected' : ''); ?>>Rating</option>
            </select>
        </form>
        <?php if(request('search')): ?>
        <p class="text-sm text-gray-600">Results for "<?php echo e(request('search')); ?>"</p>
        <?php endif; ?>
    </div>

    <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
        <?php $__empty_1 = true; $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <?php echo $__env->make('store.components.product-card', ['product' => $product], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <p class="col-span-full text-gray-500">No products found.</p>
        <?php endif; ?>
    </div>

    <div class="mt-8">
        <?php echo e($products->withQueryString()->links()); ?>

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

<?php echo $__env->make('store.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\laragon\www\ReactNative\grocery-api\resources\views/store/products/index.blade.php ENDPATH**/ ?>