/* Otimizações de Performance para Google Analytics e Event Listeners */

/* Previne problemas de scroll em dispositivos móveis */
* {
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: thin;
}

/* Otimizações para eventos de toque */
html, body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Melhora performance de scroll */
.smooth-scroll {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Otimizações para elementos com event listeners */
[data-gtm], [data-ga], [data-fb] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Previne conflitos de scroll */
.navbar, .sticky-top {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Otimizações para carrossel */
.carousel-inner {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Melhora performance de animações */
.animate-fade, .fade-in {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: opacity, transform;
}

/* Otimizações para botões flutuantes */
#floating-cart-button, #floating-action-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* Previne problemas de scroll em modais */
.modal {
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* Otimizações para formulários */
.form-control:focus {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Melhora performance de hover */
.nav-link:hover, .btn:hover {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Otimizações para imagens */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Previne problemas de scroll em seções específicas */
#hero-section, #carousel-products, #about-section {
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* Otimizações para navegação */
.navbar-nav .nav-link {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Melhora performance de transições */
.transition-all {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: all;
}

/* Otimizações para elementos com JavaScript */
[onclick], [onload], [onchange] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Previne problemas de scroll em dispositivos com teclado virtual */
@media (max-width: 768px) {
  input, textarea, select {
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
  }
}

/* Otimizações para elementos com data attributes */
[data-bs-toggle], [data-bs-target] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Melhora performance de elementos com position: fixed */
.position-fixed {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Otimizações para elementos com z-index alto */
[style*="z-index"] {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}
