<?php $reviews = db_all('SELECT r.*, p.name AS product, p.slug FROM reviews r JOIN products p ON p.id = r.product_id WHERE r.status = 1 AND r.rating >= 4 ORDER BY r.id DESC LIMIT ' . max(1, min(12, (int) $s['limit']))) ?>
<?php if ($reviews): ?>
<div class="rounded-[var(--radius-panel)] bg-soft px-6 py-14 sm:px-12">
    <div class="text-center">
        <?php if ($s['eyebrow']): ?><p class="eyebrow"><?= e($s['eyebrow']) ?></p><?php endif ?>
        <h2 class="heading mt-3 text-3xl <?= heading_weight_class() ?> sm:text-4xl"><?= e($s['title']) ?></h2>
    </div>
    <div class="mt-12 grid gap-6 md:grid-cols-3">
        <?php foreach ($reviews as $review): ?>
            <figure class="flex flex-col rounded-2xl bg-white p-7 ring-1 ring-zinc-200/70">
                <?= stars($review['rating']) ?>
                <blockquote class="mt-5 flex-1 text-[15px] leading-7 text-zinc-700">“<?= e($review['comment']) ?>”</blockquote>
                <figcaption class="mt-6 flex items-center justify-between gap-3 border-t border-zinc-100 pt-5 text-sm">
                    <span class="font-semibold text-ink"><?= e($review['name']) ?></span>
                    <a href="<?= url('urun/' . $review['slug']) ?>" class="truncate text-zinc-500 hover:text-ink"><?= e($review['product']) ?></a>
                </figcaption>
            </figure>
        <?php endforeach ?>
    </div>
</div>
<?php endif ?>
