/* =========================================================
   Global Vett · App-Shell
   Comportamiento tipo app nativa cuando se instala como PWA.
   No rompe la lógica existente: solo desactiva gestos del navegador.
   ========================================================= */

html, body {
  /* Evita rebote/pull-to-refresh en iOS y sobre-scroll en Android */
  overscroll-behavior: none;
  /* Texto sin selección accidental (el input y textarea se rehabilitan abajo) */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* Evita doble-tap zoom y mejora respuesta al tocar */
  touch-action: manipulation;
  /* Suavizar scroll en iOS */
  -webkit-overflow-scrolling: touch;
  /* Tipografía legible al 100% sin zoom del sistema */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Rehabilitar selección donde sí tiene sentido */
input, textarea, [contenteditable="true"], .selectable, .allow-select {
  -webkit-user-select: text;
  user-select: text;
}

/* Padding por safe areas (notch) cuando está instalada como PWA standalone */
@supports (padding: max(0px)) {
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Quitar highlight azul al tocar en iOS */
* { -webkit-tap-highlight-color: transparent; }

/* Evitar zoom al enfocar inputs en iOS (font-size >= 16px) */
input, select, textarea {
  font-size: 16px;
}

/* Ajustes solo cuando corre como app instalada */
@media all and (display-mode: standalone) {
  html, body {
    /* Fijar viewport — solo las áreas internas hacen scroll */
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  /* Las áreas principales hacen scroll internamente */
  .main-content,
  .client-main,
  .page-body,
  main,
  .wrap {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
