/**
 * Demolition Contractor Theme - Main JavaScript
 * Handles theme interactive functionality
 */

// Faq
document.addEventListener("DOMContentLoaded", function () {
  const demolition_contractor_game_details = document.querySelectorAll(".faq-btm-title");

  demolition_contractor_game_details.forEach((targetDetail) => {
    targetDetail.addEventListener("toggle", () => {
      if (targetDetail.open) {
        demolition_contractor_game_details.forEach((demolition_contractor_game_detail) => {
          if (demolition_contractor_game_detail !== targetDetail) {
            demolition_contractor_game_detail.removeAttribute("open");
          }
        });
      }
    });
  });
});

jQuery(document).ready(function ($) {

  // Main Slider
  $('.slider.owl-carousel').owlCarousel({
      margin: 20,
      nav: true,
      autoplay: true,
      lazyLoad: true,
      autoplayTimeout: 3000,
      loop: true,
      dots: false,
      navText: [
        '<span class="dashicons dashicons-arrow-left-alt2"></span>',
        '<span class="dashicons dashicons-arrow-right-alt2"></span>'
      ],
      responsive: {
        0: { items: 1, nav: false },
        600: { items: 1 },
        1000: { items: 1 }
      },
      autoplayHoverPause: true,
      mouseDrag: true
  });

  // Category Slider
  $('.cat-position.owl-carousel').owlCarousel({
      margin: 20,
      nav: false,
      autoplay: true,
      lazyLoad: true,
      autoplayTimeout: 3000,
      loop: true,
      dots: true,
      responsive: {
        0: { items: 1 },
        768: { items: 2 },
        992: { items: 2 },
        1200: { items: 2 }
      },
      autoplayHoverPause: true,
      mouseDrag: true
  });
});