/* The viewer is mounted only after an image is opened; gallery geometry stays unchanged. */
.whce-product-zoom {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 48px));
  height: min(900px, calc(100vh - 48px));
  height: min(900px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #18231e;
  box-shadow: 0 24px 100px #0005;
  font: 400 15px/1.45 system-ui, sans-serif;
  overscroll-behavior: contain;
}
.whce-product-zoom:not([open]) { display: none; }
.whce-product-zoom[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.whce-product-zoom::backdrop { background: rgba(10, 19, 29, .82); }
.whce-product-zoom.is-fallback { z-index: 2147483647; box-shadow: 0 0 0 100vmax rgba(10, 19, 29, .82); }
.whce-product-zoom * { box-sizing: border-box; }
.whce-product-zoom__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e9e7;
}
.whce-product-zoom__heading { min-width: 0; }
.whce-product-zoom__title { margin: 0; font: 650 17px/1.3 system-ui, sans-serif; }
.whce-product-zoom__count { display: block; margin-top: 3px; color: #5a665f; font-size: 12px; }
.whce-product-zoom__tools { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.whce-product-zoom button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #f3f6f4;
  color: #18372a;
  font: 400 25px/1 system-ui, sans-serif;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
}
.whce-product-zoom button:hover { background: #e7eee9; }
.whce-product-zoom button:disabled { opacity: .3; cursor: default; }
.whce-product-zoom button:focus-visible { outline: 3px solid #298245; outline-offset: 2px; }
.whce-product-zoom button[data-whce-zoom-reset] { width: 54px; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 600; }
.whce-product-zoom button[data-whce-zoom-close] { margin-left: 8px; background: #182d24; color: #fff; }
.whce-product-zoom__canvas { position: relative; min-height: 0; overflow: hidden; }
.whce-product-zoom__stage {
  position: absolute;
  inset: 12px 52px;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}
.whce-product-zoom.is-enlarged .whce-product-zoom__stage { cursor: grab; }
.whce-product-zoom.is-dragging .whce-product-zoom__stage { cursor: grabbing; }
.whce-product-zoom__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
  -webkit-user-drag: none;
}
.whce-product-zoom__canvas > button {
  position: absolute;
  top: calc(50% - 22px);
  z-index: 1;
  border-color: #dbe5de;
  background: rgba(255, 255, 255, .96);
  font-size: 32px;
}
.whce-product-zoom__canvas > button[data-whce-zoom-prev] { left: 8px; }
.whce-product-zoom__canvas > button[data-whce-zoom-next] { right: 8px; }
.whce-product-zoom__footer { padding: 12px 22px 16px; border-top: 1px solid #e5e9e7; text-align: center; }
.whce-product-zoom__caption { margin: 0; color: #354c40; font-size: 13px; }
.whce-product-zoom__hint { margin: 5px 0 0; color: #647169; font-size: 12px; }
@media (max-width: 767px) {
  .whce-product-zoom { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; }
  .whce-product-zoom__header { gap: 8px; padding: max(10px, env(safe-area-inset-top)) 10px 10px; }
  .whce-product-zoom__title { font-size: 15px; }
  .whce-product-zoom__tools { gap: 0; }
  .whce-product-zoom button { width: 40px; min-width: 40px; }
  .whce-product-zoom button[data-whce-zoom-reset] { width: 44px; }
  .whce-product-zoom button[data-whce-zoom-close] { margin-left: 3px; }
  .whce-product-zoom__stage { inset: 8px 28px; }
  .whce-product-zoom__canvas > button { width: 38px; min-width: 38px; height: 44px; }
  .whce-product-zoom__canvas > button[data-whce-zoom-prev] { left: 3px; }
  .whce-product-zoom__canvas > button[data-whce-zoom-next] { right: 3px; }
  .whce-product-zoom__footer { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); }
}
