var Wick = Wick || {};
Wick.Overlay = (function () {
  var filterMobile = $('.filter-results_mobile');
  $('#open-overlay').click(function (event) {
    event.preventDefault();
    $('body').addClass('is-filters-visible');
    filterMobile.toggleClass('show');
  });

  $('#close-overlay, .filter-results__btn-close').click(function (event) {
    event.preventDefault();
    if (filterMobile.hasClass('show')) {
      $('body').removeClass('is-filters-visible');
      filterMobile.removeClass('show');
    }
  });

  $('.filter-results_desktop .filter__item input[type="checkbox"]').click(function () {
    $(this).closest('form').submit();
  });
})();
