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

<a href="<?php echo e(route('user.marketplace.seller.products')); ?>" class="mkt-back"><i class="ti ti-arrow-left"></i> Back to Products</a>

<div class="card" style="max-width:600px;">
    <h2 class="title"><?php echo e($title); ?></h2>
    <form method="POST" action="<?php echo e($product ? route('user.marketplace.seller.products.update', $product->id) : route('user.marketplace.seller.products.store')); ?>">
        <?php echo csrf_field(); ?>
        <?php if($product): ?> <?php echo method_field('PUT'); ?> <?php endif; ?>
        <div class="form-group" style="margin-bottom:16px;">
            <label class="form-label">Title <span class="required">*</span></label>
            <input type="text" name="title" class="form-control" value="<?php echo e(old('title', $product->title ?? '')); ?>" required>
        </div>
        <div class="form-grid">
            <div class="form-group">
                <label class="form-label">Price <span class="required">*</span></label>
                <input type="number" step="0.01" min="0.01" name="price" class="form-control" value="<?php echo e(old('price', $product->price ?? '')); ?>" required>
            </div>
            <div class="form-group">
                <label class="form-label">Category</label>
                <select name="category" class="form-control">
                    <option value="">— Select category —</option>
                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($cat->name); ?>" <?php echo e(old('category', $product->category ?? '') === $cat->name ? 'selected' : ''); ?>><?php echo e($cat->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
        <div class="form-group" style="margin-bottom:16px;">
            <label class="form-label">Description</label>
            <textarea name="description" class="form-control" rows="4" style="height:auto;padding:12px 16px;"><?php echo e(old('description', $product->description ?? '')); ?></textarea>
        </div>
        <?php if($product): ?>
        <div class="form-group" style="margin-bottom:16px;">
            <label class="form-label">Status</label>
            <select name="status" class="form-control">
                <option value="1" <?php echo e(($product->status ?? true) ? 'selected' : ''); ?>>Active</option>
                <option value="0" <?php echo e(!($product->status ?? true) ? 'selected' : ''); ?>>Inactive</option>
            </select>
        </div>
        <?php endif; ?>
        <button type="submit" class="btn btn-primary"><i class="ti ti-device-floppy"></i> <?php echo e($product ? 'Update' : 'Create'); ?> Product</button>
    </form>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startPush('style'); ?>
<style>
.mkt-back{display:inline-flex;align-items:center;gap:6px;font-size:14px;color:var(--primary-color);font-weight:500;margin-bottom:20px;text-decoration:none;}
</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/product-form.blade.php ENDPATH**/ ?>