@model goods.Models.Coupang.Search.Response

@{
    ViewData["Title"] = "상품 검색";

    // 검색 결과는 키워드마다 주소가 달라지고 keyword 없이는 400 이므로 색인 대상에서 제외한다.
    ViewData["NoIndex"] = true;
}

<div id="products" class="container-2xl mx-auto">
    <h1 class="text-2xl mb-2 text-center">@ViewData["Title"]</h1>
    <hr/>
    <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg\:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-7 gap-4 mt-3">
        @foreach (var row in Model.Data.ProductData)
        {
            <div>
                <a href="@row.ProductUrl" rel="external" target="_blank">
                    <figure>
                        <img src="@row.ProductImage" alt="@row.ProductName"/>
                        <figcaption>@row.ProductName</figcaption>
                        <p>@row.ProductPrice.ToString("N0") 원</p>
                        @if(row.IsRocket) {
                            <span>로켓배송</span>
                        }
                        @if (row.IsFreeShipping)
                        {
                            <span>무료배송</span>
                        }
                    </figure>
                </a>
            </div>
        }
    </div>
</div>