{% from 'utils.html.twig' import imgUpload %}
{% if productCategories|length > 0 %}
{% set visibles = 10 %}
<section
class="pag-sec {% if section is defined and section.background %} sec-bg-alt {% endif %}">
<div id="categories-container" class="container" data-status="principal">
<header class="tit-sec tx-centro">
<h2>{{ getLanguage('main_categories', 'home') }}</h2>
</header>
<div class="nuvem-tags">
{% for productCategory in productCategories %}
<a href="{{ path('productListCategory', { type: 'produtos', slug: productCategory.slug }) }}" class="tag{{ (productCategory.icon)? ' icon' : ' txt' }}">
{% if productCategory.icon %}
{{ imgUpload(productCategory.icon, enum('AbstractEnum::PATH_OTHERS'), 'category-icon', productCategory.category) }}
{% endif %}
{{ productCategory.category }}
</a>
{% endfor %}
</div>
<footer>
{% if productCategories|length > visibles %}
<button id="btn-categories" class="btn-ver">
<span class="txt-show">{{ getLanguage('see_all', 'home') }}</span>
<span class="txt-hide">{{ getLanguage('see_main', 'home') }}</span>
</button>
{% endif %}
</footer>
</div>
</section>
{% endif %}