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

<div class="mkt-header">
    <div>
        <h2 class="mkt-title">Marketplace</h2>
        <p class="mkt-sub">Buy social media accounts from admin and verified sellers</p>
    </div>
    <div class="mkt-header-actions">
        <a href="<?php echo e(route('user.marketplace.my-purchases')); ?>" class="btn btn-outline-mkt"><i class="ti ti-shopping-bag"></i> My Purchases</a>
        <?php if(Auth::user()->is_seller): ?>
            <a href="<?php echo e(route('user.marketplace.seller.dashboard')); ?>" class="btn btn-primary"><i class="ti ti-layout-dashboard"></i> Seller Dashboard</a>
        <?php else: ?>
            <a href="<?php echo e(route('user.marketplace.upgrade')); ?>" class="btn btn-primary"><i class="ti ti-star"></i> Become a Seller</a>
        <?php endif; ?>
    </div>
</div>

<form method="GET" class="mkt-search-form">
    <div class="mkt-search-wrap">
        <i class="ti ti-search"></i>
        <input type="text" name="q" value="<?php echo e(request('q')); ?>" placeholder="Search products..." class="mkt-search-input">
    </div>
    <button type="submit" class="btn btn-primary">Search</button>
</form>

<?php if($products->isEmpty()): ?>
    <div class="mkt-empty"><i class="ti ti-shopping-cart-off"></i><p>No products found.</p></div>
<?php else: ?>
<div class="mkt-grid">
    <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <a href="<?php echo e(route('user.marketplace.show', [$product['type'], $product['id']])); ?>" class="mkt-card">
        <?php if($product['image']): ?>
        <div class="mkt-card-img">
            <img src="<?php echo e(asset($product['image'])); ?>" alt="<?php echo e($product['title']); ?>">
        </div>
        <?php else: ?>
        <div class="mkt-card-img mkt-card-img-placeholder">
            <i class="ti ti-device-mobile"></i>
        </div>
        <?php endif; ?>
        <div class="mkt-card-head">
            <span class="mkt-card-category"><?php echo e($product['category']); ?></span>
            <span class="mkt-card-stock"><?php echo e($product['stock']); ?> in stock</span>
        </div>
        <div class="mkt-card-body">
            <h3 class="mkt-card-title"><?php echo e($product['title']); ?></h3>
            <p class="mkt-card-desc"><?php echo e(Str::limit($product['description'], 80)); ?></p>
        </div>
        <div class="mkt-card-footer">
            <span class="mkt-card-price"><?php echo e($currency); ?><?php echo e(number_format($product['price'], 2)); ?></span>
            <span class="mkt-card-seller <?php echo e($product['type'] === 'admin' ? 'mkt-card-seller-admin' : ''); ?>">
                <?php if($product['type'] === 'admin'): ?>
                    <i class="ti ti-shield-check"></i> Admin
                <?php else: ?>
                    <i class="ti ti-user"></i> <?php echo e($product['seller']); ?>

                <?php endif; ?>
            </span>
        </div>
    </a>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php endif; ?>

<?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 0 4px;}
.mkt-sub{font-size:14px;color:var(--text-secondary);margin:0;}
.mkt-header-actions{display:flex;gap:10px;flex-wrap:wrap;}
.btn-outline-mkt{height:48px;padding:0 18px;border:1.5px solid var(--border-color);border-radius:12px;font-size:14px;font-weight:500;display:inline-flex;align-items:center;gap:8px;color:var(--text-primary);background:var(--bg-primary);transition:all .2s;}
.btn-outline-mkt:hover{border-color:var(--primary-color);color:var(--primary-color);}
.mkt-search-form{display:flex;gap:12px;margin-bottom:24px;}
.mkt-search-wrap{flex:1;position:relative;max-width:500px;}
.mkt-search-wrap i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--text-secondary);font-size:18px;}
.mkt-search-input{width:100%;height:48px;padding:0 16px 0 42px;border:1.5px solid var(--border-color);border-radius:12px;background:var(--bg-primary);color:var(--text-primary);font-size:14px;outline:none;transition:border-color .2s;}
.mkt-search-input:focus{border-color:var(--primary-color);}
.mkt-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:18px;}
.mkt-card{background:var(--bg-primary);border:var(--border);border-radius:14px;overflow:hidden;text-decoration:none;color:inherit;display:flex;flex-direction:column;transition:all .25s;}
.mkt-card:hover{border-color:var(--primary-color);transform:translateY(-4px);box-shadow:0 8px 24px rgba(0,0,0,.1);}
.mkt-card-img{width:100%;height:140px;overflow:hidden;}
.mkt-card-img img{width:100%;height:100%;object-fit:cover;}
.mkt-card-img-placeholder{background:var(--bg-secondary);display:flex;align-items:center;justify-content:center;font-size:36px;color:var(--primary-color);}
.mkt-card-head{padding:12px 16px 0;display:flex;align-items:center;justify-content:space-between;}
.mkt-card-category{font-size:11px;font-weight:600;text-transform:uppercase;color:var(--text-secondary);letter-spacing:.5px;}
.mkt-card-stock{font-size:11px;font-weight:600;color:#16a34a;background:#dcfce7;padding:3px 8px;border-radius:20px;}
.mkt-card-body{padding:10px 16px;flex:1;}
.mkt-card-title{font-size:14px;font-weight:700;color:var(--text-primary);margin:0 0 6px;}
.mkt-card-desc{font-size:12px;color:var(--text-secondary);margin:0;line-height:1.5;}
.mkt-card-footer{padding:12px 16px;border-top:var(--border);display:flex;align-items:center;justify-content:space-between;}
.mkt-card-price{font-size:15px;font-weight:800;color:var(--primary-color);}
.mkt-card-seller{font-size:11px;color:var(--text-secondary);display:flex;align-items:center;gap:4px;}
.mkt-card-seller-admin{color:#6366f1;font-weight:600;}
.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;}
.mkt-empty p{font-size:15px;margin:0;}
</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/index.blade.php ENDPATH**/ ?>