const observer = lozad(); // lazy loads elements with default selector as '.lozad'
observer.observe();

$(document).ready(function () {
    
    //  $('.brand-sec .brand-list').owlCarousel({
    //     loop:true,
    //     margin:0,
    //     autoplay: true,
    //     nav:true,
    //     responsive:{
    //         0:{
    //             items:1
    //         },
    //         600:{
    //             items:1
    //         },
    //         767:{
    //             items:2
    //         },
    //         1000:{
    //             items:4
    //         }
    //     }
    // });
    $(".brand-sec .brand-list").slick({
    dots: false,
    arrows: false,
    infinite: true,
    speed: 300,
    autoplay: true,
    autoplaySpeed: 2000,
    slidesToShow: 4,
    slidesToScroll: 1,
    responsive: [],
  });
    
  $(".review-slider").slick({
    dots: false,
    arrows: true,
    infinite: true,
    speed: 300,
    autoplay: false,
    autoplaySpeed: 2000,
    slidesToShow: 1,
    slidesToScroll: 1,
    responsive: [],
  });
  // assign captions from title-attributes:
  $("[data-fancybox]").each(function () {
    $(this).attr("data-caption", $(this).attr("title"));
  });
  // start fancybox on all elements with attribute 'data-fancybox':
  $("[data-fancybox]").fancybox();

  $(".view-detail").on("click", function () {
    $(".view-detail").prev(".clist").removeClass("active");
    $(".view-detail").text("View Detail");
    $(".view-detail").not($(this)).removeClass("active-dropdown");
    $(this).toggleClass("active-dropdown");
    if ($(this).hasClass("active-dropdown")) {
      $(this).prev(".clist").addClass("active");
      $(this).text("Hide Detail");
    }
  });
  $(".nav-open").click(function () {
    $(".nav-bar").toggleClass("active");
    $(".mainoverlay").toggleClass("active");
  });
  $(".mob-icon").click(function () {
    $(".navbar-cust-dropdown-cont").toggleClass("active");
  });
  $(".cart-open").click(function () {
    $(".cart-bar").toggleClass("active");
    $(".mainoverlay").toggleClass("active");
  });
  $(document).on("click", function (e) {
    if (
      $(e.target).closest(".nav-bar").length == 0 &&
      $(".nav-bar").hasClass("active") &&
      $(e.target).closest(".nav-open").length == 0
    ) {
      $(".nav-bar").toggleClass("active");
      $(".mainoverlay").toggleClass("active");
    }
  });
  $("").click(function () {
    $(".package .clist").toggleClass("active");
  });
  $(".chat").click(function () {
    return $zopim.livechat.window.toggle(), !1;
  });
  $(".count").each(function () {
    $(this)
      .prop("Counter", 0)
      .animate(
        {
          Counter: $(this).text(),
        },
        {
          duration: 4000,
          easing: "swing",
          step: function (now) {
            $(this).text(Math.ceil(now));
          },
        }
      );
  });
  $(".services-slider").slick({
    dots: false,
    arrows: false,
    infinite: true,
    speed: 800,
    autoplay: false,
    autoplaySpeed: 2000,
    slidesToShow: 4,
    slidesToScroll: 3,
    responsive: [
      {
        breakpoint: 1367,
        settings: {
          slidesToShow: 3,
          slidesToScroll: 1,
        },
      },
      {
        breakpoint: 1025,
        settings: {
          slidesToShow: 2,
          slidesToScroll: 1,
        },
      },
      {
        breakpoint: 769,
        settings: {
          slidesToShow: 2,
          slidesToScroll: 1,
        },
      },
      {
        breakpoint: 600,
        settings: {
          slidesToShow: 1,
          slidesToScroll: 1,
        },
      },
      {
        breakpoint: 480,
        settings: {
          slidesToShow: 1,
          slidesToScroll: 1,
        },
      },
    ],
  });

  AOS.init();
});
$(document).ready(function () {
  setTimeout(alertFunc, 3000);
  function alertFunc() {
    $(".overlayS").addClass("hide");
    AOS.refresh();
  }
});
