.block-product-image__layer-wrapper {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

@layer theme {
  .block-product-image__layer-wrapper * {
    pointer-events: auto;
  }
}

.block-product-image__layer-image-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  padding: var(--padding);
  overflow: hidden;
}

.block-product-image__layer-image-wrapper > a {
  position: absolute;
  inset: 0;
  display: block;
}

.block-product-image__image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--aspect-ratio);
  overflow: hidden;
  pointer-events: none;
  background-color: rgb(243 243 243 / 100%);
  border-radius: var(--border-radius);
}

@layer theme {
  .block-product-image__image-wrapper * {
    pointer-events: auto;
  }
}

.block-product-image__image-wrapper > svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.block-product-image__image-wrapper > .block-product-image__image {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: var(--fit-type);
  opacity: 0;
  transition: opacity 400ms;
}

.block-product-image__image-wrapper > .block-product-image__image * {
  pointer-events: all;
}

.block-product-image__image-wrapper > .block-product-image__image.is-active {
  opacity: 1;
}

.block-product-image__indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 1;
  width: calc(100% - 16px);
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translateX(-50%);
  pointer-events: none;
}

.block-product-image__indicator.is-visible,
.block-product-image__layer-image-wrapper:hover .block-product-image__indicator,
.block-product-image__layer-image-wrapper.hover .block-product-image__indicator {
  opacity: 1;
}

@media (max-width: 959px) {
  /* Always show the slide indicator on mobile — touch has no hover state,
     so the dots are the only affordance that more images exist. */
  .block-product-image__indicator {
    bottom: 10px;
    opacity: 1;
  }
}

/* dot indicator styles (inline to avoid CDN path dependency) */
.block-product-image__indicator--dot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 10px;
}

.block-product-image__indicator--dot .theme-carousel-indicator__dot-item-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
}

.block-product-image__indicator--dot .theme-carousel-indicator__dot-item {
  width: 6px;
  height: 6px;
  background-color: rgba(255 255 255 / 60%);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0 0 0 / 40%);
  transition: 0.3s ease-in-out;
}

.block-product-image__indicator--dot .theme-carousel-indicator__dot-item.is-active {
  width: 10px;
  height: 10px;
  background-color: rgb(255 255 255 / 100%);
}

@media (max-width: 959px) {
  /* Tighter gap on mobile to match the smaller dot sizes below. */
  .block-product-image__indicator--dot {
    gap: 5px;
  }

  /* Smaller dots on mobile — sized down to fit the smaller card thumbnail,
     keeping a proportionate ~1.6x active/inactive scale. */
  .block-product-image__indicator--dot .theme-carousel-indicator__dot-item {
    width: 5px;
    height: 5px;
  }

  .block-product-image__indicator--dot .theme-carousel-indicator__dot-item.is-active {
    width: 8px;
    height: 8px;
  }
}

/* progress indicator styles */
.block-product-image__indicator--progress {
  height: 3px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0 0 0 / 40%);
}

.block-product-image__indicator--progress::before {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: calc(calc(var(--current-index) + 1) / var(--indicator-size) * 100%);
  height: 100%;
  content: "";
  background-color: rgb(255 255 255 / 100%);
  border-radius: 3px;
  transition: 0.3s ease-in-out;
}

.block-product-image__indicator--progress::after {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 100%;
  content: "";
  background-color: rgba(255 255 255 / 40%);
  border-radius: 3px;
}

/* slider-bar indicator styles */
.block-product-image__indicator--capsule {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

.block-product-image__indicator--capsule .theme-carousel-indicator__capsule-item {
  flex: 1 0 0;
  max-width: 30px;
  height: 3px;
  background-color: rgba(255 255 255 / 40%);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0 0 0 / 40%);
  transition: 0.3s ease-in-out;
}

.block-product-image__indicator--capsule .theme-carousel-indicator__capsule-item.is-active {
  background-color: rgb(255 255 255 / 100%);
}

.block-product-image__hover-zones {
  position: absolute;
  inset: 0;
  display: flex;
}

.block-product-image__hover-zone {
  flex: 1 0 0;
  height: 100%;
}
