.zestia-thermal-media {
  isolation: isolate;
  position: relative;
}

.zestia-thermal-media > :where(.product-image, .product-page__image) {
  position: relative;
  z-index: 1;
  transition: filter 420ms ease;
}

.zestia-thermal-media [data-zestia-thermal-canvas] {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

/* The effect itself is the temperature signal: no snowflake badge or
   decorative icon is rendered.  Cards opt in to controlled overflow so the
   cutout frost and real steam can cross the media frame. */
body.app-body.storefront-shell
  :where(.product-card--thermal-cold, .product-card--thermal-hot) {
  position: relative;
  z-index: 1;
  overflow: visible;
}

body.app-body.storefront-shell
  :where(.product-card--thermal-cold, .product-card--thermal-hot)
  > .product-card__media-link,
body.app-body.storefront-shell
  :where(.product-media--thermal-cold, .product-media--thermal-hot) {
  overflow: visible;
}

body.app-body.storefront-shell
  :where(.product-card--thermal-cold, .product-card--thermal-hot):is(
    :hover,
    :focus-within
  ) {
  z-index: 4;
}

body.app-body.storefront-shell .product-card--thermal-cold.has-cutout-media {
  margin-top: 0;
}

body.app-body.storefront-shell
  .product-card--thermal-cold.has-cutout-media
  .product-media--cutout {
  margin-top: 0;
}

body.app-body.storefront-shell
  .product-card--thermal-cold
  .zestia-thermal-media
  > .product-image,
body.app-body.storefront-shell
  .product-card--thermal-cold
  .zestia-thermal-media
  > [data-zestia-thermal-canvas] {
  transform: none;
}

body.app-body.storefront-shell
  .product-media--thermal-hot
  > .product-image {
  border-radius: inherit;
  clip-path: inset(0 round var(--zsf-card-radius, 16px));
}

.zestia-thermal-media[data-zestia-thermal-effect="HOT"],
.zestia-thermal-media[data-product-detail="true"][data-zestia-thermal-effect="HOT"] {
  overflow: visible;
}

.zestia-thermal-media[data-zestia-thermal-effect="COLD"]
  [data-zestia-thermal-canvas] {
  filter: drop-shadow(0 -10px 16px rgba(194, 246, 255, 0.2));
}

.zestia-thermal-media.is-thermal-active [data-zestia-thermal-canvas] {
  opacity: 1;
}

.zestia-thermal-media.is-thermal-active[data-zestia-thermal-effect="COLD"]
  > :where(.product-image, .product-page__image) {
  filter: saturate(0.92) contrast(1.04) brightness(1.02) hue-rotate(5deg);
}

.zestia-thermal-media.is-thermal-active[data-product-detail="true"][data-zestia-thermal-effect="COLD"]
  > .product-page__image {
  filter: saturate(0.8) contrast(1.09) brightness(1.045) hue-rotate(8deg);
}

.zestia-thermal-media[data-zestia-cutout="true"]
  > :where(.product-image, .product-page__image) {
  object-fit: contain;
  background: transparent;
}

.zestia-thermal-media.is-thermal-active[data-zestia-cutout="true"][data-zestia-thermal-effect="COLD"]
  > :where(.product-image, .product-page__image) {
  filter: saturate(0.98) contrast(1.035) brightness(1.015);
}

.zestia-thermal-media.is-thermal-active[data-product-detail="true"][data-zestia-thermal-effect="COLD"] {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.zestia-thermal-media.is-thermal-active[data-zestia-thermal-effect="HOT"]
  > :where(.product-image, .product-page__image) {
  filter: saturate(1.08) contrast(1.045) brightness(0.97) sepia(0.06);
}

@media (prefers-reduced-motion: reduce) {
  .zestia-thermal-media > :where(.product-image, .product-page__image),
  .zestia-thermal-media [data-zestia-thermal-canvas] {
    transition: none;
  }
}
