{if $smarty.const.NAVIGATION_CONTENT_BLOCK}
{content block_id=$smarty.const.NAVIGATION_CONTENT_BLOCK}
{assign var=navigation_content value=$_content_{$smarty.const.NAVIGATION_CONTENT_BLOCK}}
{/if}

{block name=mobileNavigation_functionMenu}
    {function name=menu level=1}
        <ul class="level-{$level} {if $parent_id}collapse{/if}" {if $parent_id}id="cat-{$parent_id}"{/if}>
        {foreach $data as $category}
            <li>
                <div class="li-table">
                    <a href="{$category.categories_link}">{$category.categories_name}</a>
                    {if empty($category.sub)}
                    <a href="{$category.categories_link}" class="no"></a>
                    {else}
                    <a class="more" role="button" data-toggle="collapse" href="#cat-{$category.categories_id}" aria-expanded="false" aria-controls="#cat-{$category.categories_id}"></a>
                    {/if}
                </div>
                {if !empty($category.sub)}
                    {menu data=$category.sub level=$level+1 parent_id=$category.categories_id}
                {/if}
            </li>
        {/foreach}
        </ul>
    {/function}
{/block}

{block name=mobileNavigation_overlayMobilnav}
<div class="overlay-mobilnav">
    <div class="overlay-mobilnav-wrapper">
        {block name=mobileNavigation_overlayMobilnav_header}
        <div class="mobil-nav-header">
            <a href="{link page=index conn=SSL}" class="btn btn-primary"><i class="fa fa-home" aria-hidden="true"></i> <span class="hidden-xs"> {txt key=TEXT_HOME}</span> </a>
            <a class="btn btn-default" href="{link page=checkout paction=shipping conn=SSL}"><i class="fa fa-shopping-cart" aria-hidden="true"></i></a>
            <a class="btn btn-default" href="{link page=customer conn=SSL}"><i class="fa fa fa-user" aria-hidden="true"></i></a>

            {if $account == true}
            <a class="btn btn-default" href="{link page=customer conn=SSL}"><i class="fa fa-user" aria-hidden="true"></i></a>
            {if $registered_customer}
            <a class="btn btn-default" href="{link page=customer paction=logoff conn=SSL}"><i class="fa fa-sign-out" aria-hidden="true"></i></a>
            {else}
            <a class="btn btn-default" href="{link page=customer paction=login conn=SSL}"><i class="fa fa-sign-in" aria-hidden="true"></i></a>
            {/if}
            {/if}

            <button class="btn btn-secondary pull-right js-close-overlay"><span class="hidden-xs"> {txt key=TEXT_POPUP_CLOSE}</span> <i class="fa fa-times" aria-hidden="true"></i></button>
        </div>
        {/block}

        {block name=mobileNavigation_overlayMobilnav_mobilNav}
        <nav class="mobil-nav">
            {menu data=$_categories}
        </nav>
        {/block}

        {block name=mobileNavigation_overlayMobilnav_mobilNavSmall}
        {if $navigation_content}
        <nav class="mobil-nav small">
            <ul class="level-1">
                {foreach $navigation_content as $content}
                <li>
                    <div class="li-table">
                        <a href="{$content.link}">{$content.content_title}</a>
                        <a class="no" href="{$content.link}"></a>
                    </div>
                </li>
                {/foreach}
            </ul>
        </nav>
        {/if}
        {/block}

        {block name=mobileNavigation_overlayMobilnav_footer}
        <div class="mobil-nav-footer text-center">{txt key=TEXT_XGX_BARE_MOBILE_NAV_FOOTER}</div>
        {/block}
    </div>
</div>
{/block}