{# @var navigation \Shopware\Core\Content\Category\Tree\Tree #}
{% set activeId = navigation.active.id ?? context.salesChannel.navigationCategoryId %}
{% set isRoot = activeId == context.salesChannel.navigationCategoryId %}
{% set children = navigation %}
{% set active = navigation.active %}
{% block layout_navigation_offcanvas_navigation_categories %}
<div class="navigation-offcanvas-container js-navigation-offcanvas">
<div class="navigation-offcanvas-overlay-content js-navigation-offcanvas-overlay-content">
{% set mainNavigation = children.tree|filter(n => n.category.name == 'Main Navigation')|first %}
{% if mainNavigation %}
<ul class="list-unstyled navigation-offcanvas-list">
{% for item in mainNavigation.children|sort((a, b) =>
a.category.translated.customFields.migration_shopware5_category_nav_col
<=> b.category.translated.customFields.migration_shopware5_category_nav_col) %}
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/collapse-menu.html.twig'
with { item: item } only %}
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endblock %}