/* Keep product photos centered and make the zoom viewer cover the full site. */
.product-detail-page > .product-media {
  min-width: 0;
  width: 100%;
  align-self: center;
}

.product-detail-page .product-main-image {
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

body:has(.zoom-modal:not([hidden])) {
  overflow: hidden;
}

.zoom-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: clamp(12px, 2vw, 26px) !important;
  place-items: center !important;
  overflow: hidden !important;
  background: #100d12 !important;
}

.zoom-modal[hidden] {
  display: none !important;
}

.zoom-stage {
  position: relative !important;
  width: min(1120px, calc(100vw - 32px)) !important;
  height: min(820px, calc(100dvh - 32px)) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  margin: auto !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: clamp(16px, 2vw, 26px) !important;
  background: #100d12 !important;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .48);
}

.zoom-stage img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform-origin: center center !important;
}

.zoom-close {
  position: absolute !important;
  z-index: 10 !important;
  top: 12px !important;
  right: 12px !important;
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .5) !important;
  border-radius: 50% !important;
  background: rgba(20, 15, 24, .76) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  cursor: pointer;
}

@media (max-width: 620px) {
  .zoom-modal {
    padding: 8px !important;
  }

  .zoom-stage {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 16px !important;
  }

  .zoom-close {
    top: 10px !important;
    right: 10px !important;
    width: 42px !important;
    height: 42px !important;
  }
}
