/**
 * Fix touch/click em mobile/tablet - Loja Virtual
 * ESCOPO: apenas @media (max-width: 991px) - ZERO impacto no desktop
 * Não altera APIs, backend nem contratos do APK Flutter.
 */
@media (max-width: 991px) {
  /* Header acima do backdrop do menu */
  .base-topo {
    position: relative;
    z-index: 10000;
  }

  .base-topo .barra .submenu {
    z-index: 10001;
  }

  /* Evita que itemCesta absoluto do header cubra a vitrine no mobile */
  .areaTopo .itemCesta {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: auto !important;
  }

  /* Menu mobile */
  .base-topo .mobopcoes {
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    pointer-events: auto;
    cursor: pointer;
  }

  .base-topo .barra .submenu.mobile-menu-open {
    display: flex !important;
  }

  .base-topo .barra .submenu li a {
    touch-action: manipulation;
    pointer-events: auto;
  }

  /* Backdrop: só existe no DOM com menu aberto (JS remove ao fechar) */
  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: auto;
  }

  body:not(.mobile-menu-active) .mobile-menu-backdrop {
    display: none !important;
    pointer-events: none !important;
  }

  body.mobile-menu-active {
    overflow: hidden;
  }

  body.mobile-menu-active .mobile-menu-backdrop {
    display: block !important;
    pointer-events: auto !important;
  }

  /* Overlays inativos não devem capturar toque */
  #fundo_preto:not(.active):not(.show),
  #fundo_preto[style*="display: none"],
  #fundo_preto[style*="display:none"] {
    pointer-events: none !important;
  }

  .ui-modal-overlay:not(.active) {
    pointer-events: none !important;
  }

  .lens-fullscreen,
  .magnify-fullscreen[style*="display: none"],
  .magnify-fullscreen[style*="display:none"] {
    pointer-events: none !important;
  }

  /* Sliders: setas desabilitadas já não recebem toque; garantir wrapper não vaza */
  .lSSlideOuter,
  .lSSlideWrapper {
    max-width: 100%;
  }

  .lSAction > a.disabled {
    pointer-events: none !important;
  }

  /* Vitrine e controles interativos */
  .loja-main,
  .loja-main a,
  .loja-main button,
  .loja-main .btn,
  .shop-products,
  .shop-products *,
  .product-card,
  .product-card *,
  .areaTopo a,
  .areaTopo button {
    touch-action: manipulation;
  }

  .shop-products .product-card__icon-btn,
  .shop-products .product-card__footer .btn,
  .shop-products .product-card__details-link,
  .shop-products .product-card__link-detalhes,
  .shop-products .product-card__thumb-link,
  .shop-products .product-card__body-link,
  .base-topo .mobopcoes,
  .base-topo .barra .submenu li a {
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
}
