<?= $this->extend('site/layout/main') ?>
<?= $this->section('content') ?>

<div class="py-5 text-white text-center" style="background:var(--primary);">
    <div class="container py-4"><h1 class="fw-bold">منتجاتنا وخدماتنا</h1></div>
</div>

<section class="section">
    <div class="container">
        <div class="row g-4">
            <?php foreach ($products as $p): ?>
                <div class="col-md-4 col-sm-6">
                    <div class="card card-product h-100 p-4 text-center">
                        <div class="fs-1 mb-2">📦</div>
                        <h5><?= esc($p['name']) ?></h5>
                        <p class="text-muted small flex-grow-1"><?= esc($p['description']) ?></p>
                        <div class="fs-4 fw-bold text-primary mb-2"><?= number_format($p['price'], 2) ?> <?= esc($p['currency']) ?></div>
                        <a href="<?= base_url('site/' . $company['slug'] . '/contact') ?>" class="btn btn-outline-primary btn-sm">اطلب الآن</a>
                    </div>
                </div>
            <?php endforeach; ?>
            <?php if (empty($products)): ?>
                <p class="text-muted text-center">لا توجد منتجات معروضة حالياً.</p>
            <?php endif; ?>
        </div>
    </div>
</section>
<?= $this->endSection() ?>
