/* ============================================================
   SMILE — checkout: how to pay, the card machine, the receipt (js/pay.js).
   Motion: transform / opacity only, one pass each, nothing loops.
   ============================================================ */
#sheetPay { background: #FFFFFF; }
html.phone #sheetPay { top: 0; max-height: none; border-radius: 0; z-index: 76; padding-top: env(safe-area-inset-top, 0px); }
html.phone #sheetPay .sheet__handle { display: none; }
#sheetPay .sheet__head h3 { font: 700 24px/1.45 var(--font-display); }
#sheetPay .sheet__foot { background: #FFFFFF; border-top: 1px solid var(--sh-line, #E3E3DF); }
.pay { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 4px; }
.pay__sum { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--sh-soft, #F3F3F1); }
.pay__thumbs { display: flex; }
.pay__thumbs img { width: 40px; height: 48px; border-radius: 10px; object-fit: cover; border: 2px solid #FFFFFF; background: #FFFFFF; }
.pay__thumbs img + img { margin-inline-start: -14px; }
.pay__sumtx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pay__sumtx b { font-size: 14px; }
.pay__sumtx small { font-size: 12px; color: var(--sh-muted, #77766F); }
.pay__total { font-size: 17px; font-weight: 800; white-space: nowrap; }
.pay__h { margin: 4px 0 0; font-size: 15px; font-weight: 800; }
.pay__methods { display: grid; gap: 8px; }
.paym { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--sh-line, #E3E3DF); border-radius: 16px; background: #FFFFFF; color: var(--sh-ink, #141413); font: inherit; text-align: start; cursor: pointer; transition: transform .12s; }
.paym:active { transform: scale(.985); }
.paym.on { border-color: #141413; box-shadow: inset 0 0 0 1px #141413; }
.paym__ic { width: 42px; height: 42px; border-radius: 12px; background: var(--sh-soft, #F3F3F1); display: grid; place-items: center; flex-shrink: 0; }
.paym__ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.paym__ic svg.fill { fill: currentColor; stroke: none; }
.paym.on .paym__ic { background: var(--sh-yellow, #FFE45C); }
.paym__t { flex: 1; display: grid; gap: 2px; }
.paym__t b { font-size: 15px; }
.paym__t small { font-size: 12px; color: var(--sh-muted, #77766F); }
.paym__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C9C9C4; flex-shrink: 0; display: grid; place-items: center; }
.paym.on .paym__dot { border-color: #141413; }
.paym.on .paym__dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #141413; }
.pay__lines { display: grid; gap: 6px; padding: 4px 2px; font-size: 14px; }
.pay__lines div { display: flex; justify-content: space-between; }
.pay__lines .save { color: #1E7B45; font-weight: 700; }
.pay__safe, .payform__note { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12px; color: var(--sh-muted, #77766F); line-height: 1.6; }
.pay__safe svg, .payform__note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pay__go { height: 54px; font-size: 16px; background: #141413; color: #FFFFFF; }
.pay__go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.pay__demo { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--sh-muted, #77766F); }

/* ---------- the machine on the cashier's desk ---------- */
.pos-scene { position: relative; height: 392px; margin: 0 -16px; perspective: 900px; overflow: hidden;
  background: linear-gradient(180deg, #FAFAF8 0%, #F1F1EE 62%, #E4E3DE 62.2%, #ECEBE7 100%); }
.pos-desk { position: absolute; inset-inline: 0; top: 62%; height: 1px; background: rgba(0,0,0,.06); }
.pos-desk::after { content: ""; position: absolute; left: 50%; top: 108px; width: 230px; height: 40px; margin-left: -115px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.28), rgba(0,0,0,0)); }
.pos { position: absolute; left: 50%; top: 64px; width: 168px; height: 288px; margin-left: -84px; border-radius: 26px 26px 34px 34px;
  background: linear-gradient(160deg, #3A3A37 0%, #1E1E1C 45%, #121211 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 18px 30px -12px rgba(0,0,0,.45);
  transform: rotateX(16deg); transform-origin: 50% 100%; }
.pos__printer { position: absolute; top: 10px; left: 22px; right: 22px; height: 10px; border-radius: 6px; background: #0A0A09; box-shadow: inset 0 2px 3px rgba(0,0,0,.8); overflow: visible; }
/* the paper waits inside the machine and rises out of the slot when the bank says yes */
.pos__out { position: absolute; left: 30px; right: 30px; bottom: calc(100% - 15px); height: 56px; overflow: hidden; pointer-events: none; }
.pos__paper { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, #FFFFFF 0 6px, #F2F2EE 6px 7px); border-radius: 2px 2px 0 0; box-shadow: 0 -2px 6px rgba(0,0,0,.08); transform: translateY(100%); }
.pos__led { position: absolute; top: 28px; right: 18px; width: 7px; height: 7px; border-radius: 50%; background: #56544E; }
.pos__led::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #38D46A; box-shadow: 0 0 10px #38D46A; opacity: 0; transition: opacity .25s; }
.pos.approved .pos__led::after { opacity: 1; }
.pos__screen { position: absolute; top: 40px; left: 16px; right: 16px; height: 104px; border-radius: 12px; padding: 8px 10px; display: grid; align-content: start; gap: 2px; text-align: center;
  background: linear-gradient(180deg, #F4F8F5, #E3ECE6); color: #1B2A20; box-shadow: inset 0 0 0 2px #0C0C0B, inset 0 3px 8px rgba(0,0,0,.12); overflow: hidden; }
.pos__screen small { font-size: 9.5px; letter-spacing: .06em; opacity: .65; }
.pos__amt { font: 800 22px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; direction: ltr; }
.pos__amt span { font: 700 12px/1 "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif; direction: rtl; unicode-bidi: isolate; }
.pos__msg { font-size: 11.5px; font-weight: 700; line-height: 1.35; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; }
.pos__msg svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pos__msg.ok { color: #16813F; }
.pos__msg.big { font-size: 14px; }
.pos__dots { display: inline-flex; gap: 3px; }
.pos__dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: posDot .9s infinite ease-in-out; }
.pos__dots i:nth-child(2) { animation-delay: .15s; } .pos__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes posDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.pos__keys { position: absolute; top: 156px; left: 20px; right: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 9px; }
.pos__keys i { position: relative; height: 20px; border-radius: 6px; background: linear-gradient(180deg, #4A4A46, #34342F); color: #EDEDE8; font: 700 10px/20px ui-monospace, monospace; font-style: normal; text-align: center; box-shadow: 0 2px 0 #0B0B0A; transition: transform .08s; }
.pos__keys i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(255,228,92,.55); opacity: 0; transition: opacity .08s; }
.pos__keys i.down { transform: translateY(2px); }
.pos__keys i.down::after { opacity: 1; }
.pos__keys i.x { background: linear-gradient(180deg, #D0473C, #A8342B); }
.pos__keys i.ok { background: linear-gradient(180deg, #2FA35A, #217A42); }
.pos__slot { position: absolute; bottom: 12px; left: 30px; right: 30px; height: 6px; border-radius: 4px; background: #070707; }

/* the card (or the phone) that lands on the machine */
.pos-token { position: absolute; left: 50%; top: 263px; opacity: 0; transform-origin: 50% 100%; z-index: 3; pointer-events: none; }
.pos-token.in { opacity: 1; }
.pos-card { width: 150px; height: 94px; margin-left: -75px; border-radius: 12px; color: #141413; box-shadow: 0 16px 26px -10px rgba(0,0,0,.45);
  background: radial-gradient(120% 90% at 100% 0%, #FFF3A6 0%, rgba(255,243,166,0) 55%), linear-gradient(135deg, #FFE45C 0%, #F6C92B 100%); transform: rotate(-6deg) rotateX(28deg); }
.pos-card__chip { position: absolute; top: 30px; right: 16px; width: 26px; height: 20px; border-radius: 5px; background: linear-gradient(135deg, #E9D08B, #BD9A45); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.pos-card__chip::before { content: ""; position: absolute; inset: 6px 0; border-top: 1px solid rgba(0,0,0,.25); border-bottom: 1px solid rgba(0,0,0,.25); }
.pos-card__nfc { position: absolute; top: 30px; right: 48px; width: 18px; height: 18px; }
.pos-card__nfc svg { width: 18px; height: 18px; fill: none; stroke: #141413; stroke-width: 1.8; stroke-linecap: round; opacity: .7; }
.pos-card__logo { position: absolute; top: 8px; right: 14px; font: 700 17px/1.2 var(--font-display); }
.pos-card__num { position: absolute; bottom: 10px; right: 14px; direction: ltr; font: 700 12px/1 ui-monospace, monospace; letter-spacing: .06em; }
.pos-card__visa { position: absolute; bottom: 8px; left: 12px; font: italic 900 15px/1 system-ui, sans-serif; letter-spacing: -.02em; color: #1A1F71; }
.pos-phone { width: 76px; height: 132px; margin-left: -38px; top: 246px; border-radius: 18px; background: #141413; border: 3px solid #3A3A37; color: #FFFFFF; display: grid; place-items: center; align-content: center; gap: 6px; box-shadow: 0 16px 26px -10px rgba(0,0,0,.45); transform: rotate(-6deg) rotateX(28deg); }
.pos-phone__notch { position: absolute; top: 6px; left: 50%; width: 26px; height: 6px; margin-left: -13px; border-radius: 4px; background: #000; }
.pos-phone span { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; }
.pos-phone span svg { width: 16px; height: 16px; fill: #FFFFFF; stroke: none; }
.pos-phone small { font-size: 10px; opacity: .8; }

/* contactless: three rings, once */
.pos-waves { position: absolute; left: 50%; top: 306px; width: 0; height: 0; z-index: 4; pointer-events: none; }
.pos-waves i { position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%; border: 2px solid rgba(255,228,92,.95); opacity: 0; }
.pos-waves.go i { animation: posWave .9s cubic-bezier(.2,.7,.3,1) forwards; }
.pos-waves.go i:nth-child(2) { animation-delay: .14s; } .pos-waves.go i:nth-child(3) { animation-delay: .28s; }
@keyframes posWave { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.2); } }

/* the card details (a test card, written by itself, not typeable) */
.payform { display: grid; gap: 10px; }
.payform[hidden] { display: none; }
.payform__card { display: grid; gap: 10px; padding: 14px; border-radius: 18px; border: 1px solid var(--sh-line, #E3E3DF); }
.payform label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--sh-ink2, #45443F); }
.payform input { width: 100%; min-width: 0; box-sizing: border-box; height: 46px; border-radius: 12px; border: 1.5px solid var(--sh-line, #E3E3DF); background: var(--sh-soft, #F3F3F1); padding-inline: 12px; font: 700 16px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #141413; text-align: left; letter-spacing: .04em; pointer-events: none; }
.payform label.on input { border-color: #141413; background: #FFFFFF; }
.payform label.done input { background: #FFFFFF; }
.payform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cliq { display: grid; gap: 10px; }
.cliq__alias { display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 14px; background: var(--sh-soft, #F3F3F1); }
.cliq__alias small { font-size: 12px; color: var(--sh-muted, #77766F); }
.cliq__alias b { font: 800 22px/1.2 ui-monospace, monospace; letter-spacing: .08em; }

/* ---------- the receipt ---------- */
.pay--rc { padding-bottom: 8px; }
.rc { position: relative; display: grid; justify-items: center; padding-top: 6px; }
.rc__mouth { position: relative; z-index: 2; width: min(330px, 92%); height: 18px; border-radius: 10px; background: linear-gradient(180deg, #2B2B29, #141413); box-shadow: 0 6px 12px -6px rgba(0,0,0,.5); }
.rc__mouth i { position: absolute; left: 14px; right: 14px; top: 7px; height: 4px; border-radius: 3px; background: #050505; }
.rc__clip { width: min(300px, 84%); margin-top: -8px; overflow: hidden; padding-bottom: 14px; }
.rc__paper { position: relative; padding: 22px 16px 26px; background: #FFFEFB; color: #1E1E1C; font-size: 12.5px; line-height: 1.5; box-shadow: 0 10px 22px -12px rgba(0,0,0,.35);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 8px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 8px repeat-x; }
.rc__head { display: grid; justify-items: center; gap: 1px; text-align: center; }
.rc__logo { font: 700 26px/1.3 var(--font-display); }
.rc__head small { font-size: 10.5px; color: #6F6E68; }
.rc__cut { border-top: 1.5px dashed #BDBCB6; margin: 10px 0; }
.rc__cut--double { border-top: 3px double #8F8E88; }
.rc__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rc__row b, .rc__row span:last-child { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.rc__row [dir="ltr"] { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.rc__item { margin-bottom: 6px; }
.rc__item small { display: block; font-size: 11px; color: #6F6E68; }
.rc__name { font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.rc__total { font-size: 15px; }
.rc__total > span:first-child { font-weight: 800; }
.rc__total b { font-size: 16px; font-weight: 800; }
.rc__ok { display: inline-flex; align-items: center; gap: 3px; color: #16813F; }
.rc__ok svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; }
.rc__bar { display: block; width: 86%; height: 40px; margin: 4px auto 0; fill: #1E1E1C; }
.rc__no { margin: 4px 0 8px; text-align: center; font: 700 11px/1 ui-monospace, monospace; letter-spacing: .3em; }
.rc__thanks { margin: 0; text-align: center; font: 700 18px/1.5 var(--font-display); display: flex; align-items: center; justify-content: center; gap: 6px; }
.rc__thanks svg { width: 22px; height: 22px; fill: none; stroke: #1E1E1C; stroke-width: 4; stroke-linecap: round; }
.rc__small { margin: 4px 0 0; text-align: center; font-size: 10.5px; color: #6F6E68; }
.rc__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc__acts[hidden] { display: none; }
.rc__acts .btn { height: 50px; }
.rc__acts .btn--ink { background: #141413; color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .pos__dots i, .pos-waves.go i { animation: none; }
  .pos-token { opacity: 1; }
}

/* ---------- the bag that pops up after «أضف للحقيبة» (a new place each time, tilted like a sticker) ---------- */
.bp { position: fixed; z-index: 82; display: none; }
.bp__card { position: relative; transform: rotate(var(--tilt, 0deg)); padding: 14px; border-radius: 22px; background: #FFFFFF; color: #141413; box-shadow: 0 22px 50px -18px rgba(0,0,0,.4), 0 0 0 1px rgba(0,0,0,.05); display: grid; gap: 10px; }
.bp__x { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #F3F3F1; color: #141413; display: grid; place-items: center; cursor: pointer; }
.bp__x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.bp__top { display: flex; align-items: center; gap: 10px; }
.bp__bagbtn { position: relative; width: 46px; height: 46px; border: 0; border-radius: 14px; background: #FFE45C; color: #141413; display: grid; place-items: center; cursor: pointer; }
.bp__bagbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bp__n { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #141413; color: #FFFFFF; font: 700 11px/20px var(--font-body); }
.bp__yay { font: 700 20px/1.3 var(--font-display); }
.bp__item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #F6F6F3; }
.bp__img { width: 50px; height: 60px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #EDEDEA; }
.bp__img img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(.7); transition: opacity .25s, transform .35s cubic-bezier(.2,.9,.3,1.3); }
.bp__img.in img { opacity: 1; transform: none; }
.bp__item div { display: grid; gap: 2px; min-width: 0; }
.bp__item b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp__item small { font-size: 12px; color: #77766F; }
.bp__sum { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.bp__sum em { font-style: normal; font-size: 12px; color: #1B7446; font-weight: 700; text-align: end; }
.bp__acts { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; }
.bp__buy, .bp__more { height: 46px; border-radius: 12px; font: 700 14.5px/1 var(--font-body); cursor: pointer; }
.bp__buy { border: 0; background: #141413; color: #FFFFFF; }
.bp__more { border: 1.5px solid #141413; background: #FFFFFF; color: #141413; }
.bp__buy:active, .bp__more:active { transform: scale(.97); }

/* ---------- the card details, clear: a step counter, a big card that fills in live and turns for the CVV ---------- */
.pf__steps { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.pf__steps b { font: 700 12px/1 var(--font-body); background: #141413; color: #FFFFFF; padding: 6px 10px; border-radius: 999px; }
.pf__steps span { font: 700 16px/1.4 var(--font-body); }
.pf__wrap { perspective: 900px; display: grid; justify-items: center; padding: 6px 0 2px; }
.pf__card { position: relative; width: min(320px, 100%); aspect-ratio: 1.586; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,.7,.3,1); }
.pf__card.flip { transform: rotateY(180deg); }
.pf__face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; color: #141413; box-shadow: 0 18px 34px -16px rgba(0,0,0,.45);
  background: radial-gradient(120% 90% at 100% 0%, #FFF3A6 0%, rgba(255,243,166,0) 55%), linear-gradient(135deg, #FFE45C 0%, #F6C92B 100%); }
.pf__back { transform: rotateY(180deg); }
.pf__chip { position: absolute; top: 42px; right: 22px; width: 40px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #E9D08B, #BD9A45); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.pf__logo { position: absolute; top: 12px; right: 20px; font: 700 22px/1.3 var(--font-display); }
.pf__num { position: absolute; left: 20px; right: 20px; top: 50%; direction: ltr; text-align: left; font: 700 clamp(16px, 5.4vw, 21px)/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; }
.pf__nm, .pf__ex { position: absolute; bottom: 16px; display: grid; gap: 2px; direction: ltr; text-align: left; }
.pf__nm { left: 20px; max-width: 55%; }
.pf__ex { left: 62%; }
.pf__nm small, .pf__ex small { font: 600 9px/1 var(--font-body); opacity: .7; direction: rtl; text-align: left; }
.pf__nm b, .pf__ex b { font: 700 13px/1.2 ui-monospace, monospace; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf__visa { position: absolute; bottom: 14px; right: 18px; font: italic 900 20px/1 system-ui, sans-serif; color: #1A1F71; }
.pf__strip { position: absolute; top: 24px; left: 0; right: 0; height: 40px; background: #1B1B1A; }
.pf__cvvbox { position: absolute; top: 84px; left: 20px; right: 20px; height: 38px; border-radius: 6px; background: #FFFFFF; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 12px; direction: ltr; }
.pf__cvvbox small { font: 600 10px/1 var(--font-body); color: #77766F; }
.pf__cvvbox b { font: 800 18px/1 ui-monospace, monospace; letter-spacing: .12em; }
.pf__back p { position: absolute; bottom: 14px; left: 20px; right: 20px; margin: 0; font-size: 11.5px; text-align: center; }
.payform label { position: relative; }
.payform label small { font-weight: 500; font-size: 11.5px; color: var(--sh-muted, #77766F); }
.payform label.on small { color: #141413; }
.payform label.on::after { content: "بتنكتب هلأ"; position: absolute; top: 0; left: 0; font-size: 10.5px; font-weight: 700; color: #141413; background: #FFE45C; border-radius: 999px; padding: 2px 8px; }
.payform input::placeholder { color: #BDBCB6; }
@media (prefers-reduced-motion: reduce) { .pf__card { transition: none; } }
