/* Dedicated NextTill phone layout. Tablet and desktop layouts remain in till.css. */
@media (max-width: 600px) {
  html, body { width:100%; height:100%; overflow:hidden; }
  body { min-width:0; }

  .topbar {
    height:56px;
    min-height:56px;
    padding:max(7px,env(safe-area-inset-top)) 10px 7px;
    gap:8px;
  }
  .topbar .menu-button { min-width:42px; min-height:40px; }
  .topbar strong { font-size:1rem; margin-right:auto; }
  .topbar .mode { display:inline-block; margin:0; font-size:.62rem; padding:4px 7px; }
  .topbar .network { font-size:.65rem; white-space:nowrap; }
  .topbar #syncStatus { display:none; }

  .till-layout {
    display:flex;
    flex-direction:column;
    width:100%;
    height:calc(100dvh - 56px);
    min-height:0;
    overflow:hidden;
  }

  .sell-panel {
    flex:1 1 54%;
    min-height:0;
    width:100%;
    height:auto;
    padding:10px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    border:0;
  }
  .search-form,
  .search-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:7px;
    position:sticky;
    top:0;
    z-index:4;
    background:#f6f1f3;
    padding-bottom:8px;
  }
  .search-form input,
  .search-row input {
    min-width:0;
    min-height:46px;
    padding:8px 11px;
    font-size:16px;
  }
  .search-form button,
  .search-row button { min-height:46px; padding:8px 12px; }

  .browse-trail {
    gap:5px;
    margin:2px 0 8px;
    flex-wrap:nowrap;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .browse-trail::-webkit-scrollbar { display:none; }
  .browse-trail button { flex:0 0 auto; min-height:36px; padding:6px 9px; font-size:.82rem; }

  .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .department { min-height:70px; font-size:.95rem; padding:10px; }
  .category { min-height:64px; font-size:.9rem; padding:9px; }
  .product-tile { min-height:0; aspect-ratio:1/1; padding:10px; }
  .product-tile .product-name { font-size:.88rem; line-height:1.14; }
  .product-tile .price { font-size:1rem; }
  .product-row { min-height:50px; padding:8px 10px; }

  .basket-panel {
    flex:0 0 46%;
    width:100%;
    height:auto;
    min-height:0;
    max-height:none;
    padding:9px 10px max(8px,env(safe-area-inset-bottom));
    border-left:0;
    border-top:2px solid var(--line);
    overflow:hidden;
    box-shadow:0 -4px 18px rgba(0,0,0,.08);
  }
  .basket-heading { gap:8px; }
  .basket-heading h1,
  .basket-heading h2 { margin:0; font-size:1.05rem; }
  .basket-actions { gap:5px; }
  .basket-actions button { min-height:38px; padding:6px 9px; font-size:.8rem; }
  .sale-customer { margin-top:5px; padding:6px 8px; }

  .basket-lines {
    margin:6px 0;
    min-height:0;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .basket-lines .empty { margin:18px 0; font-size:.85rem; }
  .line { padding:7px 0; gap:4px; }
  .line-name { font-size:.88rem; }
  .line-meta,.line-options { font-size:.7rem; }
  .line-controls { gap:3px; }
  .line-controls button { min-width:34px; min-height:34px; padding:3px 6px; }

  .promotion-summary { margin-bottom:5px; padding:6px 8px; font-size:.75rem; }
  .totals { padding-top:6px; }
  .totals > div { padding:3px 0; font-size:.86rem; }
  .totals .grand { font-size:1.2rem; }
  .payment-buttons { gap:7px; margin-top:6px; }
  .payment-buttons button { min-height:46px; padding:8px; font-size:.9rem; }
  .trial-warning { display:none; }

  .till-action-drawer { margin-top:6px!important; }
  .till-action-handle { min-height:42px!important; font-size:14px!important; }
  .till-action-panel {
    position:fixed;
    left:8px;
    right:8px;
    bottom:max(8px,env(safe-area-inset-bottom));
    z-index:30;
    max-height:70dvh!important;
    margin:0!important;
    border-radius:16px!important;
    box-shadow:0 12px 40px rgba(0,0,0,.28)!important;
  }
  .till-action-grid,.misc-drawer-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  .till-action-item,.misc-drawer-item { min-height:62px!important; }

  .tool-dialog,.wide-dialog {
    width:calc(100vw - 16px)!important;
    max-width:none!important;
    max-height:88dvh;
    padding:18px;
    overflow:auto;
    border-radius:16px;
  }
  .cash-suggestions { grid-template-columns:repeat(2,1fr); }
  .customer-results { max-height:48dvh; }
  .side-menu { width:92vw; }
}

@media (max-width: 380px) {
  .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .basket-panel { flex-basis:49%; }
  .sell-panel { flex-basis:51%; }
  .topbar .network { display:none; }
}
