<?php $__env->startSection('title', 'Products'); ?>
<?php $__env->startSection('content'); ?>
<div class="action-bar">
    <span><?php echo e($products->total()); ?> products</span>
    <a href="<?php echo e(route('admin.products.create')); ?>" class="btn btn-primary">+ New Product</a>
</div>
<div class="card">
    <table>
        <tr><th>Image</th><th>Name</th><th>SKU</th><th>Category</th><th>Price</th><th>Stock</th><th>Status</th><th>Actions</th></tr>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
        <tr>
            <td><img src="<?php echo e($product->primaryImage ? asset('storage/' . $product->primaryImage->image) : 'https://placehold.co/50x50/2a2a3e/666?text=N/A'); ?>" class="product-img" alt=""></td>
            <td><strong><?php echo e($product->name); ?></strong></td>
            <td class="text-muted"><?php echo e($product->sku ?? '—'); ?></td>
            <td><?php echo e($product->category->name ?? '—'); ?></td>
            <td>$<?php echo e(number_format($product->price, 2)); ?><?php echo e($product->sale_price ? ' → $'.number_format($product->sale_price,2) : ''); ?></td>
            <td><?php echo e($product->stock); ?></td>
            <td><?php echo $product->is_active ? '<span style="color:#6fcf97">Active</span>' : '<span style="color:#e74c3c">Inactive</span>'; ?></td>
            <td class="inline-flex">
                <a href="<?php echo e(route('admin.products.edit', $product)); ?>" class="btn btn-primary btn-sm">Edit</a>
                <form action="<?php echo e(route('admin.products.destroy', $product)); ?>" method="POST" onsubmit="return confirm('Delete this product?')">
                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                    <button type="submit" class="btn btn-danger btn-sm">Delete</button>
                </form>
            </td>
        </tr>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
    </table>
    <div class="pagination"><?php echo e($products->links()); ?></div>
</div>
<?php $__env->stopSection(); ?>

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