/* The product photo on the whole screen (product-zoom.js) and the photo on the product page that opens it. */

.product-zoom-open { width: 100%; height: 100%; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 14px; background: none; cursor: zoom-in; }
.product-zoom-open img { width: 100%; height: 100%; object-fit: contain; }

html:has(.zoom-dialog[open]) { overflow: hidden; }

.zoom-dialog {
  position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: rgba(10, 14, 12, .94); color: #fff; box-shadow: none; overflow: hidden;
}
.zoom-dialog[open] { display: grid; grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr); }
.zoom-dialog::backdrop { background: rgba(10, 14, 12, .94); backdrop-filter: none; }

.zoom-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 6px 18px; }
.zoom-count { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.zoom-tools { display: flex; gap: 8px; margin-left: auto; }
.zoom-tool, .zoom-arrow {
  width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; background: rgba(20, 26, 23, .72); color: #fff; cursor: pointer;
}
.zoom-tool:hover, .zoom-arrow:hover { background: rgba(60, 70, 64, .9); }
.zoom-tool:disabled { opacity: .35; cursor: default; }
.zoom-tool:focus-visible, .zoom-arrow:focus-visible, .zoom-thumbs button:focus-visible { outline: 3px solid #9be7bd; outline-offset: 2px; }

.zoom-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.zoom-image { max-width: none; transform-origin: center; cursor: zoom-in; -webkit-user-drag: none; transition: transform .18s ease-out; will-change: transform; }
.zoom-dialog.is-zoomed .zoom-image { cursor: zoom-out; transition: none; }
.zoom-dialog.is-loading .zoom-stage::after {
  content: ""; position: absolute; top: 14px; left: 50%; width: 22px; height: 22px; margin-left: -11px;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: zoom-spin .8s linear infinite;
}
@keyframes zoom-spin { to { transform: rotate(360deg); } }

.zoom-hint { position: absolute; bottom: 12px; left: 50%; margin: 0; padding: 6px 12px; transform: translateX(-50%); border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: .875rem; white-space: nowrap; pointer-events: none; }
.zoom-hint-touch { display: none; }
.zoom-dialog.is-zoomed .zoom-hint { display: none; }
@media (hover: none) and (pointer: coarse) {
  .zoom-hint-mouse { display: none; }
  .zoom-hint-touch { display: inline; }
}

.zoom-arrow { position: absolute; top: 50%; margin-top: -24px; }
.zoom-arrow[hidden] { display: none; }
.zoom-previous { left: 14px; }
.zoom-previous svg { transform: rotate(180deg); }
.zoom-next { right: 14px; }

.zoom-thumbs { display: flex; justify-content: center; gap: 8px; padding: 8px 12px 14px; overflow-x: auto; }
.zoom-thumbs[hidden] { display: none; }
.zoom-thumbs button { flex: none; width: 60px; height: 60px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: #fff; cursor: pointer; opacity: .65; }
.zoom-thumbs button[aria-pressed="true"] { border-color: #9be7bd; opacity: 1; }
.zoom-thumbs img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 680px) {
  .zoom-arrow { display: none; }
  .zoom-thumbs button { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .zoom-image { transition: none; }
  .zoom-dialog.is-loading .zoom-stage::after { animation: none; }
}
