<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="min-h-screen bg-gray-50 pt-20">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
            <!-- Header -->
            <div class="mb-8">
                <div class="flex items-center justify-between mb-4">
                    <div>
                        <h1 class="text-2xl font-bold text-gray-900" style="color: <?php echo e($siteInfo['theme_color']); ?>;">
                            <?php echo e($siteInfo['name']); ?> - Items
                        </h1>
                        <p class="text-gray-600 mt-1"><?php echo e($items->total()); ?> items found</p>
                    </div>
                    <a href="<?php echo e(route('sites.' . $siteGroup . '.index')); ?>" 
                       class="text-gray-600 hover:text-gray-900 flex items-center">
                        ← Back to <?php echo e($siteInfo['name']); ?>

                    </a>
                </div>
            </div>

            <!-- Search and Filters -->
            <div class="bg-white border border-gray-200 rounded-lg p-6 mb-8">
                <form method="GET" class="space-y-4">
                    <div class="flex flex-col lg:flex-row lg:items-end gap-4">
                        <!-- Search -->
                        <div class="flex-1">
                            <input type="text" 
                                   name="search" 
                                   value="<?php echo e(request('search')); ?>" 
                                   placeholder="Search items..." 
                                   class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-opacity-50"
                                   style="focus:ring-color: <?php echo e($siteInfo['theme_color']); ?>;">
                        </div>

                        <!-- Category Filter -->
                        <div class="lg:w-48">
                            <select name="category" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-opacity-50"
                                    style="focus:ring-color: <?php echo e($siteInfo['theme_color']); ?>;">
                                <option value="">All Categories</option>
                                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($category->id); ?>" <?php echo e(request('category') == $category->id ? 'selected' : ''); ?>>
                                        <?php echo e($category->name); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>

                        <!-- Type Filter -->
                        <div class="lg:w-40">
                            <select name="type" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-opacity-50"
                                    style="focus:ring-color: <?php echo e($siteInfo['theme_color']); ?>;">
                                <option value="">All Types</option>
                                <option value="sale" <?php echo e(request('type') == 'sale' ? 'selected' : ''); ?>>For Sale</option>
                                <option value="pre-market" <?php echo e(request('type') == 'pre-market' ? 'selected' : ''); ?>>Pre-Market</option>
                            </select>
                        </div>

                        <!-- Sort -->
                        <div class="lg:w-40">
                            <select name="sort" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-opacity-50"
                                    style="focus:ring-color: <?php echo e($siteInfo['theme_color']); ?>;">
                                <option value="newest" <?php echo e(request('sort') == 'newest' ? 'selected' : ''); ?>>Newest</option>
                                <option value="oldest" <?php echo e(request('sort') == 'oldest' ? 'selected' : ''); ?>>Oldest</option>
                                <option value="price_low" <?php echo e(request('sort') == 'price_low' ? 'selected' : ''); ?>>Price: Low</option>
                                <option value="price_high" <?php echo e(request('sort') == 'price_high' ? 'selected' : ''); ?>>Price: High</option>
                            </select>
                        </div>

                        <!-- Submit -->
                        <button type="submit" 
                                class="px-6 py-2 text-white font-medium rounded-lg transition-colors hover:opacity-90"
                                style="background-color: <?php echo e($siteInfo['theme_color']); ?>;">
                            Filter
                        </button>
                    </div>

                    <!-- Price Range -->
                    <div class="flex gap-4 max-w-md">
                        <input type="number" 
                               name="min_price" 
                               value="<?php echo e(request('min_price')); ?>" 
                               placeholder="Min price" 
                               step="0.01" 
                               class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-opacity-50"
                               style="focus:ring-color: <?php echo e($siteInfo['theme_color']); ?>;">
                        <input type="number" 
                               name="max_price" 
                               value="<?php echo e(request('max_price')); ?>" 
                               placeholder="Max price" 
                               step="0.01" 
                               class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-opacity-50"
                               style="focus:ring-color: <?php echo e($siteInfo['theme_color']); ?>;">
                    </div>

                    <div class="flex gap-4">
                        <a href="<?php echo e(route('sites.' . $siteGroup . '.items')); ?>" 
                           class="text-gray-600 hover:text-gray-900 text-sm">
                            Clear Filters
                        </a>
                    </div>
                </form>
            </div>

            <!-- Items Grid -->
            <?php if($items->count() > 0): ?>
                <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 mb-8">
                    <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="bg-white border border-gray-200 rounded-lg overflow-hidden hover:shadow-lg transition-shadow">
                            <div class="aspect-square bg-gray-100 flex items-center justify-center">
                                <?php if($item->photos->count() > 0): ?>
                                    <img src="<?php echo e($item->photos->first()->url); ?>" alt="<?php echo e($item->title); ?>" 
                                         class="w-full h-full object-cover">
                                <?php else: ?>
                                    <div class="text-gray-400 text-4xl"><?php echo e($item->category->icon ?? '📦'); ?></div>
                                <?php endif; ?>
                            </div>
                            <div class="p-4">
                                <h3 class="font-medium text-gray-900 mb-1 line-clamp-2"><?php echo e($item->title); ?></h3>
                                <p class="text-gray-600 text-sm mb-2"><?php echo e($item->category->name); ?></p>
                                <p class="text-gray-500 text-xs mb-3">by <?php echo e($item->user->name); ?></p>
                                
                                <div class="flex items-center justify-between">
                                    <?php if($item->price): ?>
                                        <p class="font-bold text-lg" style="color: <?php echo e($siteInfo['theme_color']); ?>;">
                                            $<?php echo e(number_format($item->price, 2)); ?>

                                        </p>
                                    <?php else: ?>
                                        <p class="text-gray-500 text-sm font-medium">Make Offer</p>
                                    <?php endif; ?>

                                    <div class="text-right">
                                        <?php if($item->listing_type === 'pre-market'): ?>
                                            <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-purple-100 text-purple-800">
                                                Pre-Market
                                            </span>
                                        <?php elseif($item->listing_type === 'sale'): ?>
                                            <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
                                                For Sale
                                            </span>
                                        <?php endif; ?>
                                    </div>
                                </div>

                                <div class="mt-3">
                                    <a href="<?php echo e(route('items.show', $item)); ?>" 
                                       class="block w-full text-center px-4 py-2 border border-gray-300 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors">
                                        View Details
                                    </a>
                                </div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>

                <!-- Pagination -->
                <div class="flex justify-center">
                    <?php echo e($items->links()); ?>

                </div>
            <?php else: ?>
                <div class="bg-white border border-gray-200 rounded-lg p-12 text-center">
                    <div class="text-4xl mb-4">🔍</div>
                    <h3 class="text-lg font-medium text-gray-900 mb-2">No items found</h3>
                    <p class="text-gray-600 mb-6">Try adjusting your search criteria or browse categories</p>
                    <div class="flex gap-4 justify-center">
                        <a href="<?php echo e(route('sites.' . $siteGroup . '.items')); ?>" 
                           class="text-gray-600 hover:text-gray-900">Clear filters</a>
                        <a href="<?php echo e(route('sites.' . $siteGroup . '.index')); ?>" 
                           class="text-gray-600 hover:text-gray-900">Browse categories</a>
                    </div>
                </div>
            <?php endif; ?>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH /var/www/html/resources/views/sites/items.blade.php ENDPATH**/ ?>