<!-- PRODUCT SELECTION (Unlimited Dynamic) -->
<div class="form-card section-divider" id="section-products">
    <h3>Product Selection Section</h3>
    <input type="text" name="product_section_title" value="<?php echo htmlspecialchars($landing['product_section_title'] ?? 'আপনার পছন্দের প্যাকেজ বেছে নিন'); ?>"
           placeholder="Section Title" required class="mb-2">
    <textarea name="product_subtext" rows="2" placeholder="যেকোনো সংখ্যক প্যাকেজ – যেকোনো একটি নির্বাচন করুন"
              required class="mb-2"><?php echo htmlspecialchars($landing['product_subtext'] ?? 'যেকোনো সংখ্যক প্যাকেজ – যেকোনো একটি নির্বাচন করুন'); ?></textarea>
    <div id="productContainer">
        <?php if (!empty($products)): ?>
            <?php foreach ($products as $index => $product): ?>
                <div class="product-row">
                    <div class="flex justify-between items-center mb-2">
                        <h4>Product <?php echo $index; ?></h4>
                        <button type="button" class="remove-btn" onclick="removeProduct(this)">Remove</button>
                    </div>
                    <input type="text" name="product_badge[]" value="<?php echo htmlspecialchars($product['badge'] ?? ''); ?>"
                           placeholder="Badge (e.g. স্ট্যান্ডার্ড)" required class="mb-1">
                    <input type="text" name="product_title[]" value="<?php echo htmlspecialchars($product['title'] ?? ''); ?>"
                           placeholder="Title (e.g. Milk Booster Basic)" required class="mb-1">
                    <textarea name="product_desc[]" rows="2" placeholder="Description (e.g. প্যাকেট – গাভীর জন্য ৩০ দিন)"
                              required><?php echo htmlspecialchars($product['desc'] ?? ''); ?></textarea>
                    <input type="text" name="product_old_price[]" value="<?php echo htmlspecialchars($product['old_price'] ?? ''); ?>"
                           placeholder="Old Price (e.g. ৳৭,৯৯০)" required class="mt-2 mb-1">
                    <input type="text" name="product_price[]" value="<?php echo htmlspecialchars($product['price'] ?? ''); ?>"
                           placeholder="Price (e.g. ৳৫,৯৯০)" required class="mb-1">
                    <label class="block">Image (≤ 2 MB)</label>
                    <input type="file" name="product_image[]" accept="image/*" class="mb-1">
                    <?php if (!empty($product['image'])): ?>
                        <img src="<?php echo htmlspecialchars($upload_dir . $product['image']); ?>" alt="Product <?php echo $index; ?>" class="preview-img">
                    <?php endif; ?>
                </div>
            <?php endforeach; ?>
        <?php else: ?>
            <div class="product-row">
                <div class="flex justify-between items-center mb-2">
                    <h4>Product 1</h4>
                    <button type="button" class="remove-btn" onclick="removeProduct(this)">Remove</button>
                </div>
                <input type="text" name="product_badge[]" value="" placeholder="Badge (e.g. স্ট্যান্ডার্ড)" required class="mb-1">
                <input type="text" name="product_title[]" value="" placeholder="Title (e.g. Milk Booster Basic)" required class="mb-1">
                <textarea name="product_desc[]" rows="2" placeholder="Description (e.g. প্যাকেট – গাভীর জন্য ৩০ দিন)" required></textarea>
                <input type="text" name="product_old_price[]" value="" placeholder="Old Price (e.g. ৳৭,৯৯০)" required class="mt-2 mb-1">
                <input type="text" name="product_price[]" value="" placeholder="Price (e.g. ৳৫,৯৯০)" required class="mb-1">
                <label class="block">Image (≤ 2 MB)</label>
                <input type="file" name="product_image[]" accept="image/*" class="mb-1">
            </div>
        <?php endif; ?>
    </div>
    <button type="button" class="add-btn" onclick="addProduct()">Add New Product</button>
</div>