document.addEventListener("DOMContentLoaded", () => {
  if (!archiveImagesData || !archiveImagesData.products) return;

  const slides = document.querySelectorAll("[data-sku]");

  slides.forEach(slide => {
    const sku = slide.dataset.sku;
    const productInfo = archiveImagesData.products[sku];

    if (productInfo && productInfo.img) {
      const img = slide.querySelector("img");

      if (img) {
        img.src = productInfo.img;
        img.srcset = productInfo.img;
        img.alt = sku;
      }
    }
  });
});
