{% set productCategories = getProductCategories() %}
{% if productCategories|length > 0 %}
<section class="mx-4 lg:container mt-20">
<div
class="flex flex-col gap-y-4 xs:flex-row items-center justify-between w-full text-center xs:text-start">
<div class="flex items-center gap-x-2 sm:gap-x-4">
<span class="size-12 hidden xs:flex rounded-lg bg-white shadow-lg dark:bg-gray-800 flex-center">
<svg class="size-7 text-gray-700 dark:text-gray-100">
<use href="#squares"></use>
</svg>
</span>
<div class="space-y-1 md:space-y-1">
<h3 class="text-xl md:text-2xl font-MorabbaMedium text-gray-800 dark:text-gray-50">دسـته
بندی
هـای
<span class="text-blue-600 dark:text-blue-500">محبوب</span>
</h3>
<p class="text-sm text-gray-500 dark:text-gray-300">جدیدترین و بروزترین دسته بندی ها</p>
</div>
</div>
<div class="w-full xs:w-auto flex justify-center items-center gap-x-2">
<a href="{{ path('app_shop_site_products') }}"
class="group shadow-xl text-sm md:text-base flex gap-x-1.5 items-center px-2 h-10 md:px-3 text-white bg-blue-600 rounded-xl">
<p>مشاهده همه</p>
<span
class="w-7 h-7 rounded-full bg-blue-500 flex-center md:group-hover:-translate-x-1 transition-transform duration-300">
<svg class="size-5">
<use href="#arrow"/>
</svg>
</span>
</a>
</div>
</div>
<div class="flex items-center justify-evenly flex-wrap mt-12 child:mb-8 gap-x-8 child:items-center child:flex-col child:duration-300 child:cursor-pointer child:gap-y-1 child:text-gray-800 child:dark:text-gray-300 child:relative">
{% for category in productCategories %}
<a href="{{ path('app_shop_site_product_category' , {'urlSlug' : category.urlSlug}) }}" class="group flex">
<img src="{{ category.imageUrl }}"
class="w-[100px] h-[100px] lg:w-[120px] lg:h-[120px] object-cover group-hover:grayscale group-hover:opacity-90 duration-300"
alt="category1"/>
<p class="pt-1 text-sm lg:text-lg line-clamp-1">
{{ category.name }}
</p>
</a>
{% endfor %}
</div>
</section>
{% endif %}