<?php if ((isset($modules)) && ($modules)) { ?>
  <script type="text/javascript">
    window.waitEvent('scripts_document', function() {
      $('#refine-control').live('click', function(event) {
        event.preventDefault();
        $('#refine-content').toggleClass('hidden');
        if ( $('#refine-content').hasClass('hidden') ) {
          $(this).find('i').removeClass('fa-times').addClass('fa-bars');
        } else {
          $(this).find('i').removeClass('fa-bars').addClass('fa-times');
        }
      });
    });
  </script>
  <div class="col-xs-12 hidden-md-up">
    <div class="row no-space-xs">
      <div class="col-xs-12">
        <div class="content-box background-gray border-gray">
          <a href="#" class="visible-block padding-medium text-large text-dark" id="refine-control">
            <i class="fas fa-bars right-margin-small" aria-hidden="true"></i>
            <span>Refine sua Busca</span>
          </a>
          <div class="row no-space-xs hidden" id="refine-content">
            <div class="col-xs-12">
              <div class="content-box js-aside-filter-container horizontal-padding-medium">
                <?php foreach ($modules as $module) { ?>
                  <?php echo $module; ?>
                <?php } ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
<?php } ?>
