/* STI PLP / YMAL / favorites — listing <img> is the side3,0 composite. Closed 3D
   hydrates on top; hover lifts it out and opens. Sample bitmap stays for face URLs. */

@media (prefers-reduced-motion: reduce) {
  .category_thumb.wc-enhanced .wc-host,
  .widget_thumb.wc-enhanced .wc-host,
  .favorite_thumb.wc-enhanced .wc-host,
  .category_thumb.wc-enhanced .shadow-overlay-container,
  .widget_thumb.wc-enhanced .shadow-overlay-container,
  .favorite_thumb.wc-enhanced .shadow-overlay-container,
  .category_thumb.wc-enhanced .folded-overlay,
  .widget_thumb.wc-enhanced .folded-overlay,
  .favorite_thumb.wc-enhanced .folded-overlay,
  .category_thumb.wc-enhanced .folded-overlay-portrait,
  .widget_thumb.wc-enhanced .folded-overlay-portrait,
  .favorite_thumb.wc-enhanced .folded-overlay-portrait,
  .category_thumb.wc-enhanced .folded-overlay-image,
  .widget_thumb.wc-enhanced .folded-overlay-image,
  .favorite_thumb.wc-enhanced .folded-overlay-image,
  .category_thumb.wc-enhanced .folded-overlay-image-portrait,
  .widget_thumb.wc-enhanced .folded-overlay-image-portrait,
  .favorite_thumb.wc-enhanced .folded-overlay-image-portrait,
  .category_thumb.wc-enhanced .stackable-image-container img.base-image,
  .widget_thumb.wc-enhanced .stackable-image-container img.base-image,
  .favorite_thumb.wc-enhanced .stackable-image-container img.base-image {
    transition: none !important;
  }
}

