/* Futura Tech — components store, cart, store checkout (docs/DESIGN-STORE.md).
   Builds on tokens.css + base.css + features.css; no new colours. Red is for actions only,
   selection uses ink. The one bold element: the skewed red/ink stripe on the active mode tab.
   Logical properties only (RTL first). */

/* ---------- header: login + cart ---------- */
.hdr-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-inline-size: 44px; min-block-size: 44px; padding-inline: 12px;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-pill); background: var(--c-surface);
  color: var(--c-text); font: inherit; font-size: var(--fs-1); font-weight: 600; text-decoration: none; cursor: pointer;
}
.hdr-btn:hover { border-color: var(--c-primary); text-decoration: none; }
.hdr-btn svg { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hdr-btn[aria-current="page"] { border-color: var(--c-text); }
.cart-btn { padding-inline: 0; inline-size: 44px; }
.cart-count {
  position: absolute; inset-block-start: 4px; inset-inline-end: 2px; transform: translate(0, -40%);
  min-inline-size: 20px; block-size: 20px; padding-inline: 5px; border-radius: 10px;
  display: grid; place-items: center; background: var(--brand-red); color: #fff;
  font-size: var(--fs-0); font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px var(--c-bg);
}
@media (prefers-reduced-motion: no-preference) {
  .cart-count.is-pulse { animation: ft-badge .3s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes ft-badge { 50% { transform: translate(0, -40%) scale(1.25); } }
@media (max-width: 559.98px) {
  .login-btn { padding-inline: 0; inline-size: 44px; }
  .login-btn [data-login-label] { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 419.98px) {
  .site-header .container { gap: var(--space-2); }
  .brand-futura .brand-link img { block-size: 38px; }
  .lang-toggle { padding-inline: 10px; }
}

/* ---------- mode tabs (under the hero CTAs) ---------- */
.mode-wrap { margin-block-start: var(--space-4); scroll-margin-block-start: 84px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; border-block-end: 1.5px solid var(--c-border); }
.mode-tab {
  position: relative; display: flex; align-items: center; gap: 10px; min-block-size: 56px; padding: 8px 12px 12px;
  background: none; border: 0; color: var(--c-muted); font: inherit; font-weight: 700; font-size: var(--fs-2); cursor: pointer; text-align: start;
}
.mode-tab svg { inline-size: 24px; block-size: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-txt { display: grid; line-height: 1.3; min-inline-size: 0; }
.mode-txt small { color: var(--c-muted); font-size: var(--fs-0); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-tab:hover { color: var(--c-text); }
.mode-tab[aria-selected="true"] { color: var(--c-text); }
.mode-tab[aria-selected="true"] svg { color: var(--c-primary); }
.mode-tab::after {
  content: ""; position: absolute; inset-inline: 12px; inset-block-end: -1.5px; block-size: 6px;
  background: linear-gradient(90deg, var(--brand-red) 0 70%, transparent 70% 76%, var(--c-text) 76%);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  transform: scaleX(0); transform-origin: var(--_o, right); transition: transform .22s cubic-bezier(.2, .7, .2, 1);
}
html[dir="rtl"] .mode-tab::after { background: linear-gradient(270deg, var(--brand-red) 0 70%, transparent 70% 76%, var(--c-text) 76%); }
html[dir="ltr"] .mode-tab::after { --_o: left; }
.mode-tab[aria-selected="true"]::after { transform: none; }
.mode-tab:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; border-radius: var(--radius-sm); }
@media (max-width: 559.98px) { .mode-tab { padding-inline: 4px; align-items: flex-start; } .mode-tab svg { display: none; } .mode-txt small { white-space: normal; } }
@media (min-width: 720px) {
  .mode-tabs { grid-template-columns: repeat(2, 240px); }
  .mode-tab { min-block-size: 64px; font-size: var(--fs-3); }
}
[role="tabpanel"]:focus { outline: none; }
.fu-hero { padding-block-end: 0; }
.perks-band { padding-block-start: var(--space-4); }
.perks-band .perks { margin-block-start: 0; }

/* ---------- shop head + toolbar ---------- */
/* The tab right above already says "متجر العناصر": the h2 stays for screen readers (it names the
   grid) but is not shown twice, so the first product row lands in the first phone screen. */
.section.shop { padding-block-start: var(--space-3); }
.shop-head { display: grid; gap: var(--space-3); align-items: end; margin-block-end: var(--space-3); }
#panel-shop .shop-head .layers { display: none; }
#panel-shop .shop-head h2 { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; }
@media (max-width: 719.98px) {
  :root:has(#tab-shop[aria-selected="true"]) .fu-hero .lede { display: none; }
  /* the print CTAs (اطلب / تتبّع) are in the tab bar below; in the store they only push products down */
  :root:has(#tab-shop[aria-selected="true"]) .fu-hero .hero-grid > div > .row { display: none; }
}
.shop-head p { margin: 0; color: var(--c-muted); font-size: var(--fs-2); }
/* phones: the tab's own subtitle introduces the store; the sentence stays for screen readers */
@media (max-width: 719.98px) {
  #panel-shop .shop-head { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
}
.shop-tools {
  position: sticky; inset-block-start: 68px; z-index: 20; display: grid; gap: var(--space-2);
  margin-inline: calc(var(--space-3) * -1); padding: var(--space-2) var(--space-3);
  background: color-mix(in srgb, var(--c-bg) 96%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.shop-search { position: relative; display: flex; align-items: center; margin: 0; }
.shop-search svg { position: absolute; inset-inline-start: 14px; inline-size: 20px; block-size: 20px; fill: none; stroke: var(--c-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.shop-search input {
  inline-size: 100%; min-block-size: 48px; padding: 10px 14px; padding-inline-start: 44px;
  font: inherit; font-size: 16px; color: var(--c-text); background: var(--c-surface);
  border: 1.5px solid var(--c-input-border, var(--c-border)); border-radius: var(--radius-sm);
}
.shop-search input:focus-visible { outline: none; border-color: var(--c-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-text) 20%, transparent); }
.shop-search input::-webkit-search-cancel-button { cursor: pointer; }
.shop-cats {
  display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--space-3); scrollbar-width: none;
  padding-block: 2px; margin-inline: calc(var(--space-3) * -1); padding-inline: var(--space-3);
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px);
}
html[dir="rtl"] .shop-cats { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
.shop-cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding: 0 14px;
  border: 1.5px solid var(--c-input-border, var(--c-border)); border-radius: var(--radius-pill); background: var(--c-surface);
  color: var(--c-text); font: inherit; font-size: var(--fs-1); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.cat:hover { border-color: var(--c-text); }
.cat .cat-n { color: var(--c-muted); font-size: var(--fs-0); }
.cat[aria-checked="true"] { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-bg); font-weight: 700; }
.cat[aria-checked="true"] .cat-n { color: color-mix(in srgb, var(--c-bg) 70%, transparent); }
.cat:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.shop-status { margin: var(--space-2) 0 0; min-block-size: 1.4em; color: var(--c-muted); font-size: var(--fs-0); }
.shop-status:empty { min-block-size: 0; margin: 0; }
.one-line { margin: 0; }
@media (min-width: 720px) { .shop-tools { margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); } .shop-cats { margin-inline: 0; padding-inline: 0; } }
@media (min-width: 1000px) {
  .shop-head { grid-template-columns: minmax(0, 1fr) auto; }
  .shop-tools { grid-template-columns: 360px minmax(0, 1fr); align-items: center; gap: var(--space-3); }
  .shop-cats { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- product grid + cards ---------- */
.p-grid { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); } }
@media (min-width: 1100px) { .p-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); } }
.p-card { display: flex; min-inline-size: 0; }
.p-art {
  position: relative; display: flex; flex-direction: column; inline-size: 100%;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden;
}
.p-art:hover { border-color: color-mix(in srgb, var(--c-text) 35%, var(--c-border)); }
.p-open {
  display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.p-open:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; border-radius: var(--radius); }
.p-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1; background: var(--c-surface-2); overflow: hidden; }
.p-thumb img { inline-size: 100%; block-size: 100%; object-fit: contain; padding: 12px; }
/* no photo: a quiet grey mark, so a catalogue without photos is not a wall of red logos */
.p-thumb.is-empty .cube-mark img, .cube-mark img { inline-size: 34%; block-size: auto; padding: 0; opacity: .14; filter: grayscale(1); }
.cube-mark { display: contents; }
.p-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 12px 12px 0; min-block-size: calc(2 * 1.45em); font-size: var(--fs-1); font-weight: 600; line-height: 1.45;
}
.p-stock { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 1; }
.p-stock.in { background: var(--c-success-soft); color: var(--c-success); }
.p-stock.low { background: var(--c-warning-soft); color: var(--c-warning); }
.p-stock.out { background: var(--c-surface); color: var(--c-muted); }
.stock-out .p-thumb img { filter: grayscale(1); opacity: .6; }
.p-buy { display: grid; gap: 10px; padding: 8px 12px 12px; margin-block-start: auto; }
.p-price { font-size: var(--fs-2); font-weight: 800; line-height: 1.2; }
@media (min-width: 720px) { .p-name { margin: 16px 16px 0; } .p-buy { padding: 8px 16px 16px; } }

.add-btn { inline-size: 100%; min-block-size: 44px; padding-inline: 10px; font-size: var(--fs-1); }
.add-btn svg { inline-size: 18px; block-size: 18px; }
.add-btn.is-out { --_bd: var(--c-border); color: var(--c-muted); opacity: 1; font-size: var(--fs-0); line-height: 1.35; }

/* stepper: base .qty look, full width in cards */
.stepper.qty { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; inline-size: 100%; border-color: var(--c-text); }
.stepper.qty button { inline-size: 44px; min-block-size: 44px; display: grid; place-items: center; color: var(--c-text); }
.stepper.qty button:disabled { color: var(--c-muted); opacity: .45; cursor: not-allowed; }
.stepper.qty button:disabled:hover { background: none; }
.stepper.qty button svg { inline-size: 18px; block-size: 18px; }
.stepper.qty output { display: grid; place-items: center; font-weight: 800; font-size: var(--fs-2); }
.st-wrap { display: grid; gap: 4px; }
.st-max { margin: 0; color: var(--c-muted); font-size: var(--fs-0); }

/* skeleton + messages */
.p-card.is-skel { flex-direction: column; gap: 10px; padding-block-end: 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.skel-line { display: block; block-size: 12px; margin-inline: 12px; border-radius: 3px; background: var(--c-surface-2); }
.skel-line.short { inline-size: 40%; }
@media (prefers-reduced-motion: no-preference) {
  .p-card.is-skel .p-thumb, .skel-line { background: linear-gradient(90deg, var(--c-surface-2) 0 40%, color-mix(in srgb, var(--c-surface-2) 55%, var(--c-surface)) 50%, var(--c-surface-2) 60%) 0 0 / 250% 100%; animation: ft-shimmer 1.3s linear infinite; }
}
@keyframes ft-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.shop-msg {
  grid-column: 1 / -1; display: grid; justify-items: center; gap: var(--space-2); text-align: center;
  padding: var(--space-5) var(--space-3); border: 1.5px dashed var(--c-border); border-radius: var(--radius); background: var(--c-surface);
}
.shop-msg p { margin: 0; }
.shop-msg .alert { text-align: start; }
.shop-msg-h { font-weight: 700; font-size: var(--fs-3); }
.shop-msg .cube-mark img, .shop-msg-mark img { inline-size: 72px; opacity: .3; }
.shop-msg .row { justify-content: center; margin-block-start: var(--space-2); }

/* shipping-once line (cards, sheet, drawer, checkout) */
.one-ship { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--c-muted); font-size: var(--fs-0); line-height: 1.5; }
.one-ship svg { inline-size: 18px; block-size: 18px; flex: none; color: var(--c-text); }

/* ---------- dialogs: product sheet + cart drawer ---------- */
html.drawer-open { overflow: hidden; }
dialog.sheet, dialog.drawer { border: 0; padding: 0; background: var(--c-surface); color: var(--c-text); max-inline-size: none; max-block-size: none; }
dialog.sheet::backdrop, dialog.drawer::backdrop { background: rgb(10 10 10 / .5); }
.icon-btn {
  display: inline-grid; place-items: center; inline-size: 44px; block-size: 44px; flex: none; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--c-text); cursor: pointer;
}
.icon-btn:hover { background: var(--c-surface-2); }
.icon-btn svg { inline-size: 22px; block-size: 22px; }

dialog.sheet { margin: auto 0 0; inline-size: 100%; max-block-size: 90dvh; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
dialog.sheet[open] { display: flex; }
/* phone: media, info and foot stack at their natural height and the whole sheet scrolls (foot stays
   sticky); a 1fr row here squeezed the info to the space left and clipped the description */
.sheet-inner { position: relative; display: grid; grid-template-rows: auto auto auto; -webkit-overflow-scrolling: touch; inline-size: 100%; max-block-size: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet-grab { position: absolute; inset-block-start: 8px; inset-inline: 0; margin-inline: auto; inline-size: 36px; block-size: 4px; border-radius: 2px; background: var(--c-border); z-index: 2; }
.sheet-close { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 3; background: color-mix(in srgb, var(--c-surface) 85%, transparent); }
.ps-media { position: relative; }
.ps-thumb { aspect-ratio: 4 / 3; }
.ps-thumb.is-empty { aspect-ratio: 16 / 9; }
.ps-thumb img { padding: 24px; }
.ps-media .p-stock { inset-block-start: 16px; inset-inline-start: 16px; }
.ps-info { display: grid; gap: var(--space-2); align-content: start; padding: var(--space-4) var(--space-3) var(--space-3); }
.ps-info h2 { margin: 0; font-size: var(--fs-4); }
.ps-info p { margin: 0; }
.ps-cat { color: var(--c-muted); font-size: var(--fs-0); font-weight: 600; }
.ps-desc { display: grid; gap: 6px; max-inline-size: 65ch; line-height: 1.75; }
/* each line is its own paragraph with its own direction (shop.js textDir: an Arabic line that
   opens with "ATmega328P" stays RTL); Latin/number runs inside are isolated by the bidi algorithm */
.ps-desc p { unicode-bidi: isolate; text-align: start; }
p.ps-desc { unicode-bidi: plaintext; }
.ps-sku { color: var(--c-muted); font-size: var(--fs-0); text-align: end; }
html[dir="rtl"] .ps-sku { text-align: right; }
.ps-ask { font-size: var(--fs-0); color: var(--c-muted); }
.ps-ask a { font-weight: 600; }
.ps-foot {
  position: sticky; inset-block-end: 0; display: flex; align-items: center; gap: var(--space-3);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--c-surface); border-block-start: 1px solid var(--c-border);
}
.ps-price { font-size: var(--fs-3); font-weight: 800; white-space: nowrap; }
.ps-act { flex: 1 1 auto; min-inline-size: 0; display: flex; justify-content: flex-end; }
.ps-act > * { inline-size: min(100%, 260px); }
.ps-act .add-btn { min-block-size: 48px; }
@media (min-width: 900px) {
  dialog.sheet { margin: auto; inline-size: 880px; max-block-size: min(640px, 90dvh); border-radius: var(--radius); }
  .sheet-inner { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; max-block-size: min(640px, 90dvh); }
  .sheet-grab { display: none; }
  .ps-media { grid-row: 1 / span 2; }
  .ps-thumb, .ps-thumb.is-empty { aspect-ratio: auto; block-size: 100%; min-block-size: 420px; }
  .ps-info { padding: var(--space-5) var(--space-4) var(--space-3); overflow-y: auto; }
  .ps-foot { grid-column: 2; padding-inline: var(--space-4); }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: ft-sheet-up .24s cubic-bezier(.2, .7, .2, 1); }
  @media (min-width: 900px) { dialog.sheet[open] { animation: ft-sheet-in .18s ease-out; } }
  dialog.drawer[open] { animation: ft-drawer-in .24s cubic-bezier(.2, .7, .2, 1); }
  html[dir="ltr"] dialog.drawer[open] { animation-name: ft-drawer-in-ltr; }
}
@keyframes ft-sheet-up { from { transform: translateY(100%); } }
@keyframes ft-sheet-in { from { transform: scale(.98); opacity: 0; } }
@keyframes ft-drawer-in { from { transform: translateX(-100%); } }
@keyframes ft-drawer-in-ltr { from { transform: translateX(100%); } }

/* cart drawer: from inline-end (left in RTL) */
dialog.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0; inline-size: min(420px, 100vw); block-size: 100dvh; box-shadow: 0 0 40px rgb(0 0 0 / .25); }
dialog.drawer[open] { display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 10px 8px 10px 16px; border-block-end: 1px solid var(--c-border); }
html[dir="rtl"] .drawer-head { padding: 10px 16px 10px 8px; }
.drawer-head h2 { margin: 0; font-size: var(--fs-3); }
.drawer-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-3); display: grid; align-content: start; gap: var(--space-3); }
.drawer-foot { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); border-block-start: 1px solid var(--c-border); background: var(--c-surface); }
.totals[aria-busy="true"] { opacity: .55; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding-block-end: var(--space-3); border-block-end: 1px solid var(--c-border); }
.line:last-child { border-block-end: 0; padding-block-end: 0; }
.line-thumb { inline-size: 56px; border-radius: var(--radius-sm); }
.line-thumb img { padding: 4px; }
.line-main { display: grid; gap: 4px; min-inline-size: 0; }
.line-main p { margin: 0; }
.line-name { font-weight: 600; font-size: var(--fs-1); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-unit { color: var(--c-muted); font-size: var(--fs-0); }
.line-prob { color: var(--c-warning); font-size: var(--fs-0); font-weight: 600; display: block; }
.line-actions { display: flex; align-items: center; gap: 4px; margin-block-start: 4px; }
.line-actions .stepper.qty { inline-size: auto; grid-template-columns: 44px 44px 44px; }
.line-actions .stepper.qty button { inline-size: 44px; min-block-size: 44px; }
.line.is-out .line-thumb { filter: grayscale(1); opacity: .6; }
.line.is-out .line-name { color: var(--c-muted); }
.line-out-rm { min-block-size: 44px; padding-inline: 14px; border-color: var(--c-input-border); }
.line-total { font-weight: 800; font-size: var(--fs-1); white-space: nowrap; }
.totals { display: grid; gap: 6px; }
.tot-row { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-1); color: var(--c-muted); }
.tot-row bdi { color: var(--c-text); font-weight: 600; }
.tot-row.tot-sub { color: var(--c-text); font-weight: 700; font-size: var(--fs-2); }
.tot-row.tot-sub bdi { font-weight: 800; }
.tot-row .free { color: var(--c-success); }
.tot-hint { margin: 0; color: var(--c-muted); font-size: var(--fs-0); }
.free-nudge { margin-block-start: 4px; }
.free-nudge .q-hint { margin: 0; font-size: var(--fs-0); }
.cart-notes p { margin: 0; }
.cart-empty { display: grid; justify-items: center; gap: var(--space-2); text-align: center; padding-block: var(--space-6) var(--space-4); }
.cart-empty p { margin: 0; }
.cart-empty-h { font-weight: 700; font-size: var(--fs-3); }
.cart-empty .cube-mark img { inline-size: 88px; opacity: .3; }
.cart-empty .btn { margin-block-start: var(--space-2); }

