/**
 * Widget Studio – product image gallery (structural + token-driven)
 * Tokens from Helix variables.css (--ws-*, --color-*, --radius-*, --space-*).
 */
.ws-product-gallery {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ws-product-gallery__viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 0;
  background: none;
}

.ws-product-gallery__track {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.ws-product-gallery__live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.ws-product-gallery__slide {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-product-gallery__slide[hidden] {
  display: none !important;
}

.ws-product-gallery__slide .ws-product-image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block;
}

.ws-product-gallery__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 0.5rem);
  margin: 0;
  padding: 0 0.75rem;
  pointer-events: none;
}
.ws-product-gallery__controls > * { pointer-events: auto; }

.ws-product-gallery__btn {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-text-primary, #121212);
  backdrop-filter: blur(4px);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  line-height: 1;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast, 0.15s ease);
}

.ws-product-gallery__btn:hover {
  color: var(--color-cobalt, #0212EE) !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

.ws-product-gallery__btn:focus,
.ws-product-gallery__btn:active,
.ws-product-gallery__btn:focus:not(:focus-visible) {
  color: var(--color-text-primary, #121212) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  outline: none;
}

.ws-product-gallery__btn:focus-visible {
  color: var(--color-cobalt, #0212EE) !important;
  outline: 2px solid var(--color-cobalt, #0212EE);
  outline-offset: 2px;
}

.ws-product-gallery__dots {
  display: flex;
  gap: var(--space-1, 0.25rem);
  align-items: center;
}

.ws-product-gallery__dot {
  appearance: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full, 9999px);
  border: 0;
  padding: 0;
  background: var(--color-border-strong, #d1d1d1);
  cursor: pointer;
}

.ws-product-gallery__dot.is-active {
  background: var(--color-text-primary, #121212);
  transform: scale(1.2);
}

@media (prefers-reduced-motion: reduce) {
  .ws-product-gallery__btn {
    transition: none;
  }
}

/* Fit modes from Layout Builder Image & Gallery Setting */
.ws-product-image-frame,
.ws-product-gallery__viewport {
  width: 100%;
  border-radius: 0;
  background: none;
}
.ws-product-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-product-image,
.ws-product-gallery__slide .ws-product-image {
  border-radius: 0 !important;
}
.ws-gallery-fit-contain .ws-product-image,
.ws-gallery-fit-contain .ws-product-gallery__slide .ws-product-image,
.ws-gallery-fit-square .ws-product-image,
.ws-gallery-fit-natural .ws-product-image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background: none !important;
  background-image: none !important;
}
.ws-gallery-fit-cover .ws-product-gallery__viewport,
.ws-gallery-fit-cover.ws-product-image-frame {
  aspect-ratio: 4 / 3;
}
.ws-gallery-fit-cover .ws-product-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.ws-gallery-fit-height .ws-product-gallery__viewport,
.ws-gallery-fit-height.ws-product-image-frame {
  aspect-ratio: 3 / 4;
}
.ws-gallery-fit-height .ws-product-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top;
}
.ws-gallery-fit-wide .ws-product-gallery__viewport,
.ws-gallery-fit-wide.ws-product-image-frame {
  aspect-ratio: 16 / 9;
}
.ws-gallery-fit-wide .ws-product-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.ws-gallery-fit-square .ws-product-gallery__viewport,
.ws-gallery-fit-square.ws-product-image-frame {
  aspect-ratio: 1 / 1;
  background: none;
}
.ws-gallery-fit-square .ws-product-image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background: none !important;
}
.ws-gallery-fit-natural .ws-product-image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: none !important;
}
.ws-gallery-pos-top .ws-product-image { object-position: center top !important; }
.ws-gallery-pos-bottom .ws-product-image { object-position: center bottom !important; }
.ws-gallery-pos-left .ws-product-image { object-position: left center !important; }
.ws-gallery-pos-right .ws-product-image { object-position: right center !important; }
.ws-gallery-pos-center .ws-product-image { object-position: center center !important; }


/* Beat child-theme frame: radius lives on the column, not the img */
.ws-universal-layout .ws-image-left-split__image-column,
.ws-image-left-split__image-column,
.ws-product-gallery,
.ws-product-gallery__viewport,
.ws-product-image-frame {
  border-radius: 0 !important;
}
.ws-universal-layout .ws-image-left-split__image-column,
.ws-image-left-split__image-column {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.ws-product-gallery,
.ws-product-gallery__viewport,
.ws-product-gallery__track,
.ws-product-gallery__slide,
.ws-product-gallery__slide picture {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-product-gallery__slide[hidden] {
  display: none !important;
}
