/* ==========================================================================
   Component: product-carousel  →  assets/component-product-carousel.css (behaviour: <snap-carousel>)
   Scroll-snapping row of product cards (4 per view at 1440, 4px gaps) with a
   400×2 progress bar underneath (Figma 1089-3125 / 1089-3210).
   ========================================================================== */
.product-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.product-carousel__track {
  display: flex;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.product-carousel__track::-webkit-scrollbar {
  display: none;
}

.product-carousel__track > * {
  flex: 0 0 calc((100% - 3 * 4px) / 4); /* 327px at the 1320px page width */
  scroll-snap-align: start;
}

/* 6px tall so the thumb is easy to grab, with the extra height pulled back out of
   the layout box so the bar still reads as the 2px rail Figma asks for. */
.product-carousel__progress {
  position: relative;
  width: 400px;
  max-width: 100%;
  height: 6px;
  margin-block: -2px;
  cursor: pointer;
}

.product-carousel__progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: var(--color-border-tertiary);
}

.product-carousel__progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 90px;
  height: 2px;
  margin-top: -1px;
  border-radius: 3px;
  background: var(--color-black);
  will-change: transform, width;
  transition: height 0.15s ease, margin-top 0.15s ease;
}

/* Thumb thickens on hover / while dragging, matching the card hover feel */
.product-carousel__progress:hover .product-carousel__progress-thumb,
.product-carousel__progress:active .product-carousel__progress-thumb {
  height: 6px;
  margin-top: -3px;
}

@media (prefers-reduced-motion: reduce) {
  .product-carousel__progress-thumb {
    transition: none;
  }
}

@media (max-width: 989px) {
  .product-carousel__track > * {
    flex-basis: calc((100% - 2 * 4px) / 3);
  }
}

@media (max-width: 749px) {
  .product-carousel__track > * {
    flex-basis: calc((100% - 4px) / 1.5);
  }

  .product-carousel {
    gap: 24px;
  }
}
