<!-- Store Banner Header -->
<div class="cargoo-card overflow-hidden mb-4">
  <div class="p-4 p-md-5 text-white position-relative" style="background: linear-gradient(135deg, #1e40af 0%, #0f172a 100%);">
    <div class="d-flex flex-column flex-md-row align-items-md-center gap-4 position-relative" style="z-index: 2;">
      <?php if (!empty($store['logo'])): ?>
        <img src="<?= asset('/uploads/stores/' . e($store['logo'])) ?>" alt="Store Logo" class="rounded-circle border border-3 border-white shadow" style="width: 90px; height: 90px; object-fit: cover;">
      <?php else: ?>
        <div class="rounded-circle bg-white text-primary d-flex align-items-center justify-content-center fw-bold shadow" style="width: 90px; height: 90px;">
          <i class="bi bi-shop fs-1"></i>
        </div>
      <?php endif; ?>

      <div>
        <div class="d-flex align-items-center gap-2 mb-1">
          <h3 class="fw-bold mb-0 text-white"><?= e($store['store_name']) ?></h3>
          <?php if (!empty($store['verified_at'])): ?>
            <span class="badge bg-success-subtle text-success border border-success-subtle px-2 py-1 small">
              <i class="bi bi-patch-check-fill"></i> Official Store
            </span>
          <?php endif; ?>
        </div>

        <p class="text-light text-opacity-75 small mb-2" style="max-width: 600px;">
          <?= e($store['description'] ?? 'ยินดีต้อนรับสู่หน้าร้านค้าทางการบน CARGOO Marketplace') ?>
        </p>

        <div class="d-flex flex-wrap gap-3 small text-light text-opacity-75">
          <?php if (!empty($store['address'])): ?>
            <span><i class="bi bi-geo-alt me-1"></i><?= e($store['address']) ?></span>
          <?php endif; ?>
          <span><i class="bi bi-box-seam me-1"></i><?= (int)$store['total_products'] ?> สินค้า</span>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Store Products Section -->
<div class="d-flex justify-content-between align-items-center mb-3">
  <h5 class="fw-bold mb-0 text-dark">
    <i class="bi bi-grid me-2 text-primary"></i> <?= __('store_catalog') ?>
  </h5>
</div>

<!-- Catalog Render -->
<?php 
  $products = $catalog['products'];
  $total_count = $catalog['total_count'];
  $current_page = $catalog['current_page'];
  $total_pages = $catalog['total_pages'];
  $filters = $catalog['filters'];
  $categories = $catalog['categories'];
?>
<?php require __DIR__ . '/search.php'; ?>
