<?php
/**
 * Copyright © 2016 Magento. 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="filter">
        <div class=" filter-title">
            <strong><?php /* @escapeNotVerified */ echo __('Shop By') ?></strong>
        </div>

        <div class="filter-content">
            <?php echo $block->getChildHtml('state') ?>

            <?php if ($block->getLayer()->getState()->getFilters()): ?>
                <div class="block-actions filter-actions">
                    <a href="<?php /* @escapeNotVerified */ echo $block->getClearUrl() ?>" class="action clear filter-clear btn btn-default btn-sm btn-block">
                        <span class="glyphicon glyphicon-remove"></span>
                        <?php /* @escapeNotVerified */ echo __('Clear All') ?>
                    </a>
                </div>
                <hr/>
            <?php endif; ?>
            <?php $wrapOptions = false; ?>
            <?php foreach ($block->getFilters() as $filter): ?>
                <?php if (!$wrapOptions): ?>
                    <h6 role="heading" aria-level="2" class="block-subtitle filter-subtitle">
                        <?php /* @escapeNotVerified */ echo __('Shopping Options') ?>
                    </h6>
                    <div class="list-group filter-options" id="narrow-by-list">
                        <?php
                        $wrapOptions = true;
                    endif;
                    ?>
                    <?php if ($filter->getItemsCount()): ?>
                        <div class="list-group-item">
                            <div class="list-group-title collapsed" data-toggle="collapse"  href="#filter-<?php echo $block->escapeHtml(__($filter->getName())) ?>"><?php echo $block->escapeHtml(__($filter->getName())) ?></div>
                            <div class="collapse" id="filter-<?php echo $block->escapeHtml(__($filter->getName())) ?>"  data-parent=".filter-content">
                                <div class="filter-list">
                                    <?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->render($filter); ?>
                                </div>
                            </div>
                        </div>
                    <?php endif; ?>
                <?php endforeach; ?>
                <?php if ($wrapOptions): ?>
                </div>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>
