/* ZRM Product Carousel — CSS scroll-snap */

.zrm-product-carousel {
  position: relative;
  max-width: 100%;
  width: 100%;
  --carousel-visible: var(--carousel-visible-desktop, 3);
}

@media (max-width: 1024px) {
  .zrm-product-carousel {
    --carousel-visible: var(--carousel-visible-tablet, 2);
  }
}

@media (max-width: 768px) {
  .zrm-product-carousel {
    --carousel-visible: var(--carousel-visible-mobile, 1);
  }
}

/* Track: horizontal scroll with snap */
.zrm-product-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(
    (100% - (var(--carousel-visible, 3) - 1) * var(--carousel-gap, 24px)) /
    var(--carousel-visible, 3)
  );
  gap: var(--carousel-gap, 24px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

/* Card */
.zrm-product-carousel__card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Image container */
.zrm-product-carousel__image {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

.zrm-product-carousel__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zrm-product-carousel__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.02) 100%);
}

/* Text body */
.zrm-product-carousel__body {
  padding: 1.25rem 0.5rem 1rem;
}

.zrm-product-carousel__title {
  margin: 0 0 0.5rem;
  font-size: var(--card-title-font-size, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--card-title-color, inherit);
}

.zrm-product-carousel__desc {
  margin: 0;
  font-size: var(--card-desc-font-size, 0.875rem);
  line-height: 1.5;
  opacity: 0.85;
  color: var(--card-desc-color, inherit);
}

/* Navigation arrows */
.zrm-product-carousel__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 2;
  padding: 0;
}

.zrm-product-carousel__nav:hover {
  opacity: 1;
}

.zrm-product-carousel__nav--prev {
  left: -3rem;
}

.zrm-product-carousel__nav--next {
  right: -3rem;
}

/* When inside a constrained container, overlap arrows */
@media (max-width: 1200px) {
  .zrm-product-carousel__nav--prev {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9) 60%, transparent);
  }
  .zrm-product-carousel__nav--next {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9) 60%, transparent);
  }
}

/* Hide arrows when all cards fit in view (no scroll needed) */
.zrm-product-carousel--no-scroll .zrm-product-carousel__nav {
  display: none;
}
