{% extends 'base.html' %}
{% load static %}

{% block title %}Product Catalog{% endblock %}

{% block content %}
<div class="hero-section text-white text-center">
    <div class="container">
        <h1 class="display-4">Our Products</h1>
        <p class="lead">Browse our collection of high-quality roofing membranes and accessories.</p>
    </div>
</div>

<div class="album py-5 bg-light">
    <div class="container">
        <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
            {% for product in products %}
            <div class="col">
                <div class="card shadow-sm product-card">
                    <img src="{% if product.image %}{{ product.image.url }}{% else %}https://via.placeholder.com/300x200.png?text={{ product.name|urlencode }}{% endif %}" class="card-img-top" alt="{{ product.name }}">
                    <div class="card-body">
                        <h5 class="card-title">{{ product.name }}</h5>
                        <p class="card-text">{{ product.description|truncatewords:15 }}</p>
                        <div class="d-flex justify-content-between align-items-center">
                            <div class="btn-group">
                                <button type="button" class="btn btn-sm btn-outline-secondary">View</button>
                                <button type="button" class="btn btn-sm btn-primary disabled">Add to cart</button>
                            </div>
                            <small class="text-muted">${{ product.price }}</small>
                        </div>
                    </div>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>
</div>
{% endblock %}
