{% sw_extends '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
{% block layout_main_navigation %}
<div class="main-navigation" id="mainNavigation" data-flyout-menu="true">
{% block layout_main_navigation_navbar %}
<div
class="container dm_main-navigation-wrapper">
<!-- Logo -->
{% block layout_header_logo %}
<div class="logo-container">
{% sw_include '@Storefront/storefront/layout/header/logo.html.twig' %}
</div>
{% endblock %}
<!-- Navigation -->
{% block layout_main_navigation_menu %}
<nav class="nav main-navigation-menu" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
{% set homeLabel = context.salesChannel.translated.homeName|default("general.homeLink"|trans) %}
{% block layout_main_navigation_menu_home %}
{% if context.salesChannel.translated.homeEnabled %}
<a class="nav-link main-navigation-link{% if controllerAction is same as('home') %} active{% endif %} home-link" href="{{ path('frontend.home.page') }}" itemprop="url" title="{{ homeLabel|striptags }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ homeLabel|sw_sanitize }}</span>
</div>
</a>
{% endif %}
{% endblock %}
{% block layout_main_navigation_menu_items %}
{% if page.product is defined %}
{% set activePath = page.product.categoryTree %}
{% else %}
{% set activePath = page.header.navigation.active.path %}
{% endif %}
{% for treeItem in page.header.navigation.tree %}
{% set category = treeItem.category %}
{% set name = category.translated.name %}
{# @deprecated tag:v6.5.0 - Use "category.id" directly instead. #}
{% set categorId = category.id %}
{% block layout_main_navigation_menu_item %}
{% if category.type == 'folder' %}
<div class="nav-link main-navigation-link" {% if treeItem.children|length > 0 %} data-flyout-menu-trigger="{{ category.id }}" {% endif %} title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</div>
{% else %}
<a class="nav-link main-navigation-link{% if category.id == page.header.navigation.active.id or category.id in activePath %} active{% endif %}" href="{{ category_url(category) }}" itemprop="url" {% if treeItem.children|length > 0 %} data-flyout-menu-trigger="{{ category.id }}" {% endif %} {% if category_linknewtab(category) %} target="_blank" {% endif %} title="{{ name }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ name }}</span>
</div>
</a>
{% endif %}
{% endblock %}
{% endfor %}
{% endblock %}
</nav>
<div class="header-search-col">
<div class="row">
<div class="col-sm-auto d-none d-sm-block d-lg-none">
<div class="nav-main-toggle">
<button class="btn nav-main-toggle-btn header-actions-btn" type="button" data-offcanvas-menu="true" aria-label="{{ "general.menuLink"|trans|striptags }}">
{% sw_icon 'stack' %}
</button>
</div>
</div>
<div class="">
{% sw_include '@Storefront/storefront/layout/header/search.html.twig' %}
</div>
</div>
</div>
<div class="header-actions-col">
<div class="row {{ gridNoGuttersClass }}">
{% if config('core.cart.wishlistEnabled') %}
{% if context.customer %}
<div class="col-auto">
<div class="header-wishlist">
<a class="btn header-wishlist-btn header-actions-btn" href="{{ path('frontend.wishlist.page') }}" title="{{ 'header.wishlist'|trans|striptags }}" aria-label="{{ 'header.wishlist'|trans|striptags }}">
{% sw_include '@Storefront/storefront/layout/header/actions/wishlist-widget.html.twig' %}
</a>
</div>
</div>
{% endif %}
{% endif %}
<div class="col-auto">
<div class="account-menu">
<div class="dropdown">
<button class="btn account-menu-btn header-actions-btn" type="button" id="accountWidgetSticky" data-offcanvas-account-menu="true" {{ dataBsToggleAttr }}="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="{{ "account.myAccount"|trans|striptags }}" title="{{ "account.myAccount"|trans|striptags }}">
{% sw_icon 'avatar' %}
</button>
<div class="dropdown-menu dropdown-menu-right account-menu-dropdown js-account-menu-dropdown" aria-labelledby="accountWidgetSticky">
{% sw_include '@Storefront/storefront/layout/header/account-menu.html.twig' %}
</div>
</div>
</div>
</div>
<div class="col-auto">
<div class="header-cart" data-offcanvas-cart="true">
<a class="btn header-cart-btn header-actions-btn" href="{{ path('frontend.checkout.cart.page') }}" data-cart-widget="true" title="{{ 'checkout.cartTitle'|trans|striptags }}" aria-label="{{ 'checkout.cartTitle'|trans|striptags }}">
{% sw_include '@Storefront/storefront/layout/header/actions/cart-widget.html.twig' %}
</a>
</div>
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
{% block layout_main_navigation_menu_flyout_wrapper %}
{% set navigationChildrenCount = 0 %}
{% for treeItem in page.header.navigation.tree %}
{% if treeItem.category.childCount > 0 %}
{% set navigationChildrenCount = navigationChildrenCount + 1 %}
{% endif %}
{% endfor %}
{% if navigationChildrenCount > 0 %}
{% block layout_main_navigation_menu_flyout_container %}
<div class="navigation-flyouts">
{% block layout_main_navigation_menu_flyouts %}
{% for treeItem in page.header.navigation.tree %}
{% if treeItem.children|length > 0 %}
{% block layout_main_navigation_menu_flyout %}
<div class="navigation-flyout" data-flyout-menu-id="{{ treeItem.category.id }}">
<div class="container">
{% block layout_main_navigation_menu_flyout_include %}
{% sw_include '@Storefront/storefront/layout/navigation/flyout.html.twig' with {navigationTree: treeItem, level: level+1, page: page} only %}
{% endblock %}
</div>
</div>
{% endblock %}
{% endif %}
{% endfor %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% endblock %}
</div>
{% endblock %}