/* ============================================================
   GAM PRODUCT SLIDER
   Blaze-compatible markup + native fallback
============================================================ */

.gam-product-slider {
  position: relative;
  display: block;
  visibility: visible;
  width: 100%;
  --slide-gap: var(--gam-slider-gap, 15px);
  --slides-to-show: 5;
}

.gam-product-slider .blaze-container,
.gam-product-slider .blaze-track-container {
  width: 100%;
}

.gam-product-slider .blaze-track-container {
  overflow: hidden;
  touch-action: pan-y;
}

.gam-product-slider .blaze-track {
  display: flex;
  align-items: stretch;
  gap: var(--slide-gap);
  margin: 0;
  padding: 0;
  will-change: transform;
}

.gam-product-slider .blaze-track > *,
.gam-product-slider-slide {
  flex: 0 0 auto;
  min-width: 0;
  box-sizing: border-box;
  width: calc(
    (100% - (var(--slides-to-show) - 1) * var(--slide-gap)) /
      var(--slides-to-show)
  );
}

.gam-product-slider-slide {
  display: flex;
  height: auto;
}

.gam-product-slider-slide .gam-product-card {
  width: 100%;
  height: 100%;
}

.gam-product-slider.is-dragging,
.gam-product-slider.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* Controls nằm trên góc phải, không dùng left: 92% */
.gam-product-slider-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 14px;
}

.gam-product-slider-prev,
.gam-product-slider-next {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.gam-product-slider-prev:hover,
.gam-product-slider-next:hover,
.gam-product-slider-prev:focus-visible,
.gam-product-slider-next:focus-visible {
  color: #07111f;
  background: linear-gradient(90deg, #39f34f 0%, #17c9cf 100%);
  transform: translateY(-1px);
}

.gam-product-slider-prev:disabled,
.gam-product-slider-next:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  transform: none;
}

.gam-product-slider-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.gam-product-slider-pagination button {
  width: 8px;
  height: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition:
    width 0.18s ease,
    background 0.18s ease;
}

.gam-product-slider-pagination button.is-active,
.gam-product-slider-pagination button.active {
  width: 24px;
  background: #39f34f;
}

/* Fallback static: không khởi tạo slider nhưng vẫn giữ một hàng cuộn ngang */
.gam-product-slider-static {
  display: flex;
  gap: var(--gam-card-gap, 15px);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.gam-product-slider-static > .gam-product-card {
  flex: 0 0 min(280px, 82vw);
  scroll-snap-align: start;
}

@media (max-width: 1024px) {
  .gam-product-slider {
    --slides-to-show: 3;
  }
}

@media (max-width: 767px) {
  .gam-product-slider {
    --slides-to-show: 2;
  }

  .gam-product-slider-controls {
    margin-bottom: 10px;
  }

  .gam-product-slider-prev,
  .gam-product-slider-next {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
}
