/* pk-layout.css — 2026-12-01 CENTRAL layout / overlay layer (owner: iPhone defects on Staging — clipped tiles, chips cut at the edge, content under sticky bars, keyboard over the input,
   misaligned menu cards, moving counts). Injected on every HTML page by pk_fresh.py (kill switch: `touch pk_layout.off`). It BUILDS ON pk-guard.js (--pk-kb, --pk-vvh, PKLayers, PKScroll) — it is not a second overlay system.
   Rules that live here instead of per-page patches: (1) numbers keep their width, (2) chip rows never cut a chip silently (end spacer + edge fade + room for shadows), (3) sticky / fixed bars publish their height
   (--pk-top-h / --pk-bot-h) and sheets their title bar (--pk-sheet-head) so anchored / scrolled-to content never hides under them, (4) bottom sheets follow the VISIBLE height while the keyboard is open,
   (5) floating widgets step aside while scrolling / typing, (6) product titles wrap on 2–3 lines instead of one cut line. No colour / look change to existing components. */
:root{--pk-edge:14px;--pk-top-h:0px;--pk-bot-h:0px;--pk-sheet-head:68px;--pk-text-2:#4b5563}
html[data-theme=dark],html[data-pkt=dark]{--pk-text-2:#b8c0cf}
@media (prefers-color-scheme:dark){html:not([data-theme=light]):not([data-pkt=light]){--pk-text-2:#b8c0cf}}
html{scroll-padding-top:calc(var(--pk-top-h) + 10px);scroll-padding-bottom:calc(var(--pk-bot-h) + 10px)}

/* 1 — numbers: same width whatever the value (no jump when a count grows, no count-up animation needed) */
.pk-n,#sp-tabs button em,.dg-tabs button em,.ox-n,.thx-c,.pk-count{font-variant-numeric:tabular-nums}
.pk-n{display:inline-block;min-width:var(--pk-n-w,3ch);text-align:center}
.pk-tick{font-variant-numeric:tabular-nums;display:inline-block;min-width:2ch;text-align:center}

/* 2 — chip rows (scrollers): room for shadows above / below, a spacer after the last chip, edge fade only when there is more to see */
.dg-tabs,.pk-chips{overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;padding-top:8px;padding-bottom:16px;margin-top:-6px;margin-bottom:-6px;scroll-padding-inline:var(--pk-edge)}
.dg-tabs::after,.pk-chips::after{content:"";flex:0 0 var(--pk-edge)}
.dg-tabs>*,.pk-chips>*{flex:0 0 auto}
.pk-fade-e{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 36px),transparent)}
.pk-fade-s{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px);mask-image:linear-gradient(to right,transparent,#000 36px)}
.pk-fade-s.pk-fade-e{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent)}
html[dir=rtl] .pk-fade-e{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 36px),transparent)}
html[dir=rtl] .pk-fade-s{-webkit-mask-image:linear-gradient(to left,transparent,#000 36px);mask-image:linear-gradient(to left,transparent,#000 36px)}
html[dir=rtl] .pk-fade-s.pk-fade-e{-webkit-mask-image:linear-gradient(to left,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to left,transparent,#000 36px,#000 calc(100% - 36px),transparent)}
@media (min-width:1024px) and (hover:hover) and (pointer:fine){.dg-tabs,.pk-chips{-webkit-mask-image:none!important;mask-image:none!important}}

/* 3 — anything scrolled-to inside a product sheet clears the sheet's sticky title bar */
.pkx-sheet :is([id],.dg-box,.pkc,.pkpi-box,.dg-facts,h2,h3),#dg-sheet :is([id],.dg-box,.pkc,.pkpi-box,.dg-facts){scroll-margin-top:calc(var(--pk-sheet-head) + 10px)}

/* 4 — keyboard: the overlay and the sheet follow the VISIBLE height (--pk-ih = innerHeight, --pk-kb = keyboard height, both from pk-guard / pk-layout.js) */
html.pk-kb-open .pkx-sheet-ov.on{height:calc(var(--pk-ih,100dvh) - var(--pk-kb,0px))!important;min-height:0!important}
html.pk-kb-open .pkx-sheet{max-height:calc(var(--pk-ih,100dvh) - var(--pk-kb,0px) - 12px)!important}
.pkx-sheet input,.pkx-sheet textarea,.pkx-sheet select{scroll-margin-block:calc(var(--pk-sheet-head) + 16px) 96px}

/* 5 — floating widgets (up-arrow, assistant, admin crown) step aside while the page scrolls or the keyboard is open; they return a moment after */
#pk-top,#pk-sat,#pka-b{transition:opacity .18s ease}
html.pk-scrolling #pk-top,html.pk-scrolling #pk-sat,html.pk-scrolling #pka-b,html.pk-kb-open #pk-top,html.pk-kb-open #pk-sat,html.pk-kb-open #pka-b{opacity:0!important;pointer-events:none!important}

/* 6 — product / card titles: up to 3 lines, never a one-line cut of the name that matters (full name stays in the title attribute) */
.dg-it .tx b,.sp-card b,.dg-br b,.pkx-c .pkx-tt{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}
.dg-it .dg-chips span,.sp-card small,.dg-facts small{color:var(--pk-text-2);opacity:1}

/* 7 — 44px touch targets for the small round / icon buttons we ship */
.pkx-sheet button.x,.pkx-sheet .x,.dg-x{min-width:44px;min-height:44px}

/* 8 — a stalled navigation never leaves a layer behind (pk-search.js adds html.pk-navigating) */
html.pk-navigating{cursor:progress}

/* 9 — reserved slots for sections that arrive later (no jump when the data lands) */
.pk-skel{display:flex;gap:10px;overflow:hidden}.pk-skel i{display:block;flex:0 0 150px;height:190px;border-radius:16px;background:var(--card2,rgba(127,127,127,.14));opacity:.6}

/* 10 — HEADER LOGO: no motion, no blur, no layers, fixed box (owner 2026-12-01 «لوغو ثابت بلا تحرك»).
   ROOT CAUSE (pk-bar.js:381-423): the logo is driven by several stacked, contradictory CSS layers — `lgDrop` (a drop-in animation on EVERY page open), `pkLgF` / `lgBr` (infinite float / breathe on the <img>),
   `lgSp` / `lgSh` (spinning aura / shine layers using a blur filter) and a ring + sparkle pseudo-elements — some switched off by `animation:none!important`, then switched on again by a later `!important`. Whichever rule wins on a given page
   decides whether the logo moves. Higher specificity here makes the OUTCOME the same on every page: a still logo in a fixed box. */
html body .pkx-top .pkx-logo{animation:none!important;transition:none!important;will-change:auto!important;position:relative;flex:0 0 58px!important;width:58px!important;height:44px!important;min-width:58px!important;overflow:visible!important}
html body .pkx-top .pkx-logo img{animation:none!important;transition:none!important;will-change:auto!important;filter:none!important;position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;width:56px!important;height:56px!important;min-width:56px!important;max-width:none!important;aspect-ratio:1/1;object-fit:contain}
html body .pkx-top .pkx-logo .lgaura,html body .pkx-top .pkx-logo .lgorb,html body .pkx-top .pkx-logo .lgsh,html body .pkx-top .pkx-logo::before,html body .pkx-top .pkx-logo::after{display:none!important;animation:none!important;filter:none!important}
html body .topbar .tb-logo,html body #topbar .tb-logo{animation:none!important;transition:none!important;flex:0 0 46px!important;width:46px;height:46px}
html body .topbar .tb-logo img,html body #topbar .tb-logo img{animation:none!important;transition:none!important;width:46px!important;height:46px!important;aspect-ratio:1/1;filter:none!important}

/* 11 — list cards (digital / games / gift cards / GSM / social, every page that uses .dg-it / .sp-card / .dg-br): fixed image box, a reserved price / badge slot so a LOCK («🔒 Price») and a real price occupy the SAME box
   (the card never changes size when the session or the price arrives), one reserved chip line, no empty band under the badges. Lists patch nodes by key (PKLayout.swap) so searching / filtering never rebuilds a card. */
.dg-it{min-height:76px}
.dg-it .dg-head,.dg-it .dg-head .av{flex:0 0 46px;width:46px;height:46px}
.dg-it .dg-head .av img{width:100%;height:100%;object-fit:contain;aspect-ratio:1/1}
.dg-it>.dg-price,.dg-it>.dg-lock{flex:0 0 auto;min-width:82px;min-height:30px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-variant-numeric:tabular-nums}
.dg-it .dg-chips{min-height:24px;align-content:flex-start}
.sp-card{min-height:176px;justify-content:flex-start}
.sp-card>.dg-price,.sp-card>.dg-lock{margin-top:auto;min-height:28px;min-width:82px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-variant-numeric:tabular-nums}
.sp-card img{aspect-ratio:1/1;object-fit:contain}
.dg-br{min-height:148px;justify-content:flex-start}
.dg-br .lg{flex:0 0 auto;aspect-ratio:1/1}
.dg-br>small{min-height:1.4em}

/* §12 paint budget (2026-12-01): sections far outside the viewport pause their animations (class set by pk-layout.js PKPaint). Paused = same pose, no repaint; resumes on approach. */
.pk-off,.pk-off *,.pk-off *::before,.pk-off *::after{animation-play-state:paused!important}
