.inventory-photo:has(> img) {
  position: relative;
}

.inventory-photo:has(> img) > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
}

.inventory-hero:has(> .inventory-photo-main),
.inventory-mobile .inventory-hero:has(> .inventory-photo-main) {
  grid-template-columns: minmax(0, clamp(9rem, 25vw, 20rem)) minmax(0, 1fr);
}

.inventory-hero > .inventory-photo-main {
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  cursor: zoom-in;
}

.inventory-photo-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.product-photo-preview {
  position: fixed;
  z-index: 90;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 36px #101b2552;
  overflow: hidden;
}

.product-photo-preview img,
.product-photo-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-photo-dialog {
  width: min(94vw, 78rem);
  max-width: none;
  max-height: 94dvh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  overflow: auto;
}

.product-photo-dialog::backdrop {
  background: #131818b8;
}

.product-photo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.product-photo-header h2 {
  margin: 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.product-photo-header button {
  flex: none;
}

.product-photo-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: min(74dvh, 60rem);
  background: #fff;
  color: #202924;
}

.product-photo-stage img[hidden],
.inventory-photo-placeholder[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .inventory-hero:has(> .inventory-photo-main),
  .inventory-mobile .inventory-hero:has(> .inventory-photo-main) {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-hero > .inventory-photo-main {
    width: min(100%, 20rem);
  }
}