/* ---------- store checkout ---------- */
.co-head { margin-block-end: var(--space-4); }
.co-head h2 { font-size: var(--fs-4); margin-block-end: var(--space-2); }
.sc-summary { display: grid; gap: var(--space-3); }
.sc-summary[aria-busy="true"] .big { opacity: .45; }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sum-edit { min-block-size: 44px; padding-inline: 8px; }
.sum-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sum-lines li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--fs-1); }
.sum-thumb { inline-size: 44px; border-radius: var(--radius-sm); }
.sum-thumb img { padding: 3px; }
.sum-name { display: grid; line-height: 1.4; min-inline-size: 0; }
.sum-lines bdi.num { font-weight: 700; }
.sc-quote { gap: var(--space-2); }
.sc-total { margin: 0; font-size: var(--fs-3); font-weight: 800; }

/* ---------- print wizard: store items in the price box ---------- */
.q-store { display: grid; gap: 4px; padding-block: 6px; border-block: 1px dashed var(--c-border); }
.q-store .q-store-h { color: var(--c-text); font-weight: 600; }
.q-store-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs-0); color: var(--c-muted); }
.q-store-lines li { display: flex; justify-content: space-between; gap: var(--space-2); }
.q-store-lines .line-prob { display: block; }
.q-store-x { color: var(--c-text); }
.q-store-edit { justify-self: start; min-block-size: 44px; padding-inline: 10px; font-size: var(--fs-0); }
.q-store-note p { margin: 0; }
.q-store-note .btn { margin-block-start: 4px; padding-inline: 10px; min-block-size: 44px; }

