/*
  Featured products carousel (ps_featuredproducts)
  - Dependency-free
  - Uses scroll-snap for smooth native scrolling
  - Works well with PrestaShop classic (child_classic)
*/

.phx-featured {
  margin: 1.25rem 0;
}

.phx-featured__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.phx-featured__title {
  margin: 0;
}

.phx-featured__all {
  white-space: nowrap;
}

.phx-featured-carousel {
  position: relative;
}

.phx-featured-carousel__viewport {
  overflow: hidden;
  padding: 0.25rem 0;
}

.phx-featured-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(25% - 0.75rem);
  gap: 1rem;

  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.phx-featured-carousel__track::-webkit-scrollbar {
  display: none;
}

.phx-featured-carousel__slide {
  scroll-snap-align: start;
}

/* Make product miniature behave nicely in slides */
.phx-featured-carousel__slide .product-miniature {
  height: 100%;
}

.phx-featured-carousel__btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;

  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.95);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.phx-featured-carousel__btn:hover {
  background: #fff;
}

.phx-featured-carousel__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.phx-featured-carousel__btn--prev { left: -0.5rem; }
.phx-featured-carousel__btn--next { right: -0.5rem; }

.phx-featured-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.phx-featured-carousel__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
}

.phx-featured-carousel__dot.is-active {
  background: rgba(0,0,0,0.65);
}

/* Responsive breakpoints */
@media (max-width: 1199.98px) {
  .phx-featured-carousel__track { grid-auto-columns: calc(33.333% - 0.75rem); }
}

@media (max-width: 991.98px) {
  .phx-featured-carousel__track { grid-auto-columns: calc(50% - 0.75rem); }
  .phx-featured-carousel__btn--prev { left: -0.25rem; }
  .phx-featured-carousel__btn--next { right: -0.25rem; }
}

@media (max-width: 575.98px) {
  .phx-featured-carousel__track { grid-auto-columns: 80%; }
  .phx-featured-carousel__btn { display: none; } /* swipe on mobile */
}
