{if $smarty.const.NAVIGATION_POSITION eq 'top'}
{block name=mainHeader_boxMegaMenu_top}
    {if $selected_header neq 2}
        {box_cache name=categories_recursive position=navbar template="mega_menu" cache_id=mega_menu}
    {/if}
{/block}
{/if}

{assign var=prefix value=HEADER}{if $page != 'index'}{assign var=prefix value=SUB_HEADER}{/if}
{assign var=header_background value=$prefix|cat:'_BACKGROUND'}
{assign var=header_background_color value=$prefix|cat:'_BACKGROUND_COLOR'}
{assign var=header_background_image value=$prefix|cat:'_BACKGROUND_IMAGE'}

{block name=mainHeaderWrapper}
<div class="main-header-wrapper {if $smarty.const.{$header_background} eq 'color'}bg-color{elseif $smarty.const.{$header_background} eq 'image' && $smarty.const.{$header_background_image} neq ''}bg-img{/if}" {if $smarty.const.{$header_background} eq 'image' && $smarty.const.{$header_background_image} neq ''}style="background-image: url({img img=$smarty.const.{$header_background_image} type=m_background path_only=true})"{/if}>
    <div class="main-header header-{$selected_header}">
        <button class="btn-overlay-show js-open-overlay"><i class="fa fa-bars" aria-hidden="true"></i> {txt key=TEXT_XGX_BARE_MENU}</button>
        <div class="row">

            <div class="header-left-box">
                <div class="header-wrapper">
                    <div class="header-center">
                        {block name=mainHeader_headerLeftBox}{/block}
                    </div>
                </div>
            </div>

            <div class="header-center-box">
                <div class="header-wrapper">
                    <div class="header-center">
                        {block name=mainHeader_headerCenterBox}{/block}
                    </div>
                </div>
            </div>

            <div class="header-right-box sticky-bottom-mobil-footer">
                <div class="header-wrapper">
                    <div class="header-center">
                        {block name=mainHeader_headerRightBox}{/block}
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
{/block}

{if $smarty.const.NAVIGATION_POSITION eq 'default'}
{block name=mainHeader_boxMegaMenu_default}
    {if $selected_header neq 2}
        {box_cache name=categories_recursive position=navbar template="mega_menu" cache_id=mega_menu}
    {/if}
{/block}
{/if}