{#
// inputs:
// - offcanvas: string - one of [always, mobile] (default: mobile)
#}

{% set offcanvas = offcanvas|default('mobile') %}
{% set classes = {
    'always': 'block-sidebar--offcanvas--always',
    'mobile': 'block-sidebar--offcanvas--mobile',
}[offcanvas] %}

<div class="block block-sidebar {{ classes }}">
    <div class="block-sidebar__backdrop"></div>
    <div class="block-sidebar__body">
        <div class="block-sidebar__header">
            <div class="block-sidebar__title">Filters</div>
            <button class="block-sidebar__close" type="button">
                <svg width="20px" height="20px"><use xlink:href="images/sprite.svg#cross-20"></use></svg>
            </button>
        </div>
        <div class="block-sidebar__item">
            {% include '/widgets/widget-filters.twig' with {offcanvas} %}
        </div>
        {% if offcanvas != 'always' %}
            <div class="block-sidebar__item d-none d-lg-block">
                {% include '/widgets/widget-products.twig' %}
            </div>
        {% endif %}
    </div>
</div>
