{% extends 'base.html' %}

{% block title %}Daftar Toko UMKM - Pemagarsari{% endblock %}

{% block content %}
<section class="py-5 bg-light">
    <div class="container">
        <div class="text-center mb-5">
            <h1 class="fw-bold">Para Pelaku UMKM</h1>
            <p class="text-muted">Dukung usaha warga Desa Pemagarsari dengan berbelanja langsung dari toko mereka.</p>
        </div>

        <div class="row g-4">
            {% for shop in shops %}
            <div class="col-md-6 col-lg-4">
                <div class="card border-0 rounded-4 shadow-sm h-100 overflow-hidden">
                    <div class="row g-0 h-100">
                        <div class="col-4 bg-emerald d-flex align-items-center justify-content-center text-white">
                            {% if shop.logo %}
                            <img src="{{ shop.logo.url }}" alt="{{ shop.name }}" class="img-fluid w-100 h-100 object-fit-cover">
                            {% else %}
                            <i class="fa-solid fa-shop fa-3x opacity-50"></i>
                            {% endif %}
                        </div>
                        <div class="col-8">
                            <div class="card-body p-4">
                                <h5 class="fw-bold mb-2">{{ shop.name }}</h5>
                                <p class="text-muted small mb-3 text-truncate-2">{{ shop.description|default:"Pelaku UMKM Desa Pemagarsari" }}</p>
                                <div class="d-flex align-items-center mb-3">
                                    <i class="fa-brands fa-whatsapp text-success me-2"></i>
                                    <span class="small text-muted">{{ shop.whatsapp_number }}</span>
                                </div>
                                <a href="{% url 'shop_detail' shop.slug %}" class="btn btn-outline-emerald btn-sm rounded-pill px-4">Kunjungi Toko</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {% empty %}
            <div class="col-12 text-center py-5">
                <p class="text-muted">Belum ada toko yang terdaftar.</p>
            </div>
            {% endfor %}
        </div>
    </div>
</section>
{% endblock %}
