/* v96 — adattamento dedicato agli iPhone. Fuori da 600px non modifica la vista iPad/PC. */
@media screen and (max-width:600px){
  html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  body{ min-width:320px; overflow-x:hidden; }
  body, button, input, select, textarea{ -webkit-tap-highlight-color:transparent; }
  #app, .app-shell, .main, main, .content, .page-content{ min-width:0; max-width:100%; }
  .wrap{ width:100%; max-width:100%; padding-left:max(12px, env(safe-area-inset-left)); padding-right:max(12px, env(safe-area-inset-right)); }
  .page-head, .page-header, .toolbar, .section-toolbar{ gap:10px; flex-wrap:wrap; }
  .page-head h1, .page-header h1, h1{ font-size:clamp(1.35rem,6vw,1.8rem); line-height:1.2; overflow-wrap:anywhere; }
  .card, .panel, .section-card{ min-width:0; max-width:100%; }
  .grid, .form-grid, .stats-grid, .dashboard-grid, .home-shortcuts{ grid-template-columns:minmax(0,1fr)!important; }
  .form-row, .form-group, .field, .form-field{ min-width:0; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea{ box-sizing:border-box; width:100%; max-width:100%; min-height:44px; font-size:16px!important; }
  input[type=checkbox], input[type=radio]{ width:22px; height:22px; flex:0 0 auto; }
  button, .btn, [role=button]{ min-height:44px; touch-action:manipulation; }
  .table-wrap, .table-responsive, .table-scroll, .overflow-auto{ max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table{ min-width:620px; }
  .modal, .dialog, .modal-content{ box-sizing:border-box; width:calc(100vw - 24px); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow:auto; }
  .modal-backdrop, .modal-overlay{ align-items:flex-start; padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); overflow:auto; }
  .actions, .row-actions, .button-row{ flex-wrap:wrap; }
  img, svg, canvas, video{ max-width:100%; }
  .cash-layout, .cash-workspace, .basket-workspace, .shipment-layout, .order-layout{ grid-template-columns:minmax(0,1fr)!important; }
  .cash-summary, .cash-receipt, .basket-summary, .order-summary{ position:static!important; width:100%; }
  .cash-product-grid, .cash-products, .basket-package-grid, .basket-product-tiles{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cash-tile, .cash-product-tile, .basket-package-tile, .basket-product-tile{ min-width:0; overflow-wrap:anywhere; }
  .cash-row{ grid-template-columns:minmax(0,1fr) 54px 62px 44px!important; gap:4px!important; }
  .cash-row .cash-remove{ width:42px; min-width:42px; height:42px; min-height:42px; }
  .nav-mobile .topbar{ padding-top:env(safe-area-inset-top); }
  .nav-mobile .topbar button, .nav-mobile .topbar a{ min-height:44px; }
  body.standalone .wrap, body:has(.cash-page) .wrap{ padding-bottom:calc(16px + env(safe-area-inset-bottom)); }
}
@media screen and (max-width:370px){
  .wrap{ padding-left:max(9px, env(safe-area-inset-left)); padding-right:max(9px, env(safe-area-inset-right)); }
  .cash-product-grid, .cash-products, .basket-package-grid, .basket-product-tiles{ grid-template-columns:minmax(0,1fr); }
  .cash-row{ grid-template-columns:minmax(0,1fr) 48px 56px 40px!important; }
  .cash-row .cash-remove{ width:40px; min-width:40px; height:40px; min-height:40px; }
}
