/* Scoped refinements for the Product Detail Gallery content block. */

.product-detail-gallery-content-block {
  --pdg-thumbnail-gap: 46px;
  --pdg-thumbnail-arrow-size: 44px;
  --pdg-thumbnail-icon-inset: 8px;
}

/*
 * AI badge positioning on the currently displayed main product image.
 */
.product-detail-gallery-content-block .product-detail-gallery-main {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto !important;

  --ai-label-top: auto;
  --ai-label-right: auto;
  --ai-label-bottom: 12px;
  --ai-label-left: 12px;

  --ai-label-top-mobile: auto;
  --ai-label-right-mobile: auto;
  --ai-label-bottom-mobile: 8px;
  --ai-label-left-mobile: 8px;
}

.product-detail-gallery-content-block .product-detail-gallery-main > .ai-image-label {
  z-index: 20;
}

/*
 * Product gallery AI badge inside the lightbox.
 *
 * The final lightbox position is overridden centrally in
 * ai-image-label.css.
 */
.content-image-lightbox .ai-image-label--product-gallery-lightbox {
  top: 12px !important;
  right: auto !important;
  bottom: auto !important;
  left: 12px !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-slider {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--pdg-thumbnail-arrow-size) !important;
  align-items: center;
  column-gap: var(--pdg-thumbnail-gap) !important;
  row-gap: 0 !important;
  width: 100%;
  margin: var(--pdg-thumbnail-gap) auto 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.product-detail-gallery-content-block .product-detail-thumbnail-slider:not(.has-overflow) {
  grid-template-columns: minmax(0, 1fr) !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-slider:not(.has-overflow) .product-detail-thumbnail-control--next {
  display: none !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-track {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--pdg-thumbnail-gap) * 2)) / 3);
  column-gap: var(--pdg-thumbnail-gap) !important;
  row-gap: 0 !important;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-track::-webkit-scrollbar {
  display: none;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  aspect-ratio: 1600 / 1067;
  line-height: 0;
  scroll-snap-align: start;
  background: #fff;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/*
 * AI indicator on thumbnails.
 *
 * Smaller than before and positioned bottom-right.
 */
.product-detail-gallery-content-block .product-detail-thumbnail-ai-icon {
  position: absolute;
  left: auto;
  right: 10px;
  bottom: 10px;
  z-index: 12;
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.88);
  background-image: url("../Icons/Icon_AI.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0.85;
  pointer-events: none;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-thumbnail-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom *,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-thumbnail-zoom * {
  outline: none !important;
  box-shadow: none !important;
}

/* Thumbnail zoom icons */
.product-detail-gallery-content-block .product-detail-thumbnail-link > .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link > .product-detail-thumbnail-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom.product-detail-gallery-zoom--thumbnail,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-thumbnail-zoom {
  position: absolute !important;
  top: var(--pdg-thumbnail-icon-inset) !important;
  left: var(--pdg-thumbnail-icon-inset) !important;
  right: auto !important;
  bottom: auto !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  translate: none !important;
  transform: none !important;
  transform-origin: center center !important;
  z-index: 10 !important;
  pointer-events: none !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link:hover > .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus > .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link:hover > .product-detail-thumbnail-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus > .product-detail-thumbnail-zoom {
  transform: scale(1.08) !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-control,
.product-detail-gallery-content-block .product-detail-thumbnail-arrow,
.product-detail-gallery-content-block .product-detail-thumbnail-arrow .hero-arrow-svg {
  width: var(--pdg-thumbnail-arrow-size) !important;
  height: var(--pdg-thumbnail-arrow-size) !important;
}

/*
 * Desktop:
 * The main product image is designed to be displayed at 560px width.
 * Keep the AI badge positioning container at exactly the same width.
 */
@media (min-width: 992px) {
  .product-detail-gallery-content-block .product-detail-gallery-main {
    width: 100% !important;
    max-width: 560px !important;
  }
}

@media (max-width: 1199.98px) {
  .product-detail-gallery-content-block {
    --pdg-thumbnail-gap: 32px;
    --pdg-thumbnail-arrow-size: 34px;
  }
}

@media (max-width: 991.98px) {
  .product-detail-gallery-content-block {
    --pdg-thumbnail-gap: 28px;
  }
}

/*
 * Between 768px and 991px the actual gallery link is limited to 500px.
 */
@media (min-width: 768px) and (max-width: 991.98px) {
  .product-detail-gallery-content-block .product-detail-gallery-main {
    width: 100% !important;
    max-width: 500px !important;
  }
}

@media (max-width: 767.98px) {
  .product-detail-gallery-content-block {
    --pdg-thumbnail-gap: 22px;
  }
}

@media (max-width: 575.98px) {
  .product-detail-gallery-content-block {
    --pdg-thumbnail-gap: 18px;
    --pdg-thumbnail-arrow-size: 32px;
  }

  .product-detail-gallery-content-block .product-detail-thumbnail-ai-icon {
    left: auto;
    right: 8px;
    bottom: 8px;
    width: 17px;
    height: 17px;
    background-size: 10px 10px;
    border-radius: 5px;
  }
}

@media (max-width: 479.98px) {
  .product-detail-gallery-content-block .product-detail-thumbnail-track {
    grid-auto-columns: calc((100% - var(--pdg-thumbnail-gap)) / 2);
  }
}

/* Mobile refinement */
@media (max-width: 575.98px) {
  .product-detail-gallery-content-block .product-detail-gallery-main {
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100%;
  }

  .product-detail-gallery-content-block .product-detail-gallery-link {
    width: 100% !important;
    max-width: 100% !important;
  }

  .product-detail-gallery-content-block .product-detail-thumbnail-track {
    grid-auto-columns: calc((100% - var(--pdg-thumbnail-gap)) / 2) !important;
  }

  .product-detail-gallery-content-block .product-detail-thumbnail-link > .product-detail-gallery-zoom,
  .product-detail-gallery-content-block .product-detail-thumbnail-link > .product-detail-thumbnail-zoom,
  .product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom.product-detail-gallery-zoom--thumbnail,
  .product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-thumbnail-zoom {
    top: var(--pdg-thumbnail-icon-inset) !important;
    left: var(--pdg-thumbnail-icon-inset) !important;
    right: auto !important;
    bottom: auto !important;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .product-detail-gallery-content-block .product-detail-gallery-main {
    width: 100% !important;
    max-width: none !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .product-detail-gallery-content-block .product-detail-gallery-link {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
  }

  .product-detail-gallery-content-block .product-detail-gallery-link img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }
}

.product-detail-gallery-content-block .product-detail-thumbnail-link {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 1600 / 1067 !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link img {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link > .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link > .product-detail-thumbnail-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom.product-detail-gallery-zoom--thumbnail,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-thumbnail-zoom {
  top: var(--pdg-thumbnail-icon-inset) !important;
  left: var(--pdg-thumbnail-icon-inset) !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible,
.product-detail-gallery-content-block .product-detail-thumbnail-link:active,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-thumbnail-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon-stack,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon,
.product-detail-gallery-content-block .product-detail-thumbnail-link svg {
  outline: 0 !important;
  box-shadow: none !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible .product-detail-gallery-zoom-icon--accent,
.product-detail-gallery-content-block .product-detail-thumbnail-link:active .product-detail-gallery-zoom-icon--accent,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible .product-detail-gallery-zoom-icon--hover,
.product-detail-gallery-content-block .product-detail-thumbnail-link:active .product-detail-gallery-zoom-icon--hover {
  opacity: 0 !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-thumbnail-link:active .product-detail-gallery-zoom-icon--default {
  opacity: 1 !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-thumbnail-link:active .product-detail-gallery-zoom {
  transform: none !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon--accent,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon--hover {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-thumbnail-link:hover .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-thumbnail-link:focus-visible .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-thumbnail-link:active .product-detail-gallery-zoom-icon--default {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom-icon-stack,
.product-detail-gallery-content-block .product-detail-thumbnail-link .product-detail-gallery-zoom {
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Main image active-state refinement */
.product-detail-gallery-content-block .product-detail-gallery-link .product-detail-gallery-zoom-icon--accent,
.product-detail-gallery-content-block .product-detail-gallery-link:active .product-detail-gallery-zoom-icon--accent,
.product-detail-gallery-content-block .product-detail-gallery-link:focus .product-detail-gallery-zoom-icon--accent,
.product-detail-gallery-content-block .product-detail-gallery-link:focus-visible .product-detail-gallery-zoom-icon--accent {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.product-detail-gallery-content-block .product-detail-gallery-link:active .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-gallery-link:focus .product-detail-gallery-zoom-icon--default,
.product-detail-gallery-content-block .product-detail-gallery-link:focus-visible .product-detail-gallery-zoom-icon--default {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.product-detail-gallery-content-block .product-detail-gallery-link:active .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-gallery-link:focus .product-detail-gallery-zoom,
.product-detail-gallery-content-block .product-detail-gallery-link:focus-visible .product-detail-gallery-zoom {
  outline: 0 !important;
  box-shadow: none !important;
}

/* Touch devices */
@media (hover: none), (pointer: coarse) {
  .product-detail-gallery-content-block .product-detail-gallery-zoom,
  .product-detail-gallery-content-block .product-detail-thumbnail-zoom {
    display: none !important;
  }
}

.product-detail-gallery-content-block .product-detail-gallery-link.is-updated img {
  animation: product-detail-gallery-main-image-update 180ms ease-out;
}

@keyframes product-detail-gallery-main-image-update {
  from {
    opacity: .82;
  }

  to {
    opacity: 1;
  }
}

/* Mobile product gallery */
@media (max-width: 767.98px), (hover: none), (pointer: coarse) {
  .product-detail-gallery-content-block .product-detail-gallery-main .product-detail-gallery-zoom {
    display: none !important;
  }
}