/* WebCom POS — Touch Mode
   يُفعَّل تلقائيًا على الشاشات التي تعمل باللمس (html.wcom-touch) أو يدويًا من زر «🖐 وضع اللمس».
   الهدف: أهداف لمس لا تقل عن 44–48px، ضغط فوري بلا تأخير/تكبير مزدوج، تغذية بصرية عند الضغط،
   تمرير سلس بلا ارتداد للصفحة، وأزرار مبالغ سريعة ولوحة أرقام للكاشير. */

/* ---------- أساسيات لا تغيّر التصميم ---------- */
.wcom-pro-cashier, .wcom-admin-app{ touch-action:manipulation; -webkit-tap-highlight-color:rgba(37,99,235,.18); }
html.wcom-touch .wcom-pro-cashier{ overscroll-behavior:none; }
html.wcom-touch .wcom-pro-cashier button,
html.wcom-touch .wcom-pro-cashier .wpc-results > *,
html.wcom-touch .wcom-pro-cashier .wpc-quick-products *,
html.wcom-touch .wcom-admin-app button,
html.wcom-touch .wcom-admin-app .wcom-a-nav a{ -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
html.wcom-touch .wcom-pro-cashier input,
html.wcom-touch .wcom-admin-app input,
html.wcom-touch .wcom-admin-app textarea{ -webkit-user-select:text; user-select:text; }

/* تمرير سلس داخل المناطق القابلة للتمرير دون سحب الصفحة كلها */
html.wcom-touch .wpc-cart-wrap,
html.wcom-touch .wpc-results,
html.wcom-touch .wpc-modal-box,
html.wcom-touch .wpc-more-menu,
html.wcom-touch .wcom-a-scroll,
html.wcom-touch .wcom-a-table-wrap,
html.wcom-touch .wcom-pur-modal-box{ -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }

/* ---------- تغذية بصرية للضغط (لا يوجد hover على اللمس) ---------- */
html.wcom-touch .wcom-pro-cashier button:active,
html.wcom-touch .wcom-admin-app button:active,
html.wcom-touch .wcom-admin-app .wcom-a-nav a:active,
html.wcom-touch .wcom-pro-cashier .wpc-results > *:active{ transform:scale(.97); filter:brightness(.93); transition:transform .06s, filter .06s; }
html.wcom-touch .wcom-pro-cashier button:disabled:active{ transform:none; filter:none; }

/* ---------- الكاشير: أهداف لمس كبيرة ---------- */
html.wcom-touch .wcom-pro-cashier .wpc-btn,
html.wcom-touch .wcom-pro-cashier .wpc-checkout-actions button{ min-height:50px; font-size:15px; }
html.wcom-touch .wcom-pro-cashier .wpc-icon-btn{ min-width:48px; min-height:48px; }
html.wcom-touch .wcom-pro-cashier .wpc-method-btn{ height:54px; font-size:13px; }
html.wcom-touch .wcom-pro-cashier .wpc-payment-methods{ gap:8px; }
html.wcom-touch .wcom-pro-cashier .wpc-more-item{ min-height:54px!important; font-size:15px!important; }
html.wcom-touch .wcom-pro-cashier .wpc-shift-pill{ min-height:48px!important; }
html.wcom-touch .wcom-pro-cashier .wpc-modal-close{ width:52px; height:52px; font-size:32px; top:6px; }
html.wcom-touch .wcom-pro-cashier .wpc-del{ min-width:46px; min-height:46px; font-size:26px; }
html.wcom-touch .wcom-pro-cashier .wpc-link{ min-height:44px; padding:8px 10px; }

/* أزرار الكمية + / − */
html.wcom-touch .wcom-pro-cashier .wpc-qty{ gap:6px; }
html.wcom-touch .wcom-pro-cashier .wpc-qty .wpc-minus,
html.wcom-touch .wcom-pro-cashier .wpc-qty .wpc-plus{ width:46px; height:46px; min-width:46px; border-radius:10px; font-size:24px; font-weight:900; line-height:1; border:1px solid #cbd5e1; background:#f1f5f9; color:#0f172a; cursor:pointer; }
html.wcom-touch .wcom-pro-cashier .wpc-qty .wpc-plus{ background:#dbeafe; border-color:#93c5fd; color:#1d4ed8; }
html.wcom-touch .wcom-pro-cashier .wpc-qty-input{ width:68px; height:46px; text-align:center; font-size:18px; font-weight:800; }

/* الحقول: 16px تمنع تكبير iOS، وارتفاع مريح */
html.wcom-touch .wcom-pro-cashier input:not([type=checkbox]):not([type=radio]),
html.wcom-touch .wcom-pro-cashier select,
html.wcom-touch .wcom-admin-app input:not([type=checkbox]):not([type=radio]),
html.wcom-touch .wcom-admin-app select{ min-height:46px; font-size:16px; }
html.wcom-touch .wcom-pro-cashier input[type=checkbox],
html.wcom-touch .wcom-pro-cashier input[type=radio],
html.wcom-touch .wcom-admin-app input[type=checkbox],
html.wcom-touch .wcom-admin-app input[type=radio]{ width:24px; height:24px; }
html.wcom-touch .wcom-pro-cashier label:has(> input[type=checkbox]){ min-height:44px; display:inline-flex; align-items:center; gap:8px; }
html.wcom-touch .wcom-pro-cashier .wpc-paid-row{ grid-template-columns:minmax(0,1fr) 120px; }
html.wcom-touch .wcom-pro-cashier #wpc-paid{ font-size:22px; font-weight:900; min-height:56px; }
html.wcom-touch .wcom-pro-cashier .wpc-searchbar{ padding:6px 8px; }
html.wcom-touch .wcom-pro-cashier .wpc-searchbar input{ min-height:50px; font-size:17px; }
html.wcom-touch .wcom-pro-cashier .wpc-cart-wrap td{ padding-top:10px; padding-bottom:10px; }

/* ---------- لوحة التحكم (المدير) ---------- */
html.wcom-touch .wcom-admin-app .wcom-a-btn{ min-height:46px; padding:10px 16px; font-size:15px; }
html.wcom-touch .wcom-admin-app .wcom-a-table td .wcom-a-btn{ min-height:42px; padding:8px 12px; font-size:13px; }
html.wcom-touch .wcom-admin-app .wcom-a-nav a,
html.wcom-touch .wcom-admin-app .wcom-a-nav button{ min-height:50px; }
html.wcom-touch .wcom-admin-app .wcom-a-table th,
html.wcom-touch .wcom-admin-app .wcom-a-table td{ padding-top:11px; padding-bottom:11px; }
html.wcom-touch .wcom-admin-app .wcom-product-mode-btn{ min-height:50px; }
html.wcom-touch .wcom-admin-app textarea{ font-size:16px; }

/* ---------- أزرار المبالغ السريعة ---------- */
.wcom-quickcash{ display:none; margin:6px 0 2px; }
html.wcom-touch .wcom-quickcash{ display:block; }
.wcom-quickcash-title{ font-size:12px; color:#64748b; margin-bottom:5px; font-weight:700; }
.wcom-quickcash-row{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.wcom-qc{ min-height:46px; border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:10px; font-family:inherit; font-size:15px; font-weight:900; cursor:pointer; }
.wcom-qc.exact{ grid-column:span 2; background:#16a34a; border-color:#16a34a; color:#fff; }
.wcom-qc.pad{ background:#0f172a; border-color:#0f172a; color:#fff; }
.wcom-qc.clr{ background:#fef2f2; border-color:#fecaca; color:#b91c1c; }

/* ---------- لوحة الأرقام ---------- */
.wcom-numpad-bg{ position:fixed; inset:0; z-index:2147483000; background:rgba(15,23,42,.55); display:none; align-items:center; justify-content:center; padding:12px; }
.wcom-numpad-bg.open{ display:flex; }
.wcom-numpad{ width:min(340px,100%); background:#fff; border-radius:20px; padding:14px; box-shadow:0 20px 60px rgba(0,0,0,.35); direction:ltr; touch-action:manipulation; }
.wcom-numpad-title{ direction:rtl; text-align:center; font-size:14px; color:#475569; font-weight:800; margin-bottom:6px; }
.wcom-numpad-display{ direction:ltr; text-align:right; background:#f1f5f9; border:2px solid #cbd5e1; border-radius:12px; padding:10px 14px; min-height:60px; font-size:32px; font-weight:900; color:#0f172a; overflow:hidden; white-space:nowrap; }
.wcom-numpad-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px; }
.wcom-numpad-grid button{ min-height:64px; border:0; border-radius:14px; background:#e2e8f0; color:#0f172a; font-size:26px; font-weight:800; font-family:inherit; cursor:pointer; -webkit-user-select:none; user-select:none; }
.wcom-numpad-grid button:active{ background:#cbd5e1; transform:scale(.96); }
.wcom-numpad-grid .np-back{ background:#fee2e2; color:#b91c1c; }
.wcom-numpad-grid .np-clear{ background:#fef3c7; color:#92400e; font-size:20px; }
.wcom-numpad-actions{ display:grid; grid-template-columns:1fr 2fr; gap:8px; margin-top:10px; direction:rtl; }
.wcom-numpad-actions button{ min-height:58px; border:0; border-radius:14px; font-size:19px; font-weight:900; font-family:inherit; cursor:pointer; }
.wcom-numpad-actions .np-cancel{ background:#e2e8f0; color:#334155; }
.wcom-numpad-actions .np-ok{ background:#16a34a; color:#fff; }

/* ---------- زر تفعيل وضع اللمس ---------- */
.wcom-touch-toggle{ position:fixed; left:12px; bottom:12px; z-index:2147482000; min-width:52px; height:52px; padding:0 14px; border:0; border-radius:26px; background:#0f172a; color:#fff; font-family:inherit; font-size:14px; font-weight:800; box-shadow:0 6px 20px rgba(0,0,0,.3); cursor:pointer; opacity:.88; touch-action:manipulation; display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.wcom-touch-toggle .tt-label{ font-size:13px; }
.wcom-touch-toggle.on{ background:#2563eb; opacity:1; }
/* داخل الشريط العلوي للكاشير */
.wcom-touch-toggle.inline{ position:static; height:auto; min-height:40px; min-width:0; padding:8px 12px; border-radius:9px; box-shadow:none; opacity:1; font-size:14px; }
.wcom-touch-toggle.inline.on{ background:#2563eb!important; color:#fff!important; }
/* داخل قائمة لوحة التحكم */
.wcom-touch-toggle.inline.side{ display:flex; width:calc(100% - 20px); margin:8px 10px; border-radius:10px; background:#1e293b; color:#fff; }
/* الكاشير: نفس مقاس وشكل زر «المزيد» تمامًا في كل الشاشات (34px، حواف دائرية، يُخفي النص ≤720px مثله) */
#wcom-cashier-app .wpc-head-actions #wcom-touch-toggle{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
  box-sizing:border-box!important;position:relative!important;inset:auto!important;order:1;flex:0 0 auto!important;
  width:auto!important;min-width:0!important;height:34px!important;min-height:34px!important;margin:0!important;padding:0 12px!important;
  border-radius:999px!important;border:1px solid rgba(255,255,255,.22)!important;
  background:rgba(255,255,255,.12)!important;color:#fff!important;
  font-family:inherit!important;font-size:12px!important;font-weight:800!important;line-height:1!important;
  white-space:nowrap!important;box-shadow:none!important;opacity:1!important;cursor:pointer!important;transform:none!important;
}
#wcom-cashier-app .wpc-head-actions #wcom-touch-toggle .tt-label{display:inline!important;font-size:12px!important}
#wcom-cashier-app .wpc-head-actions #wcom-touch-toggle span[aria-hidden]{font-size:14px;line-height:1}
#wcom-cashier-app .wpc-head-actions #wcom-touch-toggle.on{background:#2563eb!important;border-color:#2563eb!important;color:#fff!important}
#wcom-cashier-app .wpc-head-actions #wcom-touch-toggle:active{filter:brightness(.93)}
@media (max-width:720px){
  #wcom-cashier-app .wpc-head-actions #wcom-touch-toggle{min-width:40px!important;padding:0 10px!important}
  #wcom-cashier-app .wpc-head-actions #wcom-touch-toggle .tt-label{display:none!important}
}
/* ---------- إخفاء/إظهار الشريط العلوي ---------- */
#wcom-cashier-app .wcom-hdr-btn{ margin-inline-start:auto; display:inline-flex; align-items:center; justify-content:center; gap:6px; height:28px; min-height:28px; padding:0 12px; border:1px solid #cbd5e1; border-radius:999px; background:#f1f5f9; color:#334155; font-family:inherit; font-size:11px; font-weight:800; cursor:pointer; white-space:nowrap; }
#wcom-cashier-app .wcom-hdr-btn:hover{ background:#e2e8f0; }
#wcom-cashier-app.wpc-hdr-hidden .wpc-head,
#wcom-cashier-app.wpc-hdr-hidden .wpc-cashier-status-strip{ display:none!important; }
#wcom-cashier-app.wpc-hdr-hidden{ padding-top:38px!important; }
#wcom-cashier-app.wpc-hdr-hidden .wpc-side{ max-height:calc(100vh - 50px)!important; }
#wcom-cashier-app .wcom-hdr-show{ position:fixed; top:5px; left:50%; transform:translateX(-50%); z-index:1000001; display:inline-flex; align-items:center; gap:7px; height:28px; padding:0 14px; border:1px solid rgba(255,255,255,.25); border-radius:999px; background:rgba(15,23,42,.92); color:#fff; font-family:inherit; font-size:11px; font-weight:800; cursor:pointer; box-shadow:0 4px 14px rgba(15,23,42,.25); white-space:nowrap; }
#wcom-cashier-app .wcom-hdr-show[hidden]{ display:none!important; }
#wcom-cashier-app .wcom-hdr-show .hs-dot{ width:8px; height:8px; border-radius:50%; background:#22c55e; display:inline-block; }
#wcom-cashier-app .wcom-hdr-show .hs-sync{ color:#fbbf24; }
html.wcom-touch #wcom-cashier-app .wcom-hdr-btn{ height:40px; min-height:40px; padding:0 16px; font-size:13px; }
html.wcom-touch #wcom-cashier-app .wcom-hdr-show{ height:34px; top:3px; padding:0 18px; font-size:13px; }
html.wcom-touch #wcom-cashier-app.wpc-hdr-hidden{ padding-top:42px!important; }
@media (max-width:720px){ #wcom-cashier-app .wcom-hdr-btn .hb-label{ display:none; } }
@media print{ #wcom-cashier-app .wcom-hdr-btn, #wcom-cashier-app .wcom-hdr-show{ display:none!important; } }
@media print{ .wcom-touch-toggle,.wcom-numpad-bg,.wcom-quickcash{ display:none!important; } }
