{block name='productlist-result-options'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    {* This file is not actually rendered by default, but left in for compatibility reasons *}
    {assign var=show_filters value=(count($NaviFilter->getAvailableContentFilters()) > 0
    && ($Einstellungen.artikeluebersicht.suchfilter_anzeigen_ab == 0
        || $NaviFilter->getSearchResults()->getProductCount() >= $Einstellungen.artikeluebersicht.suchfilter_anzeigen_ab))
    || $NaviFilter->getFilterCount() > 0}
    <div id="result-options">
        <div class="row">
        {block name='productlist-result-options-filter-link'}
            <div class="col col-12 col-md-4 filter-collapsible-control order-1 order-md-0 d-flex">
                {if $show_filters}
                    {block name='productlist-result-options-filter-link-filter'}
                        <button id="js-filters"
                            class="btn btn-secondary{if $filterPlacement === 'collapse'} btn-block{/if} text-nowrap-util"
                            data-toggle="{if !empty($filterPlacement)}{$filterPlacement}{else}modal{/if}"
                            data-target="#collapseFilter"
                            aria-expanded="false"
                            aria-controls="collapseFilter"
                        >
                            <span class="{et_getIcon key="filter"}{if $NaviFilter->getFilterCount() > 0} text-primary{/if}"></span>
                            {if $filterPlacement === 'collapse'}{lang key='filterAndSort'}{else}{lang key='filter'}{/if}
                        </button>
                    {/block}
                {/if}
                {if !empty($filterPlacement) && !$filterPlacement === "collapse"}
                    {block name='productlist-result-options-filter-include-layout-options'}
                        {include file='productlist/layout_options.tpl'}
                    {/block}
                {/if}
            </div>
        {/block}
        </div>

        {block name='productlist-result-options-filter-collapsible'}
            {if $show_filters}
                {if !empty($filterPlacement) && $filterPlacement === 'collapse'}
                    <div id="collapseFilter" class="collapse productlist-filter js-collapse-filter">
                    </div>
                {else}
                    <div class="modal" id="collapseFilter">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <div class="modal-title h5">{lang key='filterAndSort'}</div>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="{if $shopIsAtLeast55}{lang section='aria' key='close'}{else}Close{/if}"><i class="{et_getIcon key="close"}"></i></button>
                                </div>
                                <div class="modal-body js-collapse-filter">
                                </div>
                            </div>
                        </div>
                    </div>
                {/if}
            {/if}
        {/block}
    </div>
{/block}
