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

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

        <section class="listing-search-container">
            <div class="container">
                <div class="row">
                    <div class="col-md-3">
                        <p class="listing-search-title">{{ 'monsieurbiz_searchplugin.filters.filter_results' | trans }}</p>
                    </div>
                    <div class="col-md-8">
                        <div class="row listing-search-wrapper">
                            <div class="col-12 col-md-12 col-lg">
                                <span class="listing-nb-shown"><strong>{{ resultSet.totalHits }}</strong> {{ 'app.ui.product.nb_displayed'|trans({'%count%': resultSet.totalHits}) }}</span>
                            </div>
                            <div class="col col-md">
                                {% include '@MonsieurBizSyliusSearchPlugin/Search/_sorting.html.twig' %}
                            </div>
                            <div class="col-md-auto">
                                {% include '@MonsieurBizSyliusSearchPlugin/Search/_pagination.html.twig' %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <div class="container">
            <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="row" id="products">
                            {% for result in resultSet.results %}
                                <div class="col-6 col-lg-4 d-flex">
                                    {% include '@MonsieurBizSyliusSearchPlugin/Search/_box.html.twig' with {'result': result} %}
                                </div>
                            {% endfor %}
                        </div>

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