/* ══════════════════════════════════════════════════════════════
   upsell.css — اقتراحات المقبلات والمشروبات (v2/upsell.js)
   يعتمد على متغيّرات site.css فقط. خصائص منطقية ⇒ يعمل RTL وLTR.
   الأعمدة بعرض ثابت لا 1fr (درس Safari على iPhone).
   ══════════════════════════════════════════════════════════════ */
.up-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.up-fly{position:fixed;left:0;top:0;z-index:96;border-radius:50%;background:#fff center/cover no-repeat;pointer-events:none;box-shadow:0 8px 20px -6px rgba(35,24,22,.45)}

/* ── البطاقة الصغيرة ── */
.upt{position:relative;flex:none;width:128px;display:flex;flex-direction:column;gap:6px;padding:6px 6px 8px;border:0;border-radius:18px;background:var(--bg);
  color:var(--ink);font:inherit;text-align:start;cursor:pointer;scroll-snap-align:start;-webkit-tap-highlight-color:transparent;
  transition:transform var(--t-fast) var(--spring),box-shadow var(--t-base) var(--ease),background var(--t-base)}
.upt:active{transform:scale(.95)}
@media (hover:hover){.upt:hover{box-shadow:var(--sh-2);transform:translateY(-2px)}}
.upt__img{position:relative;display:block;width:100%;height:92px;border-radius:13px;overflow:hidden;background:var(--bg-2)}
.upt__img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.upt__q{position:absolute;top:6px;inset-inline-start:6px;min-width:26px;height:24px;padding:0 7px;border-radius:var(--r-full);background:var(--brand);color:#fff;
  font-size:12.5px;font-weight:800;line-height:24px;text-align:center;font-variant-numeric:tabular-nums;box-shadow:0 4px 10px -4px rgba(94,13,24,.7)}
.upt__q{direction:ltr;unicode-bidi:isolate}
.upt__q:empty{display:none}
.upt__n{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.7em;padding-inline:2px;font-size:13.5px;font-weight:700;line-height:1.35}
.upt__f{display:flex;align-items:center;justify-content:space-between;gap:6px;padding-inline:2px}
.upt .price{font-size:14px}
.upt .price small{font-size:10.5px}
.upt__plus{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:50%;background:var(--brand-soft);color:var(--brand);
  transition:background var(--t-base),color var(--t-base),transform var(--t-base) var(--spring)}
.upt__plus svg{width:16px;height:16px}
.upt.is-in{box-shadow:0 0 0 2px var(--brand-soft)}
.upt.is-in .upt__plus{background:var(--brand);color:#fff}
.upt.is-pop .upt__plus{animation:upPop 420ms var(--spring)}
.upt.is-pop .upt__q{animation:upPop 420ms var(--spring)}
@keyframes upPop{40%{transform:scale(1.35) rotate(-8deg)}}

/* ── مجموعة: عنوان + شريط أفقي ── */
.upg + .upg{margin-top:10px}
.upg__h{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:13.5px;font-weight:800;color:var(--ink-2)}
.upg__h svg{width:17px;height:17px;color:var(--brand)}
.upg__rail{display:flex;gap:10px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;
  margin-inline:-14px;padding:2px 14px 6px;scroll-padding-inline:14px;-webkit-overflow-scrolling:touch}
.upg__rail::-webkit-scrollbar{display:none}

/* ═════════ 1) اللوحة بعد إضافة وجبة رئيسية ═════════ */
.ups{position:fixed;z-index:56;inset-inline:10px;bottom:calc(10px + env(safe-area-inset-bottom));max-height:min(78vh,580px);display:flex;flex-direction:column;overflow:hidden;
  padding:8px 14px 14px;border-radius:26px;background:var(--surface);box-shadow:0 0 0 1px var(--line),0 -6px 18px -8px rgba(35,24,22,.18),0 30px 60px -20px rgba(35,24,22,.45);
  transform:translateY(calc(100% + 30px));opacity:0;transition:transform 520ms var(--ease),opacity 220ms var(--ease)}
.ups.is-in{transform:none;opacity:1}
.ups.is-out{transform:translateY(calc(100% + 30px));opacity:0;transition:transform 260ms cubic-bezier(.55,0,.8,.3),opacity 200ms var(--ease) 60ms}
.ups__grab{width:40px;height:5px;margin:0 auto 6px;border-radius:var(--r-full);background:var(--line-2)}
.ups__h{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;margin-bottom:12px;touch-action:pan-x}
.ups__ok{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:var(--ok);color:#fff;animation:upPop 520ms var(--spring) 120ms both}
.ups__ok svg{width:18px;height:18px}
.ups__ht b{display:block;font-size:17px;font-weight:800;line-height:1.3}
.ups__sub{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-3);font-size:13px;line-height:1.5}
.ups__x{width:40px;height:40px;display:grid;place-items:center;border:0;border-radius:50%;background:var(--bg);color:var(--ink-2);transition:background var(--t-fast)}
@media (hover:hover){.ups__x:hover{background:var(--bg-2)}}
.ups__x svg{width:18px;height:18px}
.ups__body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin-inline:-14px;padding-inline:14px}
.ups__h,.ups__grab,.ups__f{flex:none}
.ups__f{display:flex;gap:10px;margin-top:12px}
.ups__f .btn{flex:1 1 0;min-width:0;min-height:46px;padding:0 14px;font-size:15px;white-space:nowrap}
.ups__n{min-width:24px;height:22px;padding:0 7px;border-radius:var(--r-full);background:rgba(255,255,255,.22);font-size:12.5px;line-height:22px;font-variant-numeric:tabular-nums}
/* اللوحة نفسها تقول «في سلّتك» — نُخفي الإشعار الأسود حتى لا يتراكبا */
html.ups-open .toast{opacity:0 !important;pointer-events:none !important}
@media (max-width:760px){.ups .upt{width:116px}.ups .upt__img{height:78px}}
@media (min-width:761px){
  .ups{inset-inline:auto 24px;bottom:24px;width:420px}
  .ups__grab{display:none}
  .ups__h{margin-top:6px}
}

/* ═════════ 2) صفحة السلة: «أكمل وجبتك» ═════════ */
.bk__main{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;min-width:0}
.upc{position:relative;padding:16px 14px 14px;border-radius:var(--r-lg);background:linear-gradient(160deg,var(--gold-soft),var(--surface) 55%);box-shadow:var(--sh-1),0 0 0 1px rgba(194,154,69,.25);
  animation:upIn 560ms var(--ease) both}
.upc__h{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center;margin-bottom:14px}
.upc__ic{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:var(--surface);color:var(--gold-ink);box-shadow:var(--sh-1)}
.upc__ic svg{width:22px;height:22px}
.upc h2{margin:0;font-size:17px;font-weight:800;line-height:1.3}
.upc p{margin:2px 0 0;color:var(--ink-2);font-size:14px;line-height:1.55}
.upc .upt{background:var(--surface);box-shadow:var(--sh-1)}
.upc .upt.is-in{box-shadow:var(--sh-1),0 0 0 2px var(--brand-soft)}
.li--new{animation:upIn 520ms var(--ease) both}
@keyframes upIn{from{opacity:0;transform:translateY(12px) scale(.98)}}

/* ═════════ 3) صفحة الطبق: «يُطلب معه عادةً» ═════════ */
.upw .upw__rail{margin-inline:calc(-1*var(--gutter));padding:8px var(--gutter) 16px;scroll-padding-inline:var(--gutter);gap:14px}
.upw .upt{width:156px;background:var(--surface);box-shadow:var(--sh-1);padding:8px 8px 10px}
.upw .upt.is-in{box-shadow:var(--sh-1),0 0 0 2px var(--brand-soft)}
.upw .upt__img{height:112px}
@media (max-width:760px){.upw .upt{width:140px}.upw .upt__img{height:100px}}

@media (prefers-reduced-motion:reduce){
  .ups,.ups.is-out,.upt,.upt__plus{transition:none}
  .ups__ok,.upc,.li--new,.upt.is-pop .upt__plus,.upt.is-pop .upt__q{animation:none}
}
