<?php if ($block->canShowBlock()) : ?>
    <div class="block filter" id="layered-filter-block">
        <?php $filtered = count($block->getLayer()->getState()->getFilters()) ?>
        <div class="block-title filter-title" data-count="<?= /* @escapeNotVerified */ $block->escapeHtml($filtered) ?>">
            <strong><?= /* @escapeNotVerified */ $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="<?= /* @escapeNotVerified */ $block->escapeUrl($block->getClearUrl()) ?>" class="action clear filter-clear"><span><?= /* @escapeNotVerified */ $block->escapeHtml(__('Clear All')) ?></span></a>
                </div>
            <?php endif; ?>
            <?php foreach ($block->getFilters() as $filter) : ?>
                <?php if ($filter->getItemsCount()) : ?>
                    <div class="filter-options-item" onclick="this.classList.toggle('active');">
                        <div class="filter-options-title"><?= /* @escapeNotVerified */ $block->escapeHtml(__($filter->getName())) ?></div>
                        <div class="filter-options-content"><?= /* @noEscape */ $block->getChildBlock('renderer')->render($filter) ?></div>
                    </div>
                <?php endif; ?>
            <?php endforeach; ?>
        </div>
    </div>
<?php endif; ?>
