/**
 * Site-wide mobile hardening: stop iOS auto-zoom / double-tap zoom,
 * keep taps responsive, prevent horizontal page drift.
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Disables double-tap-to-zoom on interactive controls (main iOS culprit) */
a, button, input, select, textarea, label,
[onclick], [role="button"], .nav-item, .av-tab, .av-icon-btn,
.av-link-btn, .av-send, .av-thread, summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Stop focus zoom on iPhone (requires >= 16px) */
@media screen and (max-width: 900px) {
  input, select, textarea, button {
    font-size: 16px !important;
  }
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/*
 * CRITICAL: Tailwind "hidden flex" on the same node is unreliable —
 * flex can win and leave a full-screen overlay stealing every tap.
 * Force closed overlays to truly not receive pointer events.
 */
#appModal.hidden,
#walletFlowOverlay.hidden,
#kycOverlay.hidden,
#sellWizardOverlay.hidden,
#chatOverlay.hidden,
#filterDrawer.hidden,
#leftMenu.hidden,
#rightMenu.hidden,
#notificationDrawer.hidden,
#bottomNav.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

#bottomNav:not(.hidden) {
  display: block !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

#appModal:not(.hidden),
#walletFlowOverlay:not(.hidden),
#kycOverlay:not(.hidden),
#sellWizardOverlay:not(.hidden),
#chatOverlay:not(.hidden) {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
