/* واجهة الكاشير: شاشة لمس أفقية، داكنة حتى تبرز صور البيتزا المصوّرة على الحجر الأسود */
:root {
  --bg: #111110;
  --panel: #1b1a18;
  --panel-2: #24221f;
  --line: #34312c;
  --text: #f4efe6;
  --muted: #a39d92;
  --green: #008c45;
  --green-2: #00a853;
  --red: #ce2b37;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, .14);
  --radius: 16px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; overflow: hidden; user-select: none; -webkit-user-select: none; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: #ff6b75; min-height: 1.4em; margin: 8px 0 0; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

.screen { position: fixed; inset: 0; }
.center { display: grid; place-items: center; padding: 16px; overflow: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.narrow { width: min(440px, 100%); text-align: center; }
.narrow label { display: block; text-align: right; margin: 14px 0; color: var(--muted); }
.logo-lg { width: 84px; height: 84px; border-radius: 22px; }
h1 { font-size: 26px; margin: 12px 0 6px; }

input, textarea, select {
  width: 100%; margin-top: 6px; padding: 14px 16px; font: inherit; font-size: 18px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 14px; font-size: 17px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.btn.danger { color: #ff7b84; }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.xl { width: 100%; min-height: 62px; font-size: 20px; margin-top: 10px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.icon-btn { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; background: var(--panel-2); border: 1px solid var(--line); }

/* شاشة القفل */
.lock-box { width: min(380px, 100%); text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; height: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); }
.lock-user { text-align: center; font-size: 22px; font-weight: 600; margin-top: 4px; }
.lock-recent { justify-content: center; margin: 10px 0 0; }
.lock-recent button { padding: 8px 14px; }
.confirm-amount { text-align: center; font-size: 18px; line-height: 1.8; padding: 10px 0; }
.confirm-amount b { font-size: 36px; color: var(--gold); display: block; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; direction: ltr; }
.keypad button { height: 72px; border-radius: 18px; font-size: 28px; font-weight: 600; background: var(--panel); border: 1px solid var(--line); }
.keypad button:active { background: var(--panel-2); }
.keypad button.wide { font-size: 18px; }

/* الشريط العلوي */
.topbar { height: 72px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand img { width: 42px; height: 42px; border-radius: 12px; }
.channels { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px; }
.channels::-webkit-scrollbar { display: none; }
.channels button { flex: 0 0 auto; min-height: 50px; padding: 0 16px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.channels button.on { color: #fff; background: var(--green); border-color: var(--green); }
.channels button.app.on { background: #6b3fa0; border-color: #6b3fa0; }
.channels button .tag { font-size: 11px; font-weight: 500; opacity: .8; margin-inline-start: 6px; }
.chip { min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.chip.online .dot { background: var(--green-2); box-shadow: 0 0 0 4px rgba(0,168,83,.18); }
.chip.offline .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(206,43,55,.2); }
.chip.pending .dot { background: var(--gold); }

/* منطقة البيع */
.sale { position: absolute; top: 72px; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr 400px; }
.catalog { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cats { display: flex; gap: 8px; padding: 12px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: 0 0 auto; min-height: 56px; padding: 0 20px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line); font-size: 17px; font-weight: 600; }
.cats button small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.cats button.on { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.cats button.on small { color: #4b3c0c; }
.grid { flex: 1; overflow-y: auto; padding: 4px 12px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; }
.section-title { grid-column: 1 / -1; margin: 14px 4px 0; font-size: 18px; font-weight: 700; color: var(--gold); }
.section-title small { color: var(--muted); font-weight: 400; font-size: 13px; margin-inline-start: 8px; }

.item { position: relative; display: flex; flex-direction: column; text-align: right; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .08s; }
.item:active { transform: scale(.97); }
.item .img { flex-shrink: 0; width: 100%; aspect-ratio: 1 / 1; background: #0b0b0a center / cover no-repeat; }
.item .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.item .name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.item .price { color: var(--gold); font-weight: 700; font-size: 17px; }
.item .info { position: absolute; top: 8px; left: 8px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.item .badge { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; background: var(--gold); color: #1a1405; }
.item .count { position: absolute; top: 8px; right: 8px; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 18px; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 17px; }
.item.off { opacity: .45; }
.item.off::after { content: 'نفد'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: #fff; background: rgba(0,0,0,.45); }
.item.offer { grid-column: span 2; }
.item.offer .img { aspect-ratio: 2 / 1; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); }
.item.offer .img span { background: center / cover no-repeat; }
.item.offer .name { font-size: 19px; }
.item .desc { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* السلة */
.cart { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-inline-start: 1px solid var(--line); }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cart-title { font-size: 18px; font-weight: 700; }
.lines { flex: 1; overflow-y: auto; padding: 8px; }
.empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 8px; }
.line .ln-name { font-weight: 700; font-size: 16px; }
.line .ln-sub { grid-column: 1 / -1; color: var(--muted); font-size: 13px; line-height: 1.6; }
.line .ln-sub b { color: var(--gold); font-weight: 600; }
.line .ln-total { font-weight: 700; color: var(--text); }
.qty { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.qty button { width: 48px; height: 44px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 22px; font-weight: 700; }
.qty .q { min-width: 34px; text-align: center; font-size: 19px; font-weight: 700; }
.qty .edit { width: auto; padding: 0 14px; font-size: 14px; margin-inline-start: auto; }
.cart-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); font-size: 16px; }
.sum-row.discount { color: #7ee2a8; }
.sum-row.total { color: var(--text); font-size: 26px; font-weight: 700; padding-top: 6px; }
.foot-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.foot-actions .btn { min-height: 46px; font-size: 15px; }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay .btn { min-height: 70px; font-size: 21px; }
.pay .btn.full { grid-column: 1 / -1; }
.pay .btn small { display: block; font-size: 12px; font-weight: 500; opacity: .85; }

/* النوافذ المنبثقة */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.sheet { width: min(620px, 100%); max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px; animation: pop .14s ease-out; }
.sheet.wide { width: min(980px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.sheet .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet .actions .btn { flex: 1; min-height: 60px; font-size: 18px; }
.sheet label { display: block; margin: 12px 0; color: var(--muted); }
.close { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; background: var(--panel-2); border: 1px solid var(--line); }
.info-img { width: 100%; aspect-ratio: 16 / 10; border-radius: 16px; background: #000 center / cover; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chips span, .chips button { padding: 10px 14px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; }
.chips button.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.price-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.price-pair div { padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.price-pair b { display: block; font-size: 22px; color: var(--gold); margin-top: 4px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); margin: 8px 0; }
.stepper .ctr { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 54px; height: 50px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 24px; font-weight: 700; }
.stepper .q { min-width: 30px; text-align: center; font-size: 22px; font-weight: 700; }
.drink-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.drink { border-radius: 14px; overflow: hidden; background: var(--bg); border: 2px solid var(--line); text-align: center; }
.drink.on { border-color: var(--gold); }
.drink .img { aspect-ratio: 1; background: #000 center / cover; }
.drink .nm { padding: 8px 6px 4px; font-weight: 600; }
.drink .ctr { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 6px 6px 10px; }
.drink .ctr button { width: 44px; height: 42px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 20px; font-weight: 700; }
.big-total { text-align: center; padding: 10px 0 16px; }
.big-total .v { font-size: 46px; font-weight: 700; color: var(--gold); }
.cash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.cash-grid .btn { min-height: 62px; font-size: 20px; }
.change { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); font-size: 20px; }
.change b { font-size: 32px; }
.change.ok b { color: #7ee2a8; }
.change.short b { color: #ff7b84; }
.menu-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-list .btn { min-height: 76px; justify-content: flex-start; font-size: 18px; padding: 0 18px; }
.menu-list .btn span { font-size: 26px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; }
.table tr.click { cursor: pointer; }
.table tr.void td { color: var(--muted); text-decoration: line-through; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 10px 0; }
.kv span:nth-child(odd) { color: var(--muted); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.seg button { padding: 12px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; }
.seg button.on { background: var(--green); border-color: var(--green); color: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box { padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); margin: 10px 0; }
.previews { display: flex; gap: 16px; overflow-x: auto; align-items: flex-start; padding: 6px; }
.previews figure { margin: 0; text-align: center; }
.previews figcaption { color: var(--muted); margin-bottom: 8px; }
.previews canvas { width: 300px; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }

/* تنبيهات */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 14px 22px; border-radius: 14px; background: #2c2a26; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 17px; font-weight: 600; display: flex; gap: 14px; align-items: center; animation: pop .15s; }
.toast.ok { background: #0f3d26; border-color: var(--green); }
.toast.bad { background: #4a1419; border-color: var(--red); }
.toast button { padding: 8px 14px; border-radius: 10px; background: rgba(255,255,255,.12); font-weight: 700; }

@media (max-width: 1100px) { .sale { grid-template-columns: 1fr 350px; } .brand span { display: none; } .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 760px) {
  .sale { grid-template-columns: 1fr; grid-template-rows: 1fr 46vh; }
  .cart { border-inline-start: 0; border-top: 1px solid var(--line); }
  .item.offer { grid-column: span 2; }
  .topbar { gap: 6px; }
  .chip span { display: none; }
}
