/* Product image carousel — full kit gallery + refill stars/tokens */

.store-product-carousel,
.refill-product-carousel {
  width: 100%;
}

.store-product-carousel__frame,
.refill-product-carousel__frame {
  position: relative;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  margin-bottom: 0.5rem;
}

.store-product-carousel__viewport,
.refill-product-carousel__viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 200px;
  max-height: 420px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  background: transparent;
}

.store-product-carousel__slide,
.refill-product-carousel__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  pointer-events: none;
  padding-inline: 2rem;
}

.store-product-carousel__slide.is-active,
.refill-product-carousel__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  pointer-events: auto;
}

.store-product-carousel__slide img,
.refill-product-carousel__slide img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
  padding: 0;
  background: transparent;
}

.store-product-carousel__nav,
.refill-product-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(201, 162, 57, 0.22);
  border-radius: 50%;
  background: rgba(255, 248, 236, 0.82);
  color: rgba(92, 79, 66, 0.75);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(44, 38, 32, 0.06);
  opacity: 0.88;
  transition:
    opacity 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.store-product-carousel__nav span,
.refill-product-carousel__nav span {
  display: block;
  margin-top: -2px;
}

.store-product-carousel__nav:hover,
.refill-product-carousel__nav:hover {
  opacity: 1;
  background: rgba(255, 252, 248, 0.96);
  color: #5c4f42;
  border-color: rgba(201, 162, 57, 0.35);
}

.store-product-carousel__nav:active,
.refill-product-carousel__nav:active {
  transform: translateY(-50%) scale(0.96);
}

.store-product-carousel__nav--prev,
.refill-product-carousel__nav--prev {
  inset-inline-end: 2px;
}

.store-product-carousel__nav--next,
.refill-product-carousel__nav--next {
  inset-inline-start: 2px;
}

/* Corner tags live on .card-image / .product-main-image — not stretched by flex frame */
.store-product-carousel__frame .badge,
.refill-product-carousel__frame .badge {
  top: 8px;
  inset-inline-start: 8px;
  inset-inline-end: auto;
}

.refill-product-carousel--card .refill-product-carousel__frame {
  position: relative;
}

.refill-product-carousel--card .refill-product-carousel__frame .badge,
.refill-product-carousel--card .refill-product-carousel__frame .refill-badge {
  top: 12px;
  inset-inline-start: 12px;
  inset-inline-end: auto;
  width: max-content;
  max-width: max-content;
}

.store-product-carousel__caption,
.refill-product-carousel__caption {
  margin: 0.35rem 0 0.55rem;
  padding-bottom: 0.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted, #6b5e54);
  text-align: center;
  min-height: 1.35em;
  line-height: 1.45;
  position: relative;
  z-index: 2;
}

.store-product-carousel__dots,
.refill-product-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.35rem 0 0.85rem;
  position: relative;
  z-index: 2;
}

