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

<?php
$helper = $this->helper('Codazon\AjaxLayeredNavPro\Helper\Data');
?>
<?php if ($helper->enableAjaxLayeredNavigation()) : ?>
<?php
$widget = [
    'Codazon_AjaxLayeredNavPro/js/ajaxlayerednavpro' => []
];
$boxMaxHeight = (int)$helper->getConfig('codazon_ajaxlayerednavpro/general/box_max_height');
?>
<div class="product-list-container" id="product-list-container" data-mage-init='<?= json_encode($widget) ?>'>
    <?php echo $this->getChildHtml() ?>
</div>
<?php if ($boxMaxHeight) : ?>
<style type="text/css">
@media(min-width: 768px) {
.filter-options-content-inner{max-height: <?= $boxMaxHeight ?>px; overflow-y: auto;}
.filter-options-content-inner .swatch-attribute-options{margin: 0 0 0 0;}
}
</style>
<?php endif ?>
<?php else : ?>
<?php echo $this->getChildHtml() ?>
<?php endif ?>