{# @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.getChildren(activeId) %}
{% 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">
{% if not isRoot %}
<div class="navigation-offcanvas-top" style="display:flex">
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/show-all-link.html.twig' %}
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/active-item-link.html.twig' with { item: active } %}
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/back-link.html.twig' with { item: active } %}
</div>
{% else %}
{# {% sw_include '@Storefront/storefront/layout/navigation/offcanvas/general-headline.html.twig' %} #}
{% endif %}
<ul class="list-unstyled navigation-offcanvas-list offcanvas-custom-menu-ul">
{% for item in children.tree %}
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/item-link.html.twig' with { item: item, activeId: activeId } %}
{% endfor %}
<div class="navigation-offcanvas-top">
{% if not isRoot and page.navigation.active.type != "folder" %}
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/show-active-link.html.twig' with { item: active } %}
{% endif %}
</div>
<div class="navigation-offcanvas-top-big">
{% if not isRoot and page.navigation.active.type != "folder" %}
{% for item in page.header.navigation.tree %}
{% sw_include '@Storefront/storefront/layout/navigation/offcanvas/item-link.html.twig' with { item: item, activeId: active.Id, parentId: active.parentId } %}
{% endfor %}
{% endif %}
</div>
</ul>
</div>
</div>
{% endblock %}