<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use Magento\LayeredNavigation\Block\Navigation;
?>
<?php
/**
 * Category layered navigation
 *
 * @var $block Navigation
 */
?>
<?php if ($block->canShowBlock()) : ?>
    <div class="block filter filters-slideout-content" id="layered-filter-block">
        <?php $filtered = count($block->getLayer()->getState()->getFilters()) ?>
        <div class="block-title filter-title" data-count="<?= /* @noEscape */ $filtered ?>">
            <strong data-role="title"><?= $block->escapeHtml(__('Shop By')); ?></strong>
        </div>
        <div class="block-content filter-content">
            <?= $block->getChildHtml('state') ?>

            <?php if ($block->getLayer()->getState()->getFilters()) : ?>
                <div class="block-actions filter-actions">
                    <a href="<?= $block->escapeUrl($block->getClearUrl()) ?>" class="action clear button filter-clear">
                        <span><?= $block->escapeHtml(__('Clear All')) ?></span>
                    </a>
                </div>
            <?php endif; ?>
            <?php foreach ($block->getFilters() as $filter) : ?>
                <?php if ($filter->getItemsCount()) : ?>
                    <div data-role="collapsible " class="filter-options filter-options-item collapsible">
                        <div data-role="title" class="filter-options-title"><strong><?= $block->escapeHtml(__($filter->getName())) ?></strong><div class="toggle-minus"><span></span></div></div>
                        <div data-role="content" class="filter-options-content"  style="display:none;"><?= /* @escapeNotVerified */ $block->getChildBlock('renderer')->render($filter) ?></div>
                    </div>
                <?php endif; ?>
            <?php endforeach; ?>
        </div>
    </div>
<?php endif; ?>
