/* Ultracell V20.13 — camada final única de saneamento mobile/entregador/zoom. */

/* ===== Consolidado de css/v19-12-deliverer-drawer-sharp.css ===== */
/* V19.12 — Entregador Mobile: drawer lateral nítido
   Corrige o efeito embaçado na aba lateral do entregador.
   Causa: camadas antigas aplicavam backdrop-filter/blur no overlay do drawer.
   Solução: overlay escurece sem blur e o drawer fica acima, sem filtros. */

@media (max-width: 820px) {
  body.deliverer-session,
  body:has(.official-delivery-page) {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body.deliverer-session .official-delivery-page,
  body.deliverer-session .official-delivery-phone,
  body.deliverer-session .official-delivery-screen,
  body.deliverer-session .official-delivery-hero,
  body.deliverer-session .official-delivery-panel,
  body:has(.official-delivery-page) .official-delivery-page,
  body:has(.official-delivery-page) .official-delivery-phone,
  body:has(.official-delivery-page) .official-delivery-screen,
  body:has(.official-delivery-page) .official-delivery-hero,
  body:has(.official-delivery-page) .official-delivery-panel {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.deliverer-session .adm-mobile-overlay-clean,
  body.deliverer-session .official-mobile-overlay,
  body.deliverer-session .mobile-sidebar-overlay,
  body:has(.official-delivery-page) .adm-mobile-overlay-clean,
  body:has(.official-delivery-page) .official-mobile-overlay,
  body:has(.official-delivery-page) .mobile-sidebar-overlay {
    z-index: 9990 !important;
    background: rgba(2, 6, 23, .62) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }

  body.deliverer-session .adm-mobile-drawer-clean,
  body:has(.official-delivery-page) .adm-mobile-drawer-clean {
    z-index: 10060 !important;
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform-style: flat !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
    box-shadow: 22px 0 44px rgba(0,0,0,.42) !important;
    background: linear-gradient(180deg, #050608 0%, #0b0d12 100%) !important;
  }

  body.deliverer-session .adm-mobile-drawer-clean *,
  body:has(.official-delivery-page) .adm-mobile-drawer-clean * {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
    opacity: 1;
  }

  body.deliverer-session .adm-mobile-drawer-clean .adm-mobile-brand-card-clean,
  body.deliverer-session .adm-mobile-drawer-clean .adm-mobile-nav-btn-clean,
  body.deliverer-session .adm-mobile-drawer-clean .adm-mobile-drawer-close-clean,
  body:has(.official-delivery-page) .adm-mobile-drawer-clean .adm-mobile-brand-card-clean,
  body:has(.official-delivery-page) .adm-mobile-drawer-clean .adm-mobile-nav-btn-clean,
  body:has(.official-delivery-page) .adm-mobile-drawer-clean .adm-mobile-drawer-close-clean {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }

  body.deliverer-session .adm-mobile-nav-copy-clean strong,
  body:has(.official-delivery-page) .adm-mobile-nav-copy-clean strong {
    color: #ffffff !important;
  }

  body.deliverer-session .adm-mobile-nav-copy-clean span,
  body:has(.official-delivery-page) .adm-mobile-nav-copy-clean span {
    color: rgba(255,255,255,.72) !important;
  }

  body.deliverer-session .adm-mobile-nav-btn-clean.active,
  body:has(.official-delivery-page) .adm-mobile-nav-btn-clean.active {
    background: #ffffff !important;
    color: #101828 !important;
  }

  body.deliverer-session .adm-mobile-nav-btn-clean.active .adm-mobile-nav-copy-clean strong,
  body:has(.official-delivery-page) .adm-mobile-nav-btn-clean.active .adm-mobile-nav-copy-clean strong {
    color: #101828 !important;
  }

  body.deliverer-session .adm-mobile-nav-btn-clean.active .adm-mobile-nav-copy-clean span,
  body:has(.official-delivery-page) .adm-mobile-nav-btn-clean.active .adm-mobile-nav-copy-clean span {
    color: #475467 !important;
  }
}


/* ===== Consolidado de css/v20-9-product-image-zoom.css ===== */
/* V20.9 — Ampliação limpa da foto do produto no catálogo.
   A regra corrige a V19 mobile: clicar na foto real do produto abre uma visualização ampliada. */

.is-zoomable-product-photo,
body.v19-store-mobile-active .v19-product-media.is-zoomable-product-photo {
  cursor: zoom-in !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

body.v19-store-mobile-active .v19-product-media.is-zoomable-product-photo::after {
  content: '⌕';
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 15, .72);
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

body.v19-store-mobile-active .v19-product-media.is-zoomable-product-photo img {
  pointer-events: none !important;
}

body.uc-image-viewer-open {
  overflow: hidden !important;
  touch-action: none !important;
}

.uc-product-image-viewer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: grid !important;
  place-items: center !important;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)) !important;
}

.uc-product-image-viewer-backdrop {
  position: absolute !important;
  inset: 0 !important;
  border: 0 !important;
  background: rgba(5, 8, 15, .92) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  cursor: zoom-out !important;
}

.uc-product-image-viewer-content {
  position: relative !important;
  z-index: 1 !important;
  width: min(96vw, 820px) !important;
  max-height: 92dvh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

.uc-product-image-viewer-content img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 82dvh !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.48) !important;
  touch-action: pinch-zoom !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

.uc-product-image-viewer-close {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 3 !important;
  width: 48px !important;
  height: 48px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #101828 !important;
  color: #fff !important;
  font-size: 32px !important;
  line-height: 1 !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: 0 16px 36px rgba(0,0,0,.35) !important;
}

.uc-product-image-viewer-hint {
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  opacity: .84 !important;
  text-align: center !important;
  padding: 0 12px !important;
}

@media (max-width: 760px) {
  .uc-product-image-viewer {
    padding: max(12px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom)) !important;
  }

  .uc-product-image-viewer-content {
    width: 100% !important;
    max-height: 94dvh !important;
  }

  .uc-product-image-viewer-content img {
    max-height: 78dvh !important;
    border-radius: 20px !important;
  }
}


