/* UltraCell V20.79 — proprietário único da ampliação de fotos do catálogo. */
@media (max-width: 760px) {
  body.v19-store-mobile-active .v19-product-media,
  body.official-mobile-active .official-mobile-photo,
  body.official-mobile-active .uc-photo,
  body.official-mobile-active .catalog-list-photo,
  body.official-mobile-active .catalog-product-image,
  .uc-photo,
  .official-mobile-photo,
  .catalog-list-photo,
  .catalog-product-image {
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%) !important;
  }

  body.v19-store-mobile-active .v19-product-media {
    aspect-ratio: 1 / 1 !important;
    min-height: 150px !important;
    height: auto !important;
    border-radius: 20px !important;
  }

  body.v19-store-mobile-active .v19-product-media img,
  body.official-mobile-active .official-mobile-photo img,
  body.official-mobile-active .uc-photo img,
  body.official-mobile-active .catalog-list-photo img,
  body.official-mobile-active .catalog-product-image img,
  .uc-photo img,
  .official-mobile-photo img,
  .catalog-list-photo img,
  .catalog-product-image img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }
}

[data-product-main-image][data-image-zoom-src],
.ucv77-product-photo {
  position: relative;
  cursor: zoom-in !important;
  touch-action: pan-y pinch-zoom !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
}

/* V20.79: vence os proprietários antigos de rolagem sem retirar o pan vertical
   do catálogo. O touchend delegado recupera o toque quando o Safari cancela o
   PointerEvent para avaliar um gesto nativo. */
body.v19-store-mobile-active [data-product-main-image][data-image-zoom-src],
body.v19-store-mobile-active .ucv77-product-photo,
body.official-mobile-active [data-product-main-image][data-image-zoom-src],
body.official-mobile-active .ucv77-product-photo,
body.uc-backoffice-mobile-app-active [data-product-main-image][data-image-zoom-src],
body.uc-backoffice-mobile-app-active .ucv77-product-photo {
  touch-action: pan-y pinch-zoom !important;
}

[data-product-main-image][data-image-zoom-src] > img,
.ucv77-product-photo > img {
  pointer-events: none !important;
  -webkit-user-drag: none !important;
}

[data-product-main-image][data-image-zoom-src]::after,
.ucv77-product-photo::after {
  content: '⌕';
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 15, .78);
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}

body.uc-image-viewer-open,
body.ucv77-image-viewer-open {
  position: fixed !important;
  overflow: hidden !important;
  touch-action: pinch-zoom !important;
  overscroll-behavior: none !important;
}

.ucv77-image-viewer[hidden] {
  display: none !important;
}

.ucv77-image-viewer {
  position: fixed;
  inset: 0;
  z-index: var(--uc-layer-viewer, 2147483000);
  display: grid;
  place-items: center;
  padding:
    max(12px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility .16s ease;
  isolation: isolate;
}

.ucv77-image-viewer.is-open {
  opacity: 1;
  visibility: visible;
}

.ucv77-image-viewer__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(3, 6, 12, .94);
  cursor: zoom-out;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.ucv77-image-viewer__content {
  position: relative;
  z-index: 1;
  width: min(96vw, 900px);
  height: min(90dvh, 900px);
  margin: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.ucv77-image-viewer__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 84dvh;
  object-fit: contain;
  object-position: center;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
  touch-action: pinch-zoom !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}

.ucv77-image-viewer__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 16, 29, .94);
  color: #fff;
  font: 700 32px/1 system-ui, sans-serif;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .4);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.ucv77-image-viewer__caption {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2;
  color: #fff;
  font: 800 13px/1.4 system-ui, sans-serif;
  text-align: center;
  opacity: .82;
  pointer-events: none;
}

.ucv77-image-viewer.has-error .ucv77-image-viewer__caption {
  color: #fecaca;
}

@media (max-width: 430px) {
  body.v19-store-mobile-active .v19-product-media {
    min-height: 140px !important;
  }

  .ucv77-image-viewer__content {
    width: 100%;
    height: 88dvh;
  }

  .ucv77-image-viewer__image {
    max-height: 78dvh;
    border-radius: 16px;
  }
}

@media (max-width: 360px) {
  body.v19-store-mobile-active .v19-product-media {
    min-height: 128px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ucv77-image-viewer {
    transition: none;
  }
}
