<!DOCTYPE html>
<html lang="id">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{% block title %}Marketplace UMKM Pemagarsari{% endblock %}</title>
  
  <!-- Fonts -->
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap" rel="stylesheet">
  
  <!-- Bootstrap 5 -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- FontAwesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  
  {% load static %}
  <link rel="stylesheet" href="{% static 'css/custom.css' %}">
  
  {% block head %}{% endblock %}
</head>

<body>
  <!-- Navbar -->
  <nav class="navbar navbar-expand-lg sticky-top">
    <div class="container">
      <a class="navbar-brand fw-bold" href="{% url 'home' %}">
        <i class="fa-solid fa-shop text-orange me-2"></i><span class="text-orange">UMKM</span> Pemagarsari
      </a>
      <button class="navbar-toggler border-0 shadow-none" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav ms-auto align-items-center">
          <li class="nav-item">
            <a class="nav-link px-3" href="{% url 'home' %}">Beranda</a>
          </li>
          <li class="nav-item">
            <a class="nav-link px-3" href="{% url 'shop_list' %}">Toko</a>
          </li>
          <li class="nav-item">
            <a class="nav-link px-3" href="{% url 'home' %}#produk">Produk</a>
          </li>
          {% if user.is_authenticated %}
          <li class="nav-item dropdown ms-lg-3">
            <a class="nav-link dropdown-toggle btn btn-light rounded-pill px-4" href="#" role="button" data-bs-toggle="dropdown">
              <i class="fa-solid fa-user-circle me-2"></i>{{ user.username }}
            </a>
            <ul class="dropdown-menu dropdown-menu-end border-0 shadow-sm rounded-3">
              <li><a class="dropdown-item" href="{% url 'dashboard' %}">Dashboard</a></li>
              <li><hr class="dropdown-divider"></li>
              <li>
                <form action="{% url 'logout' %}" method="POST">
                  {% csrf_token %}
                  <button type="submit" class="dropdown-item text-danger">Logout</button>
                </form>
              </li>
            </ul>
          </li>
          {% else %}
          <li class="nav-item ms-lg-3">
            <a class="btn btn-orange rounded-pill px-4" href="{% url 'login' %}">
              <i class="fa-solid fa-right-to-bracket me-2"></i>Masuk
            </a>
          </li>
          {% endif %}
        </ul>
      </div>
    </div>
  </nav>

  <main>
    {% block content %}{% endblock %}
  </main>

  <!-- Footer -->
  <footer class="py-5 mt-5">
    <div class="container text-center">
      <h5 class="fw-bold mb-3">UMKM Desa Pemagarsari</h5>
      <p class="text-muted small mb-4">Membangun ekonomi desa melalui digitalisasi marketplace mandiri.</p>
      <div class="social-links mb-4">
        <a href="#" class="mx-2"><i class="fa-brands fa-facebook text-muted"></i></a>
        <a href="#" class="mx-2"><i class="fa-brands fa-instagram text-muted"></i></a>
        <a href="#" class="mx-2"><i class="fa-brands fa-whatsapp text-muted"></i></a>
      </div>
      <hr class="w-25 mx-auto">
      <p class="text-muted small mt-4">&copy; 2026 Desa Pemagarsari. Powered by Flatlogic.</p>
    </div>
  </footer>

  <!-- Scripts -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>