/* ===== Consolidado de css/v20-12-universal-mobile-scroll-fix.css ===== */
/* V20.12 — rolagem universal do usuário mobile.
   Objetivo: corrigir travamentos de scroll em iPhone/Safari, Xiaomi/MIUI, Chrome Android,
   Samsung Internet, Motorola/Android, tablets e WebViews.
   Esta camada fica por último e só atua quando o cliente V19 mobile está ativo. */

@media (max-width: 1024px) {
  html {
    overflow-x: hidden !important;
  }

  body.v19-store-mobile-active {
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: static !important;
    touch-action: pan-y !important;
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.v19-store-mobile-active #app {
    height: auto !important;
    min-height: 100svh !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.v19-store-mobile-active .v19-app {
    min-height: 100svh !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    contain: none !important;
    content-visibility: visible !important;
  }

  @supports (height: 100dvh) {
    body.v19-store-mobile-active #app,
    body.v19-store-mobile-active .v19-app {
      min-height: 100dvh !important;
    }
  }

  /* A tela principal deve rolar pelo documento. Não usar scroller interno no catálogo. */
  body.v19-store-mobile-active .v19-grid,
  body.v19-store-mobile-active #v19-product-grid,
  body.v19-store-mobile-active .v19-news-grid,
  body.v19-store-mobile-active .v19-product,
  body.v19-store-mobile-active .v19-product-info,
  body.v19-store-mobile-active .v19-product-media,
  body.v19-store-mobile-active .v19-product-media img,
  body.v19-store-mobile-active .v19-name,
  body.v19-store-mobile-active .v19-meta,
  body.v19-store-mobile-active .v19-price,
  body.v19-store-mobile-active .v19-stock {
    contain: none !important;
    content-visibility: visible !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto !important;
  }

  /* Remove travas deixadas por camadas antigas quando não há modal/zoom aberto. */
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) {
    overflow-y: auto !important;
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .modal-backdrop,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .drawer-backdrop,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .uc-mobile-drawer,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .mobile-drawer,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .official-mobile-drawer {
    pointer-events: none !important;
  }

  body.v19-store-mobile-active .v19-page[hidden] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Páginas internas continuam com scroll próprio quando abertas. */
  body.v19-store-mobile-active .v19-page:not([hidden]) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active .v19-page-cart:not([hidden]) {
    overflow: hidden !important;
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active .v19-page-cart:not([hidden]) .v19-cart-content {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  /* Barras horizontais não podem travar a rolagem vertical do restante da tela. */
  body.v19-store-mobile-active .v19-category-strip,
  body.v19-store-mobile-active .v19-filter-strip,
  body.v19-store-mobile-active .v19-categories-content {
    touch-action: pan-x pan-y !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Só controles de toque usam manipulation. Todo o restante do card mantém pan-y. */
  body.v19-store-mobile-active button,
  body.v19-store-mobile-active select,
  body.v19-store-mobile-active input,
  body.v19-store-mobile-active .v19-add,
  body.v19-store-mobile-active .v19-qty button,
  body.v19-store-mobile-active .v19-nav-btn,
  body.v19-store-mobile-active .v19-chip,
  body.v19-store-mobile-active .v19-load-more,
  body.v19-store-mobile-active .v19-section-title {
    touch-action: manipulation !important;
  }

  /* O zoom da imagem continua funcionando, mas não bloqueia o gesto vertical quando fechado. */
  body.v19-store-mobile-active .v19-product-media.is-zoomable-product-photo {
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active .v19-product-media.is-zoomable-product-photo img {
    pointer-events: none !important;
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active.uc-image-viewer-open {
    overflow: hidden !important;
    touch-action: none !important;
  }

  body.v19-store-mobile-active .uc-product-image-viewer,
  body.v19-store-mobile-active .uc-product-image-viewer * {
    touch-action: none !important;
  }
}


/* ===== V20.13 — ajustes finais sem remendos duplicados ===== */
@media (max-width: 1024px) {
  body.v19-store-mobile-active .v19-product-media {
    position: relative !important;
    overflow: hidden !important;
  }

  body.v19-store-mobile-active .v19-product-media img {
    display: block !important;
    width: 100% !important;
    height: calc(100% - 34px) !important;
    max-height: calc(100% - 34px) !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
  }

  body.v19-store-mobile-active .v19-product-media:not(:has(.v19-premium-label)) img {
    height: 100% !important;
    max-height: 100% !important;
  }

  body.v19-store-mobile-active .v19-premium-label {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 3 !important;
  }

  body.v19-store-mobile-active .v19-load-more {
    grid-column: 1 / -1 !important;
    min-height: 48px !important;
    margin: 12px 16px 18px !important;
  }

  body.v19-store-mobile-active .v19-grid {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.v19-store-mobile-active .v19-page-news .v19-grid,
  body.v19-store-mobile-active .v19-page-cart .v19-grid {
    padding-bottom: 0 !important;
  }

  body.v19-store-mobile-active .v19-bottom-nav {
    transform: translateZ(0) !important;
    will-change: transform !important;
  }
}

@media (pointer: coarse) {
  body.v19-store-mobile-active .v19-product,
  body.v19-store-mobile-active .v19-product *:not(button):not(input):not(select):not(textarea) {
    user-select: none;
    -webkit-user-select: none;
  }

  body.v19-store-mobile-active input,
  body.v19-store-mobile-active textarea {
    user-select: text;
    -webkit-user-select: text;
  }
}
