{% set menu = dediMegamenu.menu %}

{% if menu is not null %}
    <nav class="menu-container" aria-label="Main">
        <div class="container">
            <div data-menu>
                <ul class="main-menu menu-lvl1" data-items>
                    {% for entry in menu.enabledEntries %}
                        {% set hasSubmenu = entry.type != 'direct_link' %}
                        <li class="{% if hasSubmenu %}has-submenu{% endif %} {% if entry.type == 'product_catalog' %}menu-group-container{% endif %}">
                            <div class="menu-title title-menu-lvl1">
                                {{ sylius_template_event('dedi_megamenu.shop.menu.item.'~entry.type, {'entry': entry, 'index': loop.index}) }}
                                {% if hasSubmenu %}
                                    <span class="menu-link-icon"></span>
                                {% endif %}
                            </div>

                            {% if hasSubmenu %}
                                {{ sylius_template_event('dedi_megamenu.shop.menu.tab.'~entry.type, {'entry': entry, 'index': loop.index}) }}
                            {% endif %}
                        </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
    </nav>
{% endif %}
