var Wick = Wick || {};

Wick.PLPCardSwiper = {};

$(document).ready(function () {
    const SELECTORS = {
        kitchenCard: '.kitchen-card',
        swiperContainer: '.swiper-container-main',
        nextButton: '.kitchen-card__next-btn',
        prevButton: '.kitchen-card__prev-btn',
    };

    $(SELECTORS.kitchenCard).each(function (index, container) {
        const $container = $(container);
        const id = $container.data('id');

        const sliderElement = $container.find(SELECTORS.swiperContainer)[0];
        const nextButtonElement = $container.find(SELECTORS.nextButton)[0];
        const prevButtonElement = $container.find(SELECTORS.prevButton)[0];

        const swiper = new Swiper(sliderElement, {
            speed: 400,
            navigation: {
                nextEl: nextButtonElement,
                prevEl: prevButtonElement,
            },
            simulateTouch: false,
        });

        Wick.PLPCardSwiper[id] = swiper;
    });
});
