.product-image-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.gallery-dialog .product-image-frame > img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 75vh;
}

.product-image-copy {
  position: absolute;
  z-index: 1;
  inset: 0 auto auto 0;
  width: min(44px, 100%);
  height: min(44px, 100%);
  cursor: copy;
}

.product-image-copy:focus-visible {
  outline: 2px solid #a35800;
  outline-offset: -3px;
  border-radius: 6px;
}

.product-image-copy.is-copying::after {
  position: absolute;
  top: var(--copy-y);
  left: var(--copy-x);
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #a35800;
  content: '';
  pointer-events: none;
  animation: product-image-copy-pulse 420ms ease-out both;
}

.product-image-copy-status {
  position: absolute;
  z-index: 2;
  top: 46px;
  left: 4px;
  max-width: calc(100% - 8px);
  pointer-events: none;
}

.product-image-copy-status:not(:empty) {
  padding: 6px 10px;
  border-radius: 6px;
  background: #25221e;
  color: #fff;
  font: 600 13px/1.3 system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.product-image-copy-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@keyframes product-image-copy-pulse {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.5); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .product-image-copy.is-copying::after {
    animation: none;
    transform: translate(-50%, -50%);
  }
}
