$(function() {
    var my_currency_symbol = '$';
    $(".filter-options-title").on('click', function() {
        $(this).parent().toggleClass('active');
        return false;
    });
});

$(document).ready(function() {
    $(".filter-close, body").on("click", function() {
        $("div.lst_con").removeClass("active");
        $("body").removeClass("open-filter");
    });

});

$(document).ready(function() {
    $(".filter_mob_btn").on("click", function() {
        $("body").toggleClass("open-filter");
    });
});

$('.slider-content').slick({
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: false,
    fade: false,
    infinite: false,
    speed: 1000,
    asNavFor: '.slider-thumb'
});
$('.slider-thumb').slick({
    slidesToShow: 4,
    slidesToScroll: 4,
    asNavFor: '.slider-content',
    arrows: true,
    dots: false,
    centerMode: false,
    focusOnSelect: true,
    prevArrow: '<div class="slick-prev"><svg class="svg_rightarrow" width="20px" height="20px" aria-hidden="true" role="img" fill="none"><use href="#svg_rightarrow" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg_rightarrow"></use></svg></div>',
    nextArrow: '<div class="slick-next"><svg class="svg_rightarrow" width="20px" height="20px" aria-hidden="true" role="img" fill="none"><use href="#svg_rightarrow" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg_rightarrow"></use></svg></div>'
});

/*Filter js*/
document.addEventListener("DOMContentLoaded", function() {
    var filterBtn = document.querySelector(".filter_mob_btn");
    var lstCon = document.querySelector(".lst_con");

    // Click event for the filter button
    filterBtn.addEventListener("click", function(event) {
        event.preventDefault();
        event.stopPropagation();
        lstCon.classList.toggle("active");
        filterBtn.classList.toggle("filter_mob_btn_active"); // Toggle the class
    });

    // Click event for the document to handle clicks outside the lst_con div
    document.addEventListener("click", function(event) {
        var targetElement = event.target;

        // Check if the click event occurred outside the lst_con div
        while (targetElement != null) {
            if (targetElement === lstCon) {
                // Click occurred inside the lst_con div, do nothing
                return;
            }
            targetElement = targetElement.parentElement;
        }

        // Click occurred outside the lst_con div, remove the "active" class
        lstCon.classList.remove("active");
        filterBtn.classList.remove("filter_mob_btn_active"); // Remove the class
    });
});