/* PhotoSwipe-inspired thumbnail-to-photograph motion, scoped to product galleries. */
dialog.ajll-dialog .ajll-dialog__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.ajpt-flight {
  position: fixed;
  z-index: 2147483640;
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  object-fit: fill;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

@keyframes ajpt-overlay-in {
  from { background-color: transparent; }
}
@keyframes ajpt-overlay-out {
  to { background-color: transparent; }
}
@keyframes ajpt-backdrop-in {
  from { background: transparent; }
  to { background: rgba(15, 7, 10, .84); }
}
@keyframes ajpt-backdrop-out {
  from { background: rgba(15, 7, 10, .84); }
  to { background: transparent; }
}
@keyframes ajpt-controls-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ajpt-controls-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.product-viewer-overlay.ajpt-opening,
dialog.ajll-dialog.ajpt-opening {
  animation: ajpt-overlay-in 360ms both;
}
.product-viewer-overlay.ajpt-closing,
dialog.ajll-dialog.ajpt-closing {
  animation: ajpt-overlay-out 320ms both;
}
dialog.ajll-dialog.ajpt-opening,
dialog.ajll-dialog.ajpt-closing {
  overflow: visible;
}
dialog.ajll-dialog.ajpt-opening::backdrop {
  animation: ajpt-backdrop-in 360ms both;
}
dialog.ajll-dialog.ajpt-closing::backdrop {
  animation: ajpt-backdrop-out 320ms both;
}
.ajpt-opening .product-viewer-dialog,
.ajpt-opening .ajll-dialog__shell {
  animation: ajpt-controls-in 360ms both;
}
.ajpt-closing .product-viewer-dialog,
.ajpt-closing .ajll-dialog__shell {
  animation: ajpt-controls-out 320ms both;
}

@media (prefers-reduced-motion: reduce) {
  .ajpt-flight,
  .product-viewer-overlay.ajpt-opening,
  .product-viewer-overlay.ajpt-closing,
  dialog.ajll-dialog.ajpt-opening,
  dialog.ajll-dialog.ajpt-closing,
  dialog.ajll-dialog.ajpt-opening::backdrop,
  dialog.ajll-dialog.ajpt-closing::backdrop,
  .ajpt-opening .product-viewer-dialog,
  .ajpt-opening .ajll-dialog__shell,
  .ajpt-closing .product-viewer-dialog,
  .ajpt-closing .ajll-dialog__shell {
    animation: none !important;
  }
}
