<?php
// ============================================================
// FILE: includes/footer.php
// Footer global untuk semua halaman publik
// ============================================================
?>

<footer class="site-footer">
  <div class="container">
    <div class="row g-5">

      <div class="col-lg-4 col-md-6">
        <div class="footer-brand mb-3">
          <div class="brand-icon-footer">
            <i class="bi bi-house-door-fill"></i>
          </div>
          <div>
            <div class="fw-bold fs-5">Budi Jaya</div>
            <div class="text-muted small">Kusen &amp; Gypsum</div>
          </div>
        </div>
        <p class="footer-desc">
          Melayani kebutuhan kusen dan gypsum Anda sejak <?= TAHUN_BERDIRI ?>.
          Kualitas terjamin, harga bersaing, pengerjaan profesional.
        </p>
        <div class="social-links mt-3">
          <a href="<?= GMAPS_LINK ?>" target="_blank" class="btn btn-outline-secondary btn-sm">
            <i class="bi bi-map me-1"></i>Maps
          </a>
        </div>
      </div>

      <div class="col-lg-2 col-md-6 col-6">
        <h6 class="footer-heading">Menu</h6>
        <ul class="footer-links">
          <li><a href="<?= BASE_URL ?>">Beranda</a></li>
          <li><a href="<?= BASE_URL ?>/katalog.php">Katalog Produk</a></li>
          <li><a href="<?= BASE_URL ?>/tracking.php">Cek Pesanan</a></li>
          <li><a href="<?= BASE_URL ?>/#galeri">Galeri</a></li>
          <li><a href="<?= BASE_URL ?>/#lokasi">Lokasi</a></li>
        </ul>
      </div>

      <div class="col-lg-2 col-md-6 col-6">
        <h6 class="footer-heading">Produk</h6>
        <ul class="footer-links">
          <?php
          $pdo  = db();
          $cats = $pdo->query("SELECT nama, slug FROM kategori ORDER BY id LIMIT 6")->fetchAll();
          foreach ($cats as $cat):
          ?>
            <li>
              <a href="<?= BASE_URL ?>/katalog.php?kategori=<?= e($cat['slug']) ?>">
                <?= e($cat['nama']) ?>
              </a>
            </li>
          <?php endforeach; ?>
        </ul>
      </div>

      <div class="col-lg-4 col-md-6">
        <h6 class="footer-heading">Informasi Kontak</h6>
        <ul class="footer-contact">
          <li>
            <i class="bi bi-geo-alt-fill text-warning"></i>
            <span><?= ALAMAT_TOKO ?></span>
          </li>
          <li>
            <i class="bi bi-envelope-fill text-info"></i>
            <a href="mailto:<?= EMAIL_TOKO ?>"><?= EMAIL_TOKO ?></a>
          </li>
          <li>
            <i class="bi bi-clock-fill text-muted"></i>
            <span>Senin – Sabtu: 08.00 – 17.00 WIB</span>
          </li>
        </ul>
      </div>

    </div><hr class="footer-divider mt-5 mb-4">

    <div class="d-flex flex-column flex-md-row justify-content-between align-items-center gap-2 pb-2">
      <p class="mb-0 small text-muted">
        &copy; <?= date('Y') ?> <?= NAMA_TOKO ?>. Hak cipta dilindungi.
      </p>
      <p class="mb-0 small text-muted">
        Dibuat dengan <i class="bi bi-heart-fill text-danger"></i> untuk Pak Budi
      </p>
    </div>
  </div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="<?= BASE_URL ?>/assets/js/app.js"></script>
</body>
</html>