jQuery(document).ready(function ($) {
  $(window).on("scroll", function () {
    if ($(this).scrollTop() > 100) {
      $(".back-to-top a").fadeIn();
    } else {
      $(".back-to-top a").fadeOut();
    }
  });

  $(".back-to-top a").on("click", function (e) {
    e.preventDefault();
    $("html, body").animate({ scrollTop: 0 }, 800);
  });

  $('.product-sec .owl-carousel').owlCarousel({
    loop: true,
    margin: 0,
    nav: true,
    dots: false,
    rtl: false,
    margin: 20,
    autoplay: false,
    items: 1,
        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 1
            },
            768: {
                items: 2
            },
            1024: {
                items: 2
            },
            1025: {
                items: 3
            }
        }
  });
});

// product rating js
jQuery(document).ready(function($){

    $('.product-sec .wc-block-components-product-rating').each(function(){

        var rating = $(this).find('strong.rating').text();

        $(this).append('<span class="custom-rating-number">'+rating+'</span>');

    });

});