/* ═══════════════════════════════════════════════════════════════
   VynorPay — pos-touch.css
   Touch optimization for 15.6" POS terminal @ 1366x768
   Load AFTER style.css:  <link rel="stylesheet" href="pos-touch.css"/>
   
   Design rules applied:
   - Min touch target: 48x48px (WCAG/Material), payment btns 64px+
   - No hover states (touch has no hover — they cause sticky styles)
   - No text selection / no long-press callout / no pinch zoom
   - Fixed viewport, zero page scroll; scroll only inside panels
   - Momentum scrolling + large scrollbars in item grid
═══════════════════════════════════════════════════════════════ */

/* ── 1. Global kiosk hardening ─────────────────────────────── */
@media (min-width: 1280px) and (max-width: 1440px) and (pointer: coarse),
       (min-width: 1280px) and (max-width: 1440px) {

  html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden !important;        /* NO page scroll ever */
    position: fixed;
    inset: 0;
    overscroll-behavior: none;          /* No pull-to-refresh */
    touch-action: manipulation;         /* Kill double-tap zoom */
    -webkit-user-select: none;
    user-select: none;                  /* No accidental selection */
    -webkit-touch-callout: none;        /* No long-press menu */
    -webkit-tap-highlight-color: transparent;
  }

  /* Inputs still selectable for typing */
  input, textarea { -webkit-user-select: text; user-select: text; }

  /* ── 2. Kill ALL hover states — replace with :active ─────── */
  *:hover { transition: none !important; }

  .item-tile:hover,
  .table-card:hover,
  .pay-btn:hover,
  .cat-tab:hover,
  .qty-b:hover,
  .ri:hover,
  .btn-primary:hover,
  .tbl-btn:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
  }

  /* Instant press feedback instead */
  .item-tile:active   { transform: scale(0.96); filter: brightness(1.15); }
  .table-card:active  { transform: scale(0.97); }
  .pay-btn:active,
  .btn-primary:active { transform: scale(0.97); filter: brightness(0.9); }
  .qty-b:active       { transform: scale(0.88); background: var(--t1); color: #fff; }
  .cat-tab:active     { filter: brightness(1.2); }

  /* ── 3. Touch target sizes (48px minimum) ─────────────────── */

  /* Navigation rail — bigger icons */
  .rail { width: 76px; }
  .ri   { width: 60px; height: 60px; }
  .ri svg { width: 26px; height: 26px; }

  /* Category tabs */
  .cat-bar { height: 56px; gap: 8px; padding: 0 12px; }
  .cat-tab {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 15px;
  }

  /* Item grid — 5 columns fit 1366px nicely */
  #item-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;   /* Momentum scroll */
    scrollbar-width: auto;
  }
  #item-grid::-webkit-scrollbar { width: 14px; }
  #item-grid::-webkit-scrollbar-thumb {
    background: var(--br-med);
    border-radius: 7px;
    min-height: 60px;                    /* Grabbable by finger */
  }
  .item-tile {
    min-height: 108px;                   /* Big finger targets */
    border-radius: 10px;
  }
  .it-name-top { font-size: 14px; }
  .it-price-btm { font-size: 14px; font-weight: 800; }

  /* Order panel lines + qty buttons */
  .op-line { padding: 12px 10px; min-height: 56px; }
  .ol-name { font-size: 15px; }
  .qty-b {
    width: 46px; height: 46px;           /* Was ~28px — too small */
    font-size: 22px;
    border-radius: 10px;
  }
  .qty-n { min-width: 36px; font-size: 17px; font-weight: 700; }

  /* ── 4. Payment buttons — the money makers: HUGE ──────────── */
  .pay-row { gap: 10px; padding: 12px; }
  .pay-btn {
    min-height: 68px;
    font-size: 18px;
    font-weight: 800;
    border-radius: 12px;
  }
  .pay-extra { min-height: 52px; font-size: 15px; }

  /* Total display — readable from 1 meter */
  #val-total { font-size: 34px; font-weight: 900; }
  .op-total-row { padding: 14px 12px; }

  /* ── 5. Table map — big tappable tables ───────────────────── */
  #floor-canvas {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-card { min-height: 140px; padding: 16px; }
  .table-name { font-size: 18px; }
  .table-status { font-size: 13px; padding: 4px 12px; }
  .tca-btn { width: 42px; height: 42px; font-size: 16px; }

  /* ── 6. PIN pad — thumb-optimized ─────────────────────────── */
  .pin-pad { gap: 14px; }
  .pk {
    width: 84px; height: 84px;
    font-size: 30px;
    border-radius: 50%;
  }
  .pk:active { transform: scale(0.92); background: rgba(255,255,255,0.25); }

  /* ── 7. Modals — larger close targets, centered ───────────── */
  .modal { max-width: 560px; padding: 24px; }
  .modal-x { width: 48px; height: 48px; font-size: 20px; }
  .mod-opt { min-height: 52px; font-size: 16px; padding: 14px 18px; }
  .btn-mod-add, .btn-mod-skip { min-height: 56px; font-size: 16px; }

  /* Quick discount buttons */
  .qd-btn { min-width: 64px; min-height: 44px; font-size: 15px; }

  /* Search input — big enough to tap, shows kiosk keyboard */
  .pos-search { height: 46px; font-size: 16px; }
  .scan-btn   { width: 46px; height: 46px; }

  /* Admin tables — row height for touch */
  .admin-table td { padding: 14px 10px; }
  .tbl-btn { width: 44px; height: 44px; }

  /* Form fields in admin */
  .fi, .fl + input, select.fi { min-height: 48px; font-size: 16px; }
  .btn-primary { min-height: 52px; padding: 14px 28px; font-size: 16px; }

  /* ── 8. Numeric keypad for prices (if added later) ────────── */
  .numpad-btn {
    width: 72px; height: 64px;
    font-size: 24px; font-weight: 700;
    border-radius: 10px;
  }
}

/* ── 9. Disable text zoom from OS accessibility (kiosk) ─────── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ── 10. Hide scrollbars on rail/catbar but keep function ───── */
.rail::-webkit-scrollbar,
.cat-bar::-webkit-scrollbar { display: none; }