.category_thumb.wc-enhanced .wc-host,
.widget_thumb.wc-enhanced .wc-host,
.favorite_thumb.wc-enhanced .wc-host {
  position: absolute;
  z-index: 1;
  transform-origin: 50% 50%;
  margin: 0;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  /* Linear handoff: the fold starts at this same constant speed, without easing in. */
  transition:
    transform 0.2s linear,
    filter 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

/* .wc-lift starts after the skew/shadow handoff, so the card does not pop out of the frame. */
.category_thumb.wc-enhanced.wc-lift .wc-host,
.widget_thumb.wc-enhanced.wc-lift .wc-host,
.favorite_thumb.wc-enhanced.wc-lift .wc-host {
  z-index: 4;
  pointer-events: auto;
  filter: drop-shadow(0 6px 6px rgba(60, 40, 28, 0.3));
}

/* Open spread paints over the listing bar (z-index 1). Keep favorite / quickview clickable. */
.category_thumb.wc-enhanced.wc-lift .quickview,
.widget_thumb.wc-enhanced.wc-lift .quickview,
.favorite_thumb.wc-enhanced.wc-lift .quickview {
  z-index: 5;
}

/* Listing cover can be wc-ready before 3D mounts. Hide the empty host until then. */
.category_thumb[data-window-card="1"]:not(.wc-enhanced) .wc-host,
.widget_thumb[data-window-card="1"]:not(.wc-enhanced) .wc-host,
.favorite_thumb[data-window-card="1"]:not(.wc-enhanced) .wc-host {
  position: absolute;
  opacity: 0;
}

.category_thumb[data-wc-die-cut]:not(.wc-ready) .stackable-image-container > img.base-image,
.category_thumb[data-wc-die-cut]:not(.wc-ready) .shadow-overlay-container {
  visibility: hidden !important;
}

.category_thumb[data-wc-die-cut]:not(.wc-ready) .loading-thumb {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  opacity: 1;
  animation: none;
  background-color: #F3EFEA;
}

/* YMAL / favorites: hold listing until closed 3D is ready (composite box is wrong there). */
.widget_thumb[data-window-card="1"]:not(.wc-ready) .stackable-image-container > img.base-image,
.widget_thumb[data-window-card="1"]:not(.wc-ready) .shadow-overlay-container {
  visibility: hidden !important;
}
.widget_thumb[data-window-card="1"]:not(.wc-ready) .thumb_img_wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background-color: #F3EFEA;
  background-image: url(//cdn.simplytoimpress.com/images/loadingwheel.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28%;
}

/* Keep the bitmap for cover URLs; the closed 3D card is the listing art. */
.category_thumb.wc-enhanced .stackable-image-container img.base-image,
.widget_thumb.wc-enhanced .stackable-image-container img.base-image,
.favorite_thumb.wc-enhanced .stackable-image-container img.base-image {
  opacity: 0 !important;
  visibility: hidden;
}

/* Scale only at rest. Cropbleed + punchedFaces fills the host with trim (no SVG
   inset); 1.03 tucked too much art under the folded frame. .wc-open clears this. */
.category_thumb.wc-enhanced .thumb_img_wrapper.folded.vertical_dc .wc-host,
.widget_thumb.wc-enhanced .thumb_img_wrapper.folded.vertical_dc .wc-host,
.favorite_thumb.wc-enhanced .thumb_img_wrapper.folded.vertical_dc .wc-host {
  transform: skewY(2.2deg) scale(1);
}

.category_thumb.wc-enhanced .thumb_img_wrapper.folded.horizontal_dc .wc-host,
.widget_thumb.wc-enhanced .thumb_img_wrapper.folded.horizontal_dc .wc-host,
.favorite_thumb.wc-enhanced .thumb_img_wrapper.folded.horizontal_dc .wc-host {
  transform: skewX(-2.8deg) scale(1);
}

.category_thumb.wc-enhanced .shadow-overlay-container,
.widget_thumb.wc-enhanced .shadow-overlay-container,
.favorite_thumb.wc-enhanced .shadow-overlay-container,
.category_thumb.wc-enhanced .folded-overlay,
.widget_thumb.wc-enhanced .folded-overlay,
.favorite_thumb.wc-enhanced .folded-overlay,
.category_thumb.wc-enhanced .folded-overlay-portrait,
.widget_thumb.wc-enhanced .folded-overlay-portrait,
.favorite_thumb.wc-enhanced .folded-overlay-portrait,
.category_thumb.wc-enhanced .folded-overlay-image,
.widget_thumb.wc-enhanced .folded-overlay-image,
.favorite_thumb.wc-enhanced .folded-overlay-image,
.category_thumb.wc-enhanced .folded-overlay-image-portrait,
.widget_thumb.wc-enhanced .folded-overlay-image-portrait,
.favorite_thumb.wc-enhanced .folded-overlay-image-portrait {
  z-index: 2;
  transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

.category_thumb.wc-enhanced.wc-open .thumb_img_wrapper.folded.vertical_dc .wc-host,
.widget_thumb.wc-enhanced.wc-open .thumb_img_wrapper.folded.vertical_dc .wc-host,
.favorite_thumb.wc-enhanced.wc-open .thumb_img_wrapper.folded.vertical_dc .wc-host,
.category_thumb.wc-enhanced.wc-open .thumb_img_wrapper.folded.horizontal_dc .wc-host,
.widget_thumb.wc-enhanced.wc-open .thumb_img_wrapper.folded.horizontal_dc .wc-host,
.favorite_thumb.wc-enhanced.wc-open .thumb_img_wrapper.folded.horizontal_dc .wc-host {
  transform: none;
}

.category_thumb.wc-enhanced.wc-open .shadow-overlay-container,
.widget_thumb.wc-enhanced.wc-open .shadow-overlay-container,
.favorite_thumb.wc-enhanced.wc-open .shadow-overlay-container,
.category_thumb.wc-enhanced.wc-open .folded-overlay,
.widget_thumb.wc-enhanced.wc-open .folded-overlay,
.favorite_thumb.wc-enhanced.wc-open .folded-overlay,
.category_thumb.wc-enhanced.wc-open .folded-overlay-portrait,
.widget_thumb.wc-enhanced.wc-open .folded-overlay-portrait,
.favorite_thumb.wc-enhanced.wc-open .folded-overlay-portrait,
.category_thumb.wc-enhanced.wc-open .folded-overlay-image,
.widget_thumb.wc-enhanced.wc-open .folded-overlay-image,
.favorite_thumb.wc-enhanced.wc-open .folded-overlay-image,
.category_thumb.wc-enhanced.wc-open .folded-overlay-image-portrait,
.widget_thumb.wc-enhanced.wc-open .folded-overlay-image-portrait,
.favorite_thumb.wc-enhanced.wc-open .folded-overlay-image-portrait {
  opacity: 0;
}

/* Favorites WC tile: fill fav_thumb_wrapper before/after enhance. */
#favorites_thumb_wrapper .favorite_thumb.card .fav_thumb_wrapper.thumb_wrapper {
  position: relative;
  overflow: hidden;
}
#favorites_thumb_wrapper .favorite_thumb.card .thumb_img_wrapper,
#favorites_thumb_wrapper .favorite_thumb.card .thumb_img_wrapper > a,
#favorites_thumb_wrapper .favorite_thumb.card .stackable-image-container {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

/* Same frame box as PLP shadow-overlay thumbs. YMAL/favorites are not inside #category_thumb_wrapper. */
.widget_thumb.wc-enhanced .thumb_img_wrapper,
.widget_thumb.wc-enhanced .thumb_img_wrapper > a,
.widget_thumb.wc-enhanced .stackable-image-container,
.favorite_thumb.wc-enhanced .thumb_img_wrapper,
.favorite_thumb.wc-enhanced .thumb_img_wrapper > a,
.favorite_thumb.wc-enhanced .stackable-image-container {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.widget_thumb.wc-enhanced .stackable-image-container .shadow-overlay-container,
.favorite_thumb.wc-enhanced .stackable-image-container .shadow-overlay-container {
  position: absolute;
  inset: 0;
  margin: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Favorites sizes every div under .fav_thumb_wrapper (230px / 185px .vertical_dc).
   That stretches each 3D face to the thumb box and clips full-bleed cards. */
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .fav_thumb_wrapper {
  position: relative;
}
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .fav_thumb_wrapper .thumb_img_wrapper,
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .fav_thumb_wrapper .thumb_img_wrapper > a,
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .stackable-image-container,
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .shadow-overlay-container {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
}
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card img.base-image {
  margin: 0 !important;
  transform: none;
}

/* Favorites has no PLP spinner. Hold the flat sample until the closed card is sized. */
.favorite_thumb[data-window-card="1"] .loading-thumb {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  margin: 0;
  pointer-events: none;
  background-color: #F3EFEA;
  background-image: url(//cdn.simplytoimpress.com/images/loadingwheel.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28%;
  opacity: 0;
}
.favorite_thumb[data-window-card="1"]:not(.wc-ready) .loading-thumb {
  opacity: 1;
  animation: none;
}
.favorite_thumb[data-window-card="1"]:not(.wc-ready) .stackable-image-container > img.base-image,
.favorite_thumb[data-window-card="1"]:not(.wc-ready) .shadow-overlay-container {
  visibility: hidden !important;
}

/* Closed 3D pose uses transform + z-index, so it paints over the corner badge
   (badge is an earlier sibling with z-index:auto). Trap the pose in the thumb. */
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .fav_thumb_wrapper > .thumb_img_wrapper {
  z-index: 1;
  isolation: isolate;
}
.favorites_page #favorites_thumb_wrapper .favorite_thumb.card .fav_thumb_wrapper > .indicator {
  position: absolute;
  z-index: 5;
}

/* Listing Framed Photo badge: favorites top-right; YMAL top-left (not .real_foil). */
.favorite_thumb .real_foil.window_card_badge {
  width: 156px;
  height: auto;
  z-index: 7;
}
.widget_thumb .window_card_tag,
.reco_img .window_card_tag {
  width: 100px;
  height: 23px;
  background: url(https://cdn.simplytoimpress.com/images/icons/window_card/framed_photo_badge1.svg) center no-repeat;
  background-size: 100% auto;
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  pointer-events: none;
}
.reco_img {
  position: relative;
}
