/* =========================================================
   SLIDER.CSS — CLEAN
   Product card sliders / gallery controls / GPU transitions
========================================================= */

/* =========================================================
   PRODUCT CARD SLIDER — STAGE
========================================================= */

.product-card-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  contain: layout paint;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.product-card-track {
  display: flex;
  width: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.product-card-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.product-card-image {
  display: block;
  width: 100%;
  height: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  user-select: none;
  -webkit-user-drag: none;
}

/* Optimisation : will-change seulement en interaction */
.product-card:hover .product-card-track,
.product-card:focus-within .product-card-track {
  will-change: transform;
}

.product-card:not(:hover):not(:focus-within) .product-card-track {
  will-change: auto;
}

/* =========================================================
   PRODUCT CARD SLIDER — ARROWS
========================================================= */

.product-card-prev,
.product-card-next {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 20;

  display: flex;
  align-items: center;

  width: 22%;
  margin: 0;
  padding: 0;

  border: 0;
  background: transparent;

  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.product-card-prev {
  left: 0;
  justify-content: flex-start;
}

.product-card-next {
  right: 0;
  justify-content: flex-end;
}

.product-card-prev::before,
.product-card-next::before {
  content: "";
  display: block;

  width: 0.5rem;
  height: 0.5rem;

  border-top: 1px solid var(--black, #000);
  border-right: 1px solid var(--black, #000);

  pointer-events: none;
}

.product-card-prev::before {
  margin-left: 1rem;
  transform: rotate(-135deg);
}

.product-card-next::before {
  margin-right: 1rem;
  transform: rotate(45deg);
}

.product-card-prev:focus,
.product-card-next:focus,
.product-card-prev:focus-visible,
.product-card-next:focus-visible {
  outline: none;
}

.product-card-prev.is-disabled,
.product-card-next.is-disabled,
.product-card.is-single-image .product-card-prev,
.product-card.is-single-image .product-card-next,
.w-dyn-item.is-single-image .product-card-prev,
.w-dyn-item.is-single-image .product-card-next {
  display: none !important;
}

/* =========================================================
   LEGACY PRODUCT NAV SUPPORT
   À garder si certaines cartes utilisent encore .product-nav
========================================================= */

.product-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 30;

  width: 26%;
  margin: 0;
  padding: 0;

  border: 0;
  background: transparent;

  opacity: 0;
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  transition: opacity 220ms ease;
}

.product-media:hover .product-nav {
  opacity: 1;
}

.product-nav-prev {
  left: 0;
}

.product-nav-next {
  right: 0;
}

.product-nav::before {
  content: "";
  position: absolute;
  top: 50%;

  width: 10px;
  height: 10px;

  opacity: 0;
  pointer-events: none;

  transition: opacity 220ms ease;
}

.product-media:hover .product-nav::before {
  opacity: 0.85;
}

.product-nav-prev::before {
  left: 14px;
  border-left: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.product-nav-next::before {
  right: 14px;
  border-right: 1.4px solid currentColor;
  border-top: 1.4px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.product-nav:focus,
.product-nav:focus-visible {
  outline: none;
}

.product-card.is-single-image .product-nav,
.w-dyn-item.is-single-image .product-nav {
  display: none !important;
}

@media (hover: none) {
  .product-nav,
  .product-nav::before {
    opacity: 0.65;
  }
}

/* =========================================================
   PRODUCT CARD PROGRESS — LEGACY SUPPORT
========================================================= */

.product-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3rem;
  z-index: 35;

  display: flex;
  gap: 0.4rem;

  padding: 0.5rem;

  pointer-events: none;
}

.product-progress-segment {
  position: relative;
  flex: 1 1 0;

  height: 1px;

  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.product-progress-segment-bar {
  display: block;
  width: 0%;
  height: 100%;

  background: var(--black, #000);

  transition: width 300ms ease;
}

.product-card.is-single-image .product-progress,
.w-dyn-item.is-single-image .product-progress {
  display: none !important;
}

/* =========================================================
   HIDDEN SOURCE IMAGES
========================================================= */

.product-more-images {
  position: absolute !important;

  width: 0 !important;
  height: 0 !important;

  overflow: hidden !important;

  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .product-card-track {
    transition: none !important;
  }

  .product-progress-segment-bar {
    transition: none !important;
  }
}

/* =========================================================
   SLIDER — MOBILE ARROWS OFFSET
========================================================= */

@media screen and (max-width: 767px) {
  .product-gallery-prev::before,
  .home-focus-prev::before {
    margin-left: 0.5rem !important;
  }

  .product-gallery-next::before,
  .home-focus-next::before {
    margin-right: 0.5rem !important;
  }
}
