@model IList<CategoryModel>
@using Nop.Core.Domain.Catalog
@if (Model.Count > 0)
{
    <div class="category-grid home-page-category-grid">
        <div class="title sub-title col-md-12">
            <strong>@T("Categories")</strong>
        </div>
        <div class="row">
            @if (Model.Count <= 3)
            {
                foreach (var item in Model)
                {
                    <div class="item-box col-xs-12 col-sm-4 col-md-4">
                        <div class="category-item product-category-item">
                            <div class="picture">
                                <a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title" class="product-img">
                                    <img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl" title="@item.PictureModel.Title" />
                                </a>
                                <div class="title">
                                    <a href="@(Url.RouteUrl<Category>(new { SeName = item.SeName }))" title="@item.PictureModel.Title"> @item.Name</a>
                                </div>
                            </div>
                        </div>
                    </div>
                }
            }
            else
            {
                <div id="home-category-slider" class="home-category-slider owl-carousel owl-theme">
                    @foreach (var item in Model)
                    {
                        <div class="item-box col-xs-12 col-sm-12 col-md-12">
                            <div class="category-item product-category-item">
                                <div class="picture">
                                    <a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title" class="product-img">
                                        <img class="owl-lazy" data-src="@item.PictureModel.ImageUrl" alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl" title="@item.PictureModel.Title" />
                                    </a>
                                    <div class="title">
                                        <a href="@(Url.RouteUrl<Category>(new { SeName = item.SeName }))" title="@item.PictureModel.Title"> @item.Name</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    }
                </div>
            }
        </div>
    </div>
}
