/* The product window, the checkout, the confirmation, «طلباتي» without an account, the WhatsApp button, and finger-sized
   tap areas. Loaded after store.css; everything follows the store's own colours (light and dark) and reads right to left. */

/* ---- the product window: photo → price → name → colours → size → quantity → notes (item-ux.js) ---------------- */
.it-media,.it-opts{display:contents}
.ip{display:flex;flex-direction:column;gap:6px;margin-top:-2px}
.ip-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.ip-price{display:flex;flex-direction:column;gap:2px;min-width:0}
.ip-now{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-variant-numeric:tabular-nums}
.ip-now b{font:800 27px/1.15 var(--display);letter-spacing:-.01em;color:var(--ink)}
.ip-now b.ip-ask{font-size:20px}
.ip-now s.was{font-size:15px;margin:0}
.ip-per{font-size:13px;color:var(--muted)}
.ip-sub{font-size:12.5px;color:var(--muted);line-height:1.5}
.ip-sub:empty{display:none}
.ip .sale-note{margin-top:0}
.ip-rate{flex:none;margin:4px 0 0;padding:4px 10px;border-radius:999px;background:var(--sunk);border:1px solid var(--line)}
/* the photo and the live preview take the same room, so nothing jumps when one replaces the other */
.it-body .dlg-media>.dlg-photo,.it-body .dlg-media>.dlg-paint{aspect-ratio:4/3;max-height:300px;width:100%}
.it-body .dlg-photo img{width:100%;height:100%;max-height:none;object-fit:contain}
.it-body .dlg-paint .paint-live{max-height:100%}
.dlg-foot:has(.it-add){flex-wrap:nowrap}
.dlg-foot .it-add{flex:1 1 0;min-width:0;min-height:48px;font-size:16px;gap:9px;padding-inline:14px;white-space:nowrap}
.dlg-foot:has(.it-add)>.btn.ghost{flex:none;padding-inline:16px}
.it-add-dot{opacity:.55;font-weight:400}
.it-add-price{font-variant-numeric:tabular-nums;font-weight:800;white-space:nowrap}
.est:empty{display:none}
.it-about{border-top:1px dashed var(--line);padding-top:12px}
.it-about p{margin:6px 0 0;line-height:1.85}
/* «الألوان»: the first few, then «كل الألوان (29)» */
.swatch.sw-more,.sw-sep.sw-more{display:none}
.swatch.sw-all{color:var(--accent);font-weight:600}
.swatch.sw-all i{background:conic-gradient(from 200deg,#e53935,#fb8c00,#fdd835,#43a047,#1e88e5,#8e24aa,#e53935);border-color:transparent;box-shadow:none}
.swatch.sw-all i::after{content:attr(data-n);inset:7px;display:grid;place-items:center;font:700 11.5px/1 var(--body);color:var(--ink);background:var(--surface);border:0}
.swatch.sw-all[aria-expanded="true"] i{background:var(--sunk);border-color:var(--line)}
/* a computer: the photo stays beside the choices */
@media (min-width:900px){
 dialog:has(>.it-body>.it-media){width:min(1100px,94vw)}
 .it-body:has(>.it-media){display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:30px;align-items:start;padding:22px 26px 26px}
 .it-media{display:flex;flex-direction:column;gap:10px;position:sticky;top:86px;z-index:1}
 .it-opts{display:flex;flex-direction:column;gap:16px;min-width:0}
 .it-media .dlg-media.stick{position:relative;top:auto}
 .it-body .dlg-media>.dlg-photo,.it-body .dlg-media>.dlg-paint{max-height:min(60vh,520px)}
 .it-media .dlg-paint{box-shadow:none}
 .ip-now b{font-size:30px}
 /* the add button sits under the choices, not across the whole window */
 dialog:has(>.it-body>.it-media) .dlg-foot .it-add{flex:0 1 calc((100% - 30px) * .48)}
}

/* ---- the checkout (checkout-ux.js) ----------------------------------------------------------------------- */
.need-by{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:500;min-width:0}
.need-by #nb-label small{color:var(--muted);font-weight:400}
/* three taps side by side, like one control */
.nb-chips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:12px;padding:3px;background:var(--sunk)}
.nb-chip{border:0;background:transparent;border-radius:9px;padding:9px 6px;min-height:42px;font-weight:600;font-size:13.5px;line-height:1.3;text-align:center;color:var(--muted)}
.nb-chip[aria-pressed="true"]{background:var(--surface);color:var(--accent);box-shadow:0 1px 3px color-mix(in srgb,var(--ink) 18%,transparent);border:0}
.nb-chip::before{inset:-2px 0}
.need-by input[type=date]{max-width:280px}
.nb-note{display:flex;flex-direction:column;gap:3px;font-size:13px}
.nb-note:empty{display:none}
.nb-day{font-weight:700;color:var(--ink)}
.nb-warn{color:var(--warn);font-weight:600;font-size:12.5px;line-height:1.6}
.sum .eta-box{display:flex;flex-direction:column;gap:2px}
.eta-box .eta{margin-top:6px}
.sum .eta-wait{display:block;margin-top:2px;font-size:12.5px;line-height:1.65;color:var(--warn);font-weight:600}
.wait-line{font-size:12px;line-height:1.6;color:var(--warn);font-weight:600;margin:1px 0 2px}
/* «تأكد من الكتابة» */
.spell{margin-top:14px;border:1.5px solid color-mix(in srgb,var(--accent) 35%,var(--line));border-radius:16px;padding:12px 14px;background:color-mix(in srgb,var(--accent) 5%,var(--surface));display:flex;flex-direction:column;gap:10px}
.sp-head{display:flex;flex-direction:column;gap:1px}
.sp-head b{font-size:15px}
.sp-head small{color:var(--muted);font-size:12.5px;line-height:1.55}
.sp-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.sp-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 10px;padding:9px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
.sp-plates{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-width:0}
.sp-plate{display:inline-block;max-width:100%;padding:2px 12px;border-radius:9px;background:var(--ink);color:var(--bg);font:700 17px/1.55 var(--display);letter-spacing:.02em;white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate}
.sp-more{font-size:12.5px;font-weight:700;color:var(--muted)}
.sp-what{grid-column:1;font-size:12px;color:var(--muted)}
.sp-edit{grid-column:2;grid-row:1/span 2;font-weight:600}
.sp-tick{display:flex;align-items:center;gap:10px;min-height:46px;padding:8px 12px;border-radius:12px;border:1.5px dashed var(--accent);background:var(--surface);font-weight:700;cursor:pointer}
.sp-tick input{width:20px;height:20px;margin:0;flex:none;accent-color:var(--ok)}
.sp-tick:has(input:checked){border-style:solid;border-color:var(--ok);color:var(--ok);background:color-mix(in srgb,var(--ok) 8%,var(--surface))}

/* ---- the confirmation ----------------------------------------------------------------------------------- */
dialog.od-dlg{width:min(520px,94vw)}
.dlg-body.od{gap:12px;padding:16px 18px 20px}
.od-hero{display:flex;flex-direction:column;align-items:center;gap:2px}
.od-check{display:grid;place-items:center;width:76px;height:76px;border-radius:50%;background:color-mix(in srgb,var(--ok) 13%,var(--surface));animation:od-pop .45s cubic-bezier(.2,.8,.2,1) both}
.od-check svg{display:block}
.od-ring{fill:none;stroke:var(--ok);stroke-width:2.5;opacity:.3}
.od-tick{fill:none;stroke:var(--ok);stroke-width:4.2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:40;stroke-dashoffset:40;animation:od-tick .5s .2s cubic-bezier(.65,0,.35,1) forwards}
@keyframes od-tick{to{stroke-dashoffset:0}}
@keyframes od-pop{from{transform:scale(.6);opacity:0}}
.od-lead{margin-top:8px;font-size:13px;color:var(--muted)}
.od-code{display:inline-flex;align-items:center;gap:10px;min-height:46px;border:1.5px dashed var(--line);background:var(--sunk);border-radius:12px;padding:5px 16px;font:700 24px/1.25 var(--mono);letter-spacing:.06em;color:color-mix(in srgb,var(--hot) 82%,#000);cursor:pointer}
.od-code:hover{border-color:var(--accent)}
.od-copy{font:400 17px/1 var(--body);color:var(--muted)}
.btn.wa.od-wa{width:100%;max-width:400px;align-self:center;min-height:56px;gap:10px;box-shadow:0 12px 26px -14px #1f9d55}
.od-one{margin:0;font-size:14.5px;font-weight:600}
.od-track{display:flex;flex-direction:column;align-items:center;gap:4px}
.od-track .btn{min-height:44px}
.od-text{text-align:start;border-top:1px dashed var(--line);padding-top:4px}
.od-text summary{cursor:pointer;font-weight:600;color:var(--accent);padding:10px 0;text-align:center}
.od-text pre{margin:6px 0 10px}
.od .gift-next{text-align:start}
@media (prefers-reduced-motion:reduce){.od-check,.od-tick{animation:none}.od-tick{stroke-dashoffset:0}}

/* ---- «طلباتي» without an account (my-orders.js) -------------------------------------------------------- */
.mo-body{gap:18px}
.mo-h{display:block;font:700 15px/1.4 var(--display);margin:0 0 8px}
.mo-list{display:flex;flex-direction:column;gap:8px}
.mo-ord{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 10px;padding:12px 14px;border:1px solid var(--line);border-inline-start:4px solid var(--accent);border-radius:14px;background:var(--surface);color:var(--ink);text-decoration:none;transition:border-color .15s}
.mo-ord:hover{border-color:var(--accent)}
.mo-top{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px}
.mo-code{font:700 15px/1.3 var(--mono);letter-spacing:.03em}
.mo-sub{grid-column:1;font-size:12.5px;color:var(--muted)}
.mo-go{grid-column:2;font-size:13px;font-weight:700;color:var(--accent);white-space:nowrap}
.mo-empty{text-align:center;padding:6px 0}
.mo-empty p{margin:4px 0}
.mo-find{display:flex;flex-direction:column;gap:10px;padding:14px;border-radius:16px;background:var(--sunk);border:1px solid var(--line)}
.mo-find .mo-h{margin:0}
.mo-fields{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:10px}
.mo-fields input{background:var(--surface)}
.mo-l4 input{letter-spacing:.3em;text-align:center}
.mo-msg{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13.5px}
.mo-msg:empty{display:none}
.mo-msg.bad{color:#c9302c}
.mo-msg.ok{color:var(--ok)}
.mo-acct{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;font-size:13.5px;color:var(--muted);border-top:1px dashed var(--line);padding-top:14px}
.ord-list .mo-sec{border-top:1px dashed var(--line);padding-top:12px;margin-top:4px}
@media (max-width:420px){.mo-fields{grid-template-columns:1fr}}

/* ---- the WhatsApp button: a phone in a bubble, out of the way over the order form and open windows (wa-fab.js) */
.wa-fab{transition:transform .15s,bottom .2s,opacity .2s,visibility .2s}
.wa-fab .wa-glyph{display:block}
.wa-fab.away,body:has(dialog[open]) .wa-fab,html.drawer-open .wa-fab{opacity:0;visibility:hidden;transform:scale(.7);pointer-events:none}
.btn.wa .wa-glyph{flex:none}

/* ---- finger-sized tap areas (44 × 44) that look the same: an invisible margin around small controls -------- */
/* (a ring is measured from inside the border, so bordered controls get a little more) */
.heart,.icon-btn,.chip,.cat-chip,.link-btn,.rail-btn,.x,.acct-btn,.cart-pill,.logo,.soc,.hb-catname{position:relative}
.ph .heart{position:absolute}
.heart::before,.icon-btn::before,.chip::before,.cat-chip::before,.rail-btn::before,.x::before,.acct-btn::before,.cart-pill::before,.soc::before,.hb-catname::before{content:"";position:absolute;inset:-6px}
.link-btn::before{content:"";position:absolute;inset:-11px -4px}
.logo::before{content:"";position:absolute;inset:-6px 0}
/* the account button cut its own ring off (it hid its overflow for a long name): the name is cut instead */
.acct-btn{overflow:visible}
.acct-btn .acct-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.hb-bar{overflow:visible}
.hb-bar::before{inset:-20px -4px}
.hb-dots button{position:relative}
.hb-dots button::before{content:"";position:absolute;inset:-17px -8px}
.qty button{width:44px;height:44px}

/* ---- small text on the store's orange: dark enough to read (the «جديد» badge, counters, «3D» in the logo) ---- */
.badge,.badge.new,.cart-pill span,.fb-count,.dr-count{background:color-mix(in srgb,var(--hot) 70%,#000)}
.logo b{color:color-mix(in srgb,var(--hot) 85%,#000)}
.guarantee summary{color:color-mix(in srgb,var(--ok) 82%,#000)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .guarantee summary{color:var(--ok)}}
:root[data-theme="dark"] .guarantee summary{color:var(--ok)}
