{% extends '@SyliusShop/layout.html.twig' %}
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}

{% block content %}
    <div class="container mbiz-sylius-search-grid">
        <div class="row mb-4">
            <div class="col">
                {% include '@MonsieurBizSyliusSearchPlugin/Search/_header.html.twig' %}
            </div>
        </div>

        <div class="row">
            <div class="col-md-3">
                {% include '@MonsieurBizSyliusSearchPlugin/Search/_sidebar.html.twig' %}
            </div>
            <div class="col-md-8">
                {% if resultSet.totalHits == 0 %}
                    <p class="text-center">
                        {{ 'monsieurbiz_searchplugin.search.result.no_result'|trans }}
                    </p>
                {% else %}
                    <div class="container">
                        <div class="row mb-3">
                            <div class="col">
                                {% include '@MonsieurBizSyliusSearchPlugin/Search/_sorting.html.twig' %}
                                {% include '@MonsieurBizSyliusSearchPlugin/Search/_pagination.html.twig' %}
                            </div>
                        </div>
                        <div class="row" id="products">
                            {% for result in resultSet.results %}
                                <div class="col-md-4">
                                    {% include '@MonsieurBizSyliusSearchPlugin/Search/_box.html.twig' with {'result': result} %}
                                </div>
                            {% endfor %}
                        </div>
                    </div>

                    {{ pagination.simple_bootstrap(resultSet.pager, {'css_container_class': 'pagination justify-content-center'}) }}
                {% endif %}
            </div>
        </div>
    </div>
{% endblock %}