/* ---------- track: components table ---------- */
.prod-table-wrap { overflow-x: auto; inline-size: 100%; }
.prod-table { inline-size: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.prod-table th, .prod-table td { padding: 10px 8px; text-align: start; border-block-end: 1px solid var(--c-border); vertical-align: top; }
.prod-table th:first-child, .prod-table td:first-child { padding-inline-start: 0; }
.prod-table th:last-child, .prod-table td:last-child { padding-inline-end: 0; }
.prod-table thead th { color: var(--c-muted); font-size: var(--fs-0); font-weight: 600; white-space: nowrap; }
/* the name takes the room left; numbers never wrap */
.prod-table tbody th { inline-size: 100%; font-weight: 600; line-height: 1.5; overflow-wrap: break-word; }
.prod-table .pt-qty, .prod-table .pt-unit, .prod-table .pt-line { white-space: nowrap; }
.prod-table .pt-line { text-align: end; }
.prod-table tfoot th, .prod-table tfoot td { border-block-end: 0; font-weight: 800; }
@media (max-width: 479.98px) { .prod-table .pt-unit { display: none; } }

/* ---------- account: staff link ---------- */
.staff-link { display: grid; justify-items: center; gap: 2px; margin: var(--space-4) 0 0; font-size: var(--fs-0); text-align: center; max-inline-size: none; }
.staff-link a { color: var(--c-muted); font-weight: 600; min-block-size: 44px; display: inline-flex; align-items: center; }
.staff-link a:hover { color: var(--c-text); }

/* ---------- dark mode: selected red fills ----------
   The text-safe red of dark mode (#FF4D52) is too light for white text (3.3:1). Selected fills
   (deposit/full chips, colour/quality chips) use the logo red with white text instead (4.8:1). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip:has(input:checked) { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
}
:root[data-theme="dark"] .chip:has(input:checked) { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }

/* ---------- 4-column tab bar (اطلب · المتجر · تتبّع · حسابي) ---------- */
@media (max-width: 899.98px) { .tabbar:has(> a:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

@media print { .hdr-btn, dialog.drawer, dialog.sheet, .mode-wrap { display: none !important; } }
.q-store-h bdi.num, .q-store-lines bdi.num { white-space: nowrap; }
.q-store-lines li > span { min-inline-size: 0; }

/* paged catalogue: "show more" spans the grid */
.shop-more-row { grid-column: 1 / -1; display: flex; justify-content: center; padding: var(--space-3) 0; list-style: none; }
.shop-more { min-inline-size: 220px; min-block-size: 48px; }
.p-thumb.is-empty .cat-art { inline-size: 46%; block-size: auto; aspect-ratio: 1; color: var(--c-muted); opacity: .75; }
.p-hot { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; background: var(--c-warning-soft); color: var(--c-warning); font-weight: 700; z-index: 1; }
.add-btn.is-pre { border: 1px dashed var(--c-border-strong, #999); color: var(--c-text); }
.pre-dlg { max-inline-size: min(440px, calc(100vw - 32px)); inline-size: 100%; border: 0; border-radius: var(--radius); padding: 20px; background: var(--c-surface); color: var(--c-text); }
.pre-dlg::backdrop { background: rgb(0 0 0 / .5); }
.pre-dlg h2 { margin: 0; font-size: 1.25rem; }
.pre-dlg .hp { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.pre-dlg textarea, .pre-dlg input { inline-size: 100%; }
