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

<div class="mkt-header">
    <div><h2 class="mkt-title">My Products</h2></div>
    <a href="<?php echo e(route('user.marketplace.seller.products.create')); ?>" class="btn btn-primary"><i class="ti ti-plus"></i> Add Product</a>
</div>

<div class="card">
    <?php if($products->isEmpty()): ?>
        <div class="mkt-empty"><i class="ti ti-package-off"></i><p>No products yet. Add your first product.</p></div>
    <?php else: ?>
    <div class="table-responsive">
        <table class="table">
            <thead><tr><th>#</th><th>Title</th><th>Category</th><th>Price</th><th>Stock</th><th>Sold</th><th>Status</th><th>Actions</th></tr></thead>
            <tbody>
                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($products->firstItem() + $i); ?></td>
                    <td><strong><?php echo e($product->title); ?></strong></td>
                    <td><?php echo e($product->category ?? '—'); ?></td>
                    <td><?php echo e(optional(App\Models\Setting::first())->website_currency ?? ''); ?><?php echo e(number_format($product->price, 2)); ?></td>
                    <td><?php echo e($product->available_accounts_count); ?></td>
                    <td><?php echo e($product->accounts_count - $product->available_accounts_count); ?></td>
                    <td><span class="status <?php echo e($product->status ? 'success' : 'failed'); ?>"><?php echo e($product->status ? 'Active' : 'Inactive'); ?></span></td>
                    <td>
                        <div style="display:flex;gap:8px;flex-wrap:wrap;">
                            <a href="<?php echo e(route('user.marketplace.show', ['seller', $product->id])); ?>" class="btn" style="height:34px;padding:0 12px;font-size:12px;background:#ede9fe;color:#6366f1;" target="_blank"><i class="ti ti-world"></i> Marketplace</a>
                            <a href="<?php echo e(route('user.marketplace.seller.accounts', $product->id)); ?>" class="btn btn-primary" style="height:34px;padding:0 12px;font-size:12px;"><i class="ti ti-list"></i> Accounts</a>
                            <a href="<?php echo e(route('user.marketplace.seller.products.edit', $product->id)); ?>" class="btn" style="height:34px;padding:0 12px;font-size:12px;background:var(--bg-secondary);color:var(--text-primary);"><i class="ti ti-edit"></i></a>
                            <form method="POST" action="<?php echo e(route('user.marketplace.seller.products.destroy', $product->id)); ?>" onsubmit="return confirm('Delete this product?')">
                                <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="btn" style="height:34px;padding:0 12px;font-size:12px;background:#fef2f2;color:#dc2626;"><i class="ti ti-trash"></i></button>
                            </form>
                        </div>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
    <div class="pagination-wrapper">
        <div class="pagination-info">Showing <?php echo e($products->firstItem()); ?>–<?php echo e($products->lastItem()); ?> of <?php echo e($products->total()); ?></div>
        <div class="pagination-links"><?php echo e($products->links()); ?></div>
    </div>
    <?php endif; ?>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startPush('style'); ?>
<style>
.mkt-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:24px;}
.mkt-title{font-size:22px;font-weight:700;color:var(--text-primary);margin:0;}
.mkt-empty{text-align:center;padding:60px 20px;color:var(--text-secondary);}
.mkt-empty i{font-size:48px;display:block;margin-bottom:12px;opacity:.5;}
</style>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('frontend.layout.dash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\jjd\socialnum\sstack\mine\core\resources\views/frontend/marketplace/seller/products.blade.php ENDPATH**/ ?>