/* PDP main preview: 3D card host (replaces static main image while active) */
.wc-pdp-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: grid;
  place-items: center;
}

.wc-pdp-mhost {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.wc-pdp-mhost .wc-root {
  filter: drop-shadow(0 10px 14px rgba(60, 40, 28, 0.22));
}

/* Middle thumb: fold-loop affordance (live foil animation slot) */
.wc-pdp-fold-thumb {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  background: transparent;
  z-index: 1;
}

.wc-pdp-fold-thumb .wc-play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  position: relative;
}

.wc-pdp-fold-thumb .wc-play::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #5e524d;
}

.wc-pdp-thost {
  position: relative;
  margin: 0;
  flex: none;
  filter: drop-shadow(0 2px 2px rgba(60, 40, 28, 0.22));
}

/* Next color paints here while the previous face stays visible underneath. */
.wc-face-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wc-pdp-media-active .main_image_div,
.wc-pdp-media-active .main_img,
.wc-pdp-media-active .dc_overlay {
  visibility: hidden !important;
  pointer-events: none;
}

.wc-pdp-media-active.container-main-img .container-sample-inner > img.main-img,
.wc-pdp-media-active .container-sample-inner > img.main-img {
  visibility: hidden !important;
  pointer-events: none;
}

.wc-pdp-media {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.wc-pdp-media-active.container-main-img,
.product-main-image .container-main-img.wc-pdp-media-active {
  position: relative;
}

#details_preview .main_image.wc-pdp-media-active {
  position: relative;
}

.wc-pdp-media-active .folded-overlay-class,
#details_preview.wc-pdp-media-active #folded-overlay,
#details_preview.wc-pdp-media-active .folded-overlay-class {
  visibility: hidden !important;
  pointer-events: none;
}

#details_preview.wc-pdp-media-active .zoom_img_parent {
  position: relative;
}

/* B-version sample box is one panel and overflow:hidden. The open spread is wider than that.
   A-version (no .extra-mips-preview) keeps .cardImg overflow:hidden so the animation stays in the old preview. */
#details-container.extra-mips-preview #scodix_img_first_inner.wc-pdp-media-active {
  overflow: visible !important;
}

/* No zoom dialog on window-card PDP — override preview_zoom_dialog.css zoom-in cursor */
#details_preview:not(.pdp-preview--static-active),
#details-container #scodix_img_first_inner {
  cursor: default;
}

/*
 * A-version (no_extra_MIPs) does not load product-preview.css, but
 * window-card-pdp-media.js still toggles pdp-preview--secondary-chrome.
 * Keep title (and lightning) on the first MIP only — same as B-version.
 */
#details_preview.pdp-preview--secondary-chrome .subtitling,
#details_preview.pdp-preview--secondary-chrome #lightning_wrapper {
  display: none !important;
}

#details_preview.wc-pdp-media-active #favorites_wrapper,
#details_preview.wc-pdp-media-active .new-pannel-fav {
  z-index: 130;
}

#details_preview .spinner-overlay {
  pointer-events: none;
}

/* Flat sample stays hidden until the closed 3D can paint. The overlay is the loading state. */
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) > .spinner-overlay {
  display: inline-block !important;
  opacity: 1;
  animation: none;
  z-index: 1001;
  background-color: #f9f7f4;
}

#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .pdp-preview__static,
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .main_image_div,
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .main_img,
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .dc_overlay,
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .folded-overlay-class,
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .wc-pdp-media,
#details_preview.wc-pdp-pending:not(.wc-pdp-ready) .wc-pdp-thost {
  visibility: hidden !important;
}

/* Window-card thumbs: loader until the 3D faces replace the flat sample. */
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .pdp-preview__thumbnail-media {
  background-image: url(//cdn.simplytoimpress.com/images/loadingwheel.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 42%;
}

.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .pdp-preview__thumbnail-image,
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .pdp-preview__thumbnail-overlay,
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .pdp-preview__thumbnail-picture,
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .pdp-overlay-picture,
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .wc-pdp-thost,
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .wc-pdp-fold-thumb {
  visibility: hidden !important;
}

.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced)::after,
.pdp-preview__thumbnail.wc-pdp-thumb-pending:not(.is-wc-replaced) .is-folded::after {
  content: none !important;
}

/* First three .pdp-preview__thumbnails, replaced with the 3D front / fold / inside.
 * WEB-132715 wraps samples in <picture>; is-ips-thumbnail uses display:block and still
 * occupies flex space after the img is hidden — hide the whole picture so .wc-pdp-thost centers. */
.pdp-preview__thumbnail.is-wc-replaced .pdp-preview__thumbnail-image,
.pdp-preview__thumbnail.is-wc-replaced .pdp-preview__thumbnail-overlay,
.pdp-preview__thumbnail.is-wc-replaced .pdp-preview__thumbnail-picture,
.pdp-preview__thumbnail.is-wc-replaced .pdp-overlay-picture {
  display: none !important;
}

.pdp-preview__thumbnail.is-wc-replaced .pdp-preview__thumbnail-media::after {
  content: none !important;
  background: none !important;
}

.pdp-preview__thumbnail.is-wc-replaced .wc-pdp-thost,
.pdp-preview__thumbnail.is-wc-replaced .wc-pdp-fold-thumb {
  pointer-events: none;
}

/* Pin the closed/open 3D host to the slot center regardless of leftover sample nodes. */
.pdp-preview__thumbnail.is-wc-replaced .wc-pdp-thost {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.pdp-preview__thumbnail.is-wc-replaced .wc-pdp-fold-thumb {
  position: absolute;
  inset: 0;
  min-height: 0;
  z-index: 1;
}

/* Shown when the page is not .extra-mips-preview (experiment 632 control). */
.wc-pdp-thumb-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 16px auto 12px;
  max-width: 100%;
  position: relative;
  z-index: 1001;
  pointer-events: auto;
}

.wc-pdp-thumb-slot {
  width: 104px;
  height: 104px;
  padding: 4px;
  border: 2px solid #dddddd;
  border-radius: 2px;
  background: #f3efea;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.wc-pdp-thumb-slot.selected {
  border-color: #54ba82;
}

.wc-pdp-thumb-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.wc-pdp-thumb-inner .wc-pdp-thost,
.wc-pdp-thumb-inner .wc-pdp-fold-thumb {
  pointer-events: none;
}

.wc-pdp-thumb-inner .wc-pdp-fold-thumb {
  position: absolute;
  inset: 0;
}

@media (max-width: 767px) {
  #details-container .wc-pdp-thumb-row {
    gap: 6px;
    margin: 30px auto 0;
  }

  #details-container .wc-pdp-thumb-slot {
    width: 68px;
    height: 68px;
    padding: 2px;
    border-width: 1px;
  }

  #details-container .wc-pdp-thumb-inner .wc-pdp-fold-thumb {
    min-height: 0;
  }

  #details-container .wc-pdp-fold-thumb .wc-play {
    width: 22px;
    height: 22px;
  }

  #details-container .wc-pdp-fold-thumb .wc-play::after {
    left: 9px;
    top: 6px;
    border-width: 5px 0 5px 8px;
  }
}
