//lazy load
(($) => {
  $(document).ready(() => {
    $("img.lazy-blanka").unveil();
    $(".match").matchHeight();
    // $('.tinvwl_add_to_wishlist-text').click(() => {
    //   $('.tinv-modal').animate('top', $('#main-header').outerHeight())
    // })
  });

  var localPickup = $("input.local_pickup");

  // SMOOTH SCROLL on all anchors
  $("a.smooth-scroll").click(function scrollAnchor(e) {
    e.preventDefault();
    const { location } = window;
    if (
      location.pathname.replace(/^\//, "") ===
        this.pathname.replace(/^\//, "") &&
      location.hostname === this.hostname
    ) {
      let target = $(this.hash);
      target = (target.length && target) || $(`[name=${this.hash.slice(1)}]`);
      if (target.length) {
        const targetOffset = target.offset().top;
        $("html,body").animate({ scrollTop: targetOffset }, 1000);
      }
    }
  });

  const popup = $(".offer-popup");
  $(".btn-product-offer").on("click", (e) => {
    console.log("ciaooo");
    $("body").addClass("popup");
    $(".shadow").fadeIn();
    popup.fadeIn();
  });
})(jQuery);
