/* ============================================================
   CLIMÉVIA — Socle mobile partagé (additif, ne casse pas le desktop)
   Chargé par les pages staff/client (devis, facture, contrats, espace).
   Tout est soit universel et sûr, soit sous @media (max-width:760px).
   ============================================================ */

/* Confort tactile global (sans média : sûr partout) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, select, input, textarea, .btn, .tab, .act, .nb, .lnk, .row-item, .doc, .dl-item, .card, label {
  -webkit-tap-highlight-color: rgba(45, 156, 219, .18);
}

@media (max-width: 760px) {
  /* Jamais de débordement horizontal */
  html, body { overflow-x: hidden; max-width: 100%; }

  /* Inputs ≥ 16px : empêche le zoom automatique d'iOS Safari au focus */
  input, select, textarea { font-size: 16px !important; }

  /* Cibles tactiles confortables (≈ 44px Apple HIG) */
  .btn, .tab, .act, .lnk, .lc-del, .lc-delbtn, .x, .panel-close { min-height: 42px; }
  .btn-xs, .btn-sm { min-height: 38px; }

  /* Marge de défilement pour les ancrages sous une barre collante */
  [id] { scroll-margin-top: 72px; }

  /* ---- Modales → feuille du bas (bottom-sheet) plein écran ---- */
  .ov { align-items: flex-end; padding: 0; }
  .ov .modal {
    max-width: 100%; width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .28);
    animation: cvSheetUp .26s cubic-bezier(.22, 1, .36, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .ov .modal .modal-b { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* poignée visuelle de la feuille */
  .ov .modal .modal-h::before {
    content: ""; position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 3px; background: rgba(120, 134, 148, .35);
  }
  .ov .modal .modal-h { position: relative; padding-top: 20px; }
}
@keyframes cvSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Défilement fluide pour toute zone scrollable connue */
.pv-scroll, .modal-b, .panel-body, .table-wrap { -webkit-overflow-scrolling: touch; }

/* Respect de la préférence « réduire les animations » (la feuille reste bien positionnée) */
@media (prefers-reduced-motion: reduce) {
  .ov .modal { animation: none !important; }
}
