/*
  Ultracell V20.46 — Android Scroll Performance Hardening
  Auditoria: Android/Xiaomi ainda engasga quando há body overflow auto + páginas internas,
  bottom nav fixed com transform, sticky headers, sombras pesadas e imagens sem lazy loading.
  Política: viewport/documento como scroll owner, menos camadas de pintura e menos interferência touch.
*/
@media (max-width: 760px) {
  :root {
    --uc-bottom-nav-space: calc(108px + env(safe-area-inset-bottom, 0px));
    --uc-mobile-max: 430px;
  }

  html {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-behavior: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open),
  body.uc-backoffice-mobile-app-active:not(.modal-open):not(.uc-image-viewer-open),
  body.official-mobile-active:not(.modal-open):not(.uc-image-viewer-open) {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100% !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
    inset: auto !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    touch-action: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    contain: none !important;
    transform: none !important;
  }

  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) #app,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-app {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: min(100%, var(--uc-mobile-max)) !important;
    max-width: var(--uc-mobile-max) !important;
    min-width: 0 !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    margin-inline: auto !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: none !important;
    contain: none !important;
    will-change: auto !important;
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-app {
    padding-bottom: var(--uc-bottom-nav-space) !important;
  }

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

  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-page:not([hidden]),
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-page-news:not([hidden]),
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-page-categories:not([hidden]),
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-page-profile:not([hidden]),
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-page-cart:not([hidden]) {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    transform: none !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    contain: none !important;
    will-change: auto !important;
    padding-bottom: var(--uc-bottom-nav-space) !important;
    z-index: auto !important;
  }

  body.v19-store-mobile-active .v19-page-header {
    position: relative !important;
    top: auto !important;
    z-index: 2 !important;
    transform: none !important;
    will-change: auto !important;
  }

  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-grid,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) #v19-product-grid,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-news-grid,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-categories-content,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-cart-content,
  body.v19-store-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .v19-profile-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    contain: none !important;
    will-change: auto !important;
  }

  body.v19-store-mobile-active .v19-category-strip,
  body.v19-store-mobile-active .v19-filter-strip {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    touch-action: pan-x !important;
    overscroll-behavior-x: contain !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.v19-store-mobile-active .v19-category-strip button,
  body.v19-store-mobile-active .v19-filter-strip button,
  body.v19-store-mobile-active button,
  body.v19-store-mobile-active a,
  body.v19-store-mobile-active input,
  body.v19-store-mobile-active select,
  body.v19-store-mobile-active textarea {
    touch-action: manipulation !important;
  }

  body.v19-store-mobile-active .v19-product,
  body.v19-store-mobile-active .v19-product-media,
  body.v19-store-mobile-active .v19-product-info,
  body.v19-store-mobile-active .v19-product-title,
  body.v19-store-mobile-active .v19-name,
  body.v19-store-mobile-active .v19-meta,
  body.v19-store-mobile-active .v19-stars,
  body.v19-store-mobile-active .v19-price,
  body.v19-store-mobile-active .v19-stock {
    touch-action: pan-y !important;
  }

  body.v19-store-mobile-active .v19-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(100%, var(--uc-mobile-max)) !important;
    max-width: var(--uc-mobile-max) !important;
    margin: 0 auto !important;
    transform: none !important;
    z-index: 90 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    contain: layout paint !important;
  }

  body.v19-store-mobile-active .v19-bottom-nav::before,
  body.v19-store-mobile-active .v19-bottom-nav::after {
    content: none !important;
    display: none !important;
  }

  /* Reduz custo de pintura no Android sem mudar regra de negócio. */
  body.v19-store-mobile-active .v19-product {
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08) !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    content-visibility: auto;
    contain-intrinsic-size: 430px 620px;
  }

  body.v19-store-mobile-active .v19-product-media,
  body.v19-store-mobile-active .v19-product-media img,
  body.v19-store-mobile-active .catalog-dev-notice,
  body.v19-store-mobile-active .v19-section-title,
  body.v19-store-mobile-active .v19-topbar {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.v19-store-mobile-active .v19-product-media img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  body.v19-store-mobile-active.v19-internal-page-active .v19-topbar,
  body.v19-store-mobile-active.v19-internal-page-active .catalog-dev-notice,
  body.v19-store-mobile-active.v19-internal-page-active .catalog-dev-notice-v19,
  body.v19-store-mobile-active.v19-internal-page-active .v19-section-title,
  body.v19-store-mobile-active.v19-internal-page-active .v19-active-filter,
  body.v19-store-mobile-active.v19-internal-page-active .v19-category-strip,
  body.v19-store-mobile-active.v19-internal-page-active #v19-product-grid {
    display: none !important;
  }

  /* Backoffice e telas oficiais: menos interferência de scroll interno. */
  body.uc-backoffice-mobile-app-active:not(.modal-open):not(.uc-image-viewer-open) #app,
  body.uc-backoffice-mobile-app-active:not(.modal-open):not(.uc-image-viewer-open) .uc-app,
  body.uc-backoffice-mobile-app-active:not(.modal-open):not(.uc-image-viewer-open) .uc-mobile-app,
  body.uc-backoffice-mobile-app-active:not(.modal-open):not(.uc-image-viewer-open) .uc-app-content,
  body.uc-backoffice-mobile-app-active:not(.modal-open):not(.uc-image-viewer-open) .uc-mobile-app-content,
  body.official-mobile-active:not(.modal-open):not(.uc-image-viewer-open) #app,
  body.official-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .official-mobile-shell,
  body.official-mobile-active:not(.modal-open):not(.uc-image-viewer-open) .official-mobile-content {
    height: auto !important;
    max-height: none !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    transform: none !important;
    will-change: auto !important;
  }

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