"use strict";

function sliderScroll(direction, target) {
    const section = target && target.closest("section");
    if (!section) {
        return;
    }
    const holder = section.querySelector(".slider-scroll");
    if (!holder) {
        return;
    }
    const amount = Math.max(260, Math.round(holder.clientWidth * 0.7));
    holder.scrollBy({
        left: direction === "next" ? -amount : amount,
        behavior: "smooth"
    });
}
