/* Keep the photo overlay inside the image, including single-photo products. */
article.product .product-visual.photo { position: relative; }
.product-photo-trigger {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.product-photo-trigger:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -4px;
}
#productPhotoDialog {
  width: min(100% - 24px, 980px);
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--forest);
  overflow: auto;
  overscroll-behavior: contain;
}
#productPhotoDialog::backdrop { background: rgb(0 0 0 / 78%); }
#productPhotoDialog .photo-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}
#productPhotoDialog h2 { margin: 0; font: 500 clamp(1rem, 3vw, 1.5rem) var(--serif); }
#productPhotoDialog img {
  width: 100%;
  height: min(66dvh, 700px);
  object-fit: contain;
  background: #eee8dc;
  touch-action: pan-y pinch-zoom;
}
#productPhotoDialog .photo-dialog-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 6px;
}
#productPhotoDialog button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
#productPhotoDialog button:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
html:has(#productPhotoDialog[open]) { overflow: hidden; }