.store-product-carousel__dots button,
.refill-product-carousel__dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(58, 52, 44, 0.2);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.store-product-carousel__dots button.is-active,
.refill-product-carousel__dots button.is-active {
  background: var(--primary, #3a342c);
  transform: scale(1.15);
}

.store-product-carousel__dots button:focus-visible,
.refill-product-carousel__dots button:focus-visible {
  outline: 2px solid rgba(58, 52, 44, 0.45);
  outline-offset: 2px;
}

/* Full-kit product page — taller viewport for mixed aspect ratios */
.store-product-carousel--product .store-product-carousel__viewport {
  aspect-ratio: 1;
  min-height: 280px;
  max-height: min(650px, 72vh);
}

.store-product-carousel--product .store-product-carousel__slide {
  padding-inline: 2.25rem;
}

.store-product-carousel--product .product-main-image {
  margin-bottom: 0;
}

.store-product-carousel--product .store-product-carousel__frame .badge {
  top: 1rem;
  inset-inline-start: 1rem;
  inset-inline-end: auto;
  z-index: 4;
}

/* Store index card — compact */
.store-product-carousel--card .store-product-carousel__frame,
.refill-product-carousel--card .refill-product-carousel__frame {
  margin-bottom: 0;
}

.store-product-carousel--card .store-product-carousel__viewport,
.refill-product-carousel--card .refill-product-carousel__viewport {
  min-height: 120px;
  max-height: none;
  aspect-ratio: 1;
}

.store-product-carousel--card .store-product-carousel__slide,
.refill-product-carousel--card .refill-product-carousel__slide {
  padding-inline: 1.65rem;
}

.store-product-carousel--card .store-product-carousel__slide img,
.refill-product-carousel--card .refill-product-carousel__slide img {
  max-height: 100%;
}

.store-product-carousel--card .store-product-carousel__nav,
.refill-product-carousel--card .refill-product-carousel__nav {
  width: 24px;
  height: 24px;
  font-size: 0.9rem;
}

.store-product-carousel--card .store-product-carousel__nav--prev,
.refill-product-carousel--card .refill-product-carousel__nav--prev {
  inset-inline-end: 0;
}

.store-product-carousel--card .store-product-carousel__nav--next,
.refill-product-carousel--card .refill-product-carousel__nav--next {
  inset-inline-start: 0;
}

/* Store index cards — no slide caption below image (title is in card-body) */
.store-product-carousel--card .store-product-carousel__caption,
.refill-product-carousel--card .refill-product-carousel__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.card-image--carousel-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}

.card-image--carousel-wrap > .badge,
.card-image--carousel-wrap > .refill-badge {
  top: 12px;
  inset-inline-start: 12px;
  inset-inline-end: auto;
  z-index: 7;
}

.card-image--carousel-wrap .refill-product-carousel,
.card-image--carousel-wrap .store-product-carousel {
  position: relative;
  height: 100%;
  width: 100%;
}

.card-image--carousel-wrap .store-product-carousel__frame,
.card-image--carousel-wrap .refill-product-carousel__frame {
  height: 100%;
  display: block;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
}

.card-image--carousel-wrap .store-product-carousel__viewport,
.card-image--carousel-wrap .refill-product-carousel__viewport {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  min-height: 0;
  max-height: none;
}

/* Pagination dots — inside image area, not in card-body */
.card-image--carousel-wrap .store-product-carousel__dots,
.card-image--carousel-wrap .refill-product-carousel__dots {
  position: absolute;
  bottom: 0.65rem;
  inset-inline: 0;
  z-index: 6;
  margin: 0;
  padding: 0.35rem 0;
  pointer-events: auto;
}

.card-image--carousel-wrap .store-product-carousel__dots button,
.card-image--carousel-wrap .refill-product-carousel__dots button {
  box-shadow: 0 0 0 1px rgba(255, 253, 249, 0.85);
}

@media (max-width: 900px) {
  .store-product-carousel__viewport,
  .refill-product-carousel__viewport {
    min-height: 180px;
    max-height: 360px;
  }

  .store-product-carousel__slide,
  .refill-product-carousel__slide {
    padding-inline: 1.75rem;
  }

}

@media (max-width: 960px) {
  .product-page .store-product-carousel--product .store-product-carousel__viewport {
    min-height: 220px;
    max-height: min(520px, 62vh);
  }

  .product-page .refill-product-carousel__viewport {
    min-height: 200px;
    max-height: min(480px, 58vh);
  }

  .product-page .store-product-carousel__caption,
  .product-page .refill-product-carousel__caption {
    margin-top: 0.15rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
  }

  .product-page .store-product-carousel__dots,
  .product-page .refill-product-carousel__dots {
    padding-bottom: 1.5rem;
    margin-bottom: 0.75rem;
  }

  .product-page .store-product-carousel--product .store-product-carousel__frame,
  .product-page .refill-product-carousel__frame {
    margin-bottom: 0.15rem;
  }
}

@media (max-width: 768px) {
  .product-page .store-product-carousel--product .store-product-carousel__viewport {
    max-height: min(72vh, 560px);
    min-height: 200px;
  }

  .product-page .store-product-carousel--product .store-product-carousel__slide img {
    max-height: none;
    width: 100%;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-product-carousel__slide,
  .refill-product-carousel__slide {
    transition: none;
  }
}
