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

// @codingStandardsIgnoreFile

?>
<?php
/**
 * Category layered navigation
 *
 * @var $block \Magento\LayeredNavigation\Block\Navigation
 */
?>

<?php if ($block->canShowBlock()): ?>
    <div class="block filter" data-mage-init='{"collapsible":{"openedState": "active", "collapsible": true, "active": false, "collateral": { "openedState": "filter-active", "element": "body" } }}'>
        <div class="block-title filter-title">
            <strong data-role="title"><?= __('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->getClearUrl() ?>" class="action clear filter-clear"><span><?= __('Clear All') ?></span></a>
                </div>
            <?php endif; ?>
            <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?= __('Shopping Options') ?></strong>
			<div class="filter-options" id="narrow-by-list" data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": [0], "multipleCollapsible": false}}'>
            <?php foreach ($block->getFilters() as $filter): ?>
				<?php if ($filter->getItemsCount()): ?>
				<div data-role="collapsible" class="filter-options-item">
					<div data-role="title" role="heading" aria-level="3" class="filter-options-title"><?= $block->escapeHtml(__($filter->getName())) ?></div>
					<div data-role="content" class="filter-options-content"><?= $block->getChildBlock('renderer')->render($filter) ?></div>
				</div>
				<?php endif; ?>
            <?php endforeach; ?>
            </div>
        </div>
    </div>
<?php endif; ?>
