@model IEnumerable<WebVentaCoche.Models.Product>

<div class="container">
    <h2 class="text-center my-4">Nuestros Productos</h2>

    <div class="row">
        @foreach (var product in Model)
        {
            <div class="col-12 mb-4">
                <div class="card" style="background-color: rgba(255, 255, 255, 0.8); border-radius: 10px;">
                    <div class="row g-0">
                        <div class="col-md-4">
                            @if (!string.IsNullOrEmpty(product.ImagePath))
                            {
                                <img src="@product.ImagePath" class="img-fluid rounded-start" alt="@product.Name" style="max-height: 200px; object-fit: cover;">
                            }
                            else
                            {
                                <img src="/images/default.png" class="img-fluid rounded-start" alt="Imagen no disponible" style="max-height: 200px; object-fit: cover;">
                            }
                        </div>
                        <div class="col-md-8">
                            <div class="card-body">
                                <h5 class="card-title">@product.Name</h5>
                                <p class="card-text">@product.ShortDescription</p>
                                <a href="@Url.Action("ProductsDetailsHome", "Home", new { id = product.Id })" class="text-primary">Más detalles</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        }
    </div>
</div>
