/* Customer portal (/app). Same design language as the back office (admin.css): brand tokens from brand.css, a dark
   top bar, white panels on a warm background, icons with words (never colour alone), 44 px touch targets and a
   visible focus ring. Written with logical properties (inline-start/end) so it works right-to-left (Arabic, the
   default) and left-to-right. Phones get a bottom tab bar; wider screens get links in the top bar. */
:root {
  --px-bg: #F7F3EA;
  --px-surface: #fff;
  --px-line: #E6DDCF;
  --px-line-soft: #EFE6D6;
  --px-top: #1C1412;
  --px-radius: .75rem;
  --px-focus: 0 0 0 2px #fff, 0 0 0 4px rgba(180, 22, 27, .55);
  --px-ok: #1E5A3A;   --px-ok-bg: #E4F1E8;
  --px-warn: #7A4A00; --px-warn-bg: #FFF1D6;
  --px-bad: #8E1016;  --px-bad-bg: #FBE3E1;
  --px-info: #1F4E79; --px-info-bg: #E3EEF8;
  --px-muted: #5E5550; --px-muted-bg: #F1ECE3;
  --px-tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

body.px { background: var(--px-bg); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
.px-main { flex: 1 0 auto; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem; }
.px-main:focus { outline: none; }

/* Icons (shared sprite wwwroot/img/admin-icons.svg). Arrows point the reading way. */
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
[dir="rtl"] .px-flip { transform: scaleX(-1); }

/* Keyboard focus is always visible. */
.px a:focus-visible, .px button:focus-visible, .px summary:focus-visible, .px [tabindex]:focus-visible,
.px .form-control:focus-visible, .px .form-select:focus-visible, .px .form-check-input:focus-visible {
  outline: none; box-shadow: var(--px-focus); border-radius: .4rem;
}
.px-skip { position: absolute; inset-inline-start: -999px; top: .5rem; z-index: 2000; background: #fff; padding: .6rem 1rem; border-radius: .5rem; }
.px-skip:focus { inset-inline-start: .5rem; }

.px-test { background: var(--px-warn-bg); color: var(--px-warn); text-align: center; font-size: .875rem; padding: .4rem 1rem; border-bottom: 1px solid #F3D9A4; display: flex; gap: .4rem; justify-content: center; align-items: center; }

/* ---------- Top bar ---------- */
.px-top { position: sticky; top: 0; z-index: 1030; background: var(--px-top); color: #F3EBDD; }
.px-top-in { max-width: 1280px; margin: 0 auto; min-height: 60px; padding: .4rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.px-company { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; min-width: 0; min-height: 44px; }
.px-company:hover { color: #fff; }
.px-company-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.px-company-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.px-company-text small { color: #D9CFC0; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-wordmark { font-family: "Readex Pro", "IBM Plex Sans Arabic", sans-serif; font-weight: 700; font-size: 1.35rem; color: #fff; }
.px-badge {
  --px-hue: 0;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; background: hsl(var(--px-hue) 45% 38%); box-shadow: 0 0 0 2px rgba(255,255,255,.18);
}
.px-links { display: flex; align-items: center; gap: .25rem; margin-inline-start: 1rem; }
.px-link {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .85rem; border-radius: .6rem;
  color: #F3EBDD; text-decoration: none; font-weight: 600;
}
.px-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.px-link.active { background: var(--ab-red); color: #fff; }
.px-top-end { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.px-switch { max-width: 15rem; }
.px-switch .form-select { background-color: #2B211E; border-color: #4A3F3B; color: #F3EBDD; min-height: 40px; }
.px-iconbtn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid #4A3F3B; border-radius: .6rem; background: transparent; color: #F3EBDD;
}
.px-iconbtn:hover { background: rgba(255,255,255,.08); }
.px-iconbtn .i { width: 20px; height: 20px; }
.px-lang { color: #F3EBDD; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 600; }
.px-lang:hover { color: #fff; text-decoration: underline; }

/* ---------- Phone tab bar ---------- */
.px-tabbar { display: none; }
@media (max-width: 767.98px) {
  .px-links { display: none; }
  .px-top-in { padding: .35rem .9rem; gap: .6rem; }
  .px-company-name { max-width: 52vw; }
  .px-switch { max-width: 9.5rem; }
  .px-main { padding: 1rem .9rem calc(var(--px-tabbar-h) + 1.5rem + var(--safe-b)); }
  body.px-signed-in .px-footer { padding-bottom: calc(var(--px-tabbar-h) + .75rem + var(--safe-b)); }
  .px-tabbar {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--px-line);
    padding-bottom: var(--safe-b); box-shadow: 0 -4px 18px rgba(28, 20, 18, .06);
  }
  .px-tab {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: var(--px-tabbar-h);
    color: var(--px-muted); text-decoration: none; font-size: .78rem; font-weight: 600;
  }
  .px-tab .i { width: 24px; height: 24px; }
  .px-tab.active { color: var(--ab-red); }
  .px-tab.active .i { color: var(--ab-red); }
}

/* ---------- Page header ---------- */
.px-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin-bottom: 1rem; }
.px-head-text { flex: 1 1 320px; min-width: 0; }
.px-head h1 { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.px-head .px-lead { color: var(--px-muted); margin: .3rem 0 0; max-width: 75ch; }
.px-kicker { color: var(--px-muted); font-size: .9rem; margin-bottom: .2rem; }
.px-back { display: inline-flex; align-items: center; gap: .25rem; min-height: 40px; color: var(--px-muted); text-decoration: none; font-size: .95rem; }
.px-back:hover { color: var(--ab-red-dark); }
@media (max-width: 767.98px) { .px-head h1 { font-size: 1.35rem; } }

/* ---------- Panels ---------- */
.px-card { background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: 1.25rem 1.4rem; min-width: 0; }
.px-card + .px-card { margin-top: 1rem; }
.px-card-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.px-card-title .i { color: var(--ab-red); }
.px-narrow { max-width: 28rem; margin: 2rem auto; }
@media (max-width: 767.98px) { .px-card { padding: 1rem; } }

.px-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.px-tile {
  position: relative; display: flex; flex-direction: column; gap: .35rem; background: #fff; border: 1px solid var(--px-line);
  border-radius: var(--px-radius); padding: 1.1rem 1.25rem; min-width: 0; color: inherit; text-decoration: none;
}
a.px-tile:hover { border-color: #D8C9B2; box-shadow: 0 6px 18px rgba(28, 20, 18, .07); color: inherit; }
.px-tile h2 { font-size: 1.05rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.px-tile-icon { width: 2.6rem; height: 2.6rem; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; background: var(--ab-tint); color: var(--ab-red); margin-bottom: .35rem; }
.px-tile-icon .i { width: 22px; height: 22px; }
.px-tile.is-later { background: transparent; border-style: dashed; }
.px-tile.is-later .px-tile-icon { background: var(--px-muted-bg); color: var(--px-muted); }
.px-soon { color: var(--px-muted); font-size: .9rem; margin: 0; }

/* ---------- Pills and notes (icon + words, never colour alone) ---------- */
.px-pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 2rem;
  font-size: .8rem; font-weight: 600; white-space: nowrap; line-height: 1.5; background: var(--px-muted-bg); color: var(--px-muted);
}
.px-pill .i { width: 1em; height: 1em; }
.px-pill-ok { color: var(--px-ok); background: var(--px-ok-bg); }
.px-pill-warn { color: var(--px-warn); background: var(--px-warn-bg); }
.px-pill-bad { color: var(--px-bad); background: var(--px-bad-bg); }
.px-pill-info { color: var(--px-info); background: var(--px-info-bg); }
.px-pill-brand { color: var(--ab-red-dark); background: var(--ab-tint); }

.px-note { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem 1rem; border-radius: var(--px-radius); margin-bottom: 1rem; border: 1px solid transparent; }
.px-note .i { margin-top: .2rem; }
.px-note-ok { background: var(--px-ok-bg); color: var(--px-ok); border-color: #C8E2D1; }
.px-note-bad { background: var(--px-bad-bg); color: var(--px-bad); border-color: #F2C6C2; }
.px-note-info { background: var(--px-info-bg); color: var(--px-info); border-color: #C7DBEE; }
.px-note-warn { background: var(--px-warn-bg); color: var(--px-warn); border-color: #F3D9A4; }

/* ---------- Home ---------- */
.px-hero {
  background: var(--ab-red); color: #fff; border-radius: 1rem; padding: 1.6rem 1.6rem 1.4rem; margin-bottom: 1.25rem;
  background-image: radial-gradient(circle at 12% 120%, rgba(255,255,255,.12) 0, transparent 45%), radial-gradient(circle at 95% -20%, rgba(0,0,0,.18) 0, transparent 50%);
}
.px-hero h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 .25rem; }
.px-hero p { color: #F6D9D4; margin: 0 0 1rem; }
.px-hero .px-search { max-width: 40rem; }
.px-hero .px-search .form-control { border: 0; }
.px-facts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.px-fact { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 2rem; background: rgba(255,255,255,.14); color: #fff; font-size: .85rem; }
.px-section-title { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .75rem; }

/* ---------- Search and filters ---------- */
.px-search { position: relative; display: flex; gap: .5rem; }
.px-search-box { position: relative; flex: 1 1 auto; min-width: 0; }
.px-search-box > .i { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); color: var(--px-muted); pointer-events: none; }
.px-search-box > .form-control { padding-inline-start: 2.6rem; min-height: 48px; border-radius: .7rem; }
.px-search .btn { min-height: 48px; border-radius: .7rem; padding-inline: 1.2rem; }
.px-filters { --px-filter-cols: 2; display: grid; gap: .6rem; grid-template-columns: minmax(0, 2fr) repeat(var(--px-filter-cols), minmax(0, 1fr)) auto; align-items: end; margin-bottom: .75rem; }
.px-filters .form-label { font-size: .85rem; color: var(--px-muted); margin-bottom: .2rem; }
.px-filters .form-select, .px-filters .form-control { min-height: 48px; border-radius: .7rem; }
.px-filters .btn { min-height: 48px; border-radius: .7rem; }
@media (max-width: 991.98px) { .px-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .px-filters .px-filter-search { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .px-filters { grid-template-columns: minmax(0, 1fr); } }
.px-chips { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1rem; scrollbar-width: thin; }
.px-chip {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .3rem .95rem; border-radius: 2rem;
  border: 1px solid var(--px-line); color: var(--ab-ink); text-decoration: none; white-space: nowrap; background: #fff; font-size: .92rem; font-weight: 500;
}
.px-chip:hover { background: var(--px-muted-bg); color: var(--ab-ink); }
.px-chip.active { background: var(--ab-ink); border-color: var(--ab-ink); color: #fff; }
.px-count { color: var(--px-muted); font-size: .92rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Product cards ---------- */
.px-products { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.px-product {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius);
  overflow: hidden; color: inherit; text-decoration: none; min-width: 0; transition: box-shadow .15s, border-color .15s;
}
.px-product:hover { border-color: #D8C9B2; box-shadow: 0 8px 22px rgba(28, 20, 18, .08); color: inherit; }
.px-product-photo { aspect-ratio: 1 / 1; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--px-line-soft); padding: .75rem; }
.px-product-photo img { width: 100%; height: 100%; object-fit: contain; }
.px-nophoto { color: #C9BBA6; }
.px-nophoto .i { width: 40px; height: 40px; }
.px-product-body { display: flex; flex-direction: column; gap: .25rem; padding: .75rem .9rem .9rem; flex: 1; min-width: 0; }
.px-product-brand { color: var(--px-muted); font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-product-name { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.px-product-size { color: var(--px-muted); font-size: .85rem; }
.px-product-foot { margin-top: auto; padding-top: .4rem; display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.px-price { display: flex; flex-direction: column; line-height: 1.2; }
.px-price small { color: var(--px-muted); font-size: .75rem; }
.px-price strong { font-size: 1.15rem; color: var(--ab-ink); font-variant-numeric: tabular-nums; }

/* Phones: a compact row with a small photo, so many items can be scanned quickly. */
@media (max-width: 575.98px) {
  .px-products { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .px-product { flex-direction: row; align-items: stretch; }
  .px-product-photo { width: 92px; flex: none; aspect-ratio: auto; border-bottom: 0; border-inline-end: 1px solid var(--px-line-soft); padding: .5rem; }
  .px-product-body { padding: .6rem .8rem; }
}

.px-more { display: flex; justify-content: center; margin-top: 1.25rem; }
.px-empty { text-align: center; padding: 2.5rem 1rem; color: var(--px-muted); }
.px-empty .i { width: 44px; height: 44px; color: #C9BBA6; margin-bottom: .5rem; }
.px-empty h2 { font-size: 1.15rem; color: var(--ab-ink); font-weight: 700; }

/* ---------- Product page ---------- */
.px-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem; font-size: .9rem; color: var(--px-muted); margin-bottom: .75rem; }
.px-crumbs a { color: var(--px-muted); text-decoration: none; }
.px-crumbs a:hover { color: var(--ab-red-dark); text-decoration: underline; }
.px-crumbs .i { width: .9em; height: .9em; }
.px-pdp { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .px-pdp { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.px-gallery-main { background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.px-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.px-gallery-main .px-nophoto .i { width: 72px; height: 72px; }
.px-thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; }
.px-thumb { width: 68px; height: 68px; flex: none; border: 1px solid var(--px-line); border-radius: .55rem; background: #fff; padding: .25rem; }
.px-thumb img { width: 100%; height: 100%; object-fit: contain; }
.px-thumb[aria-current="true"] { border-color: var(--ab-red); box-shadow: 0 0 0 2px var(--ab-tint); }
.px-credit { font-size: .78rem; color: var(--px-muted); margin-top: .5rem; overflow-wrap: anywhere; }
.px-credit a { color: var(--px-muted); }
.px-pdp-brand { color: var(--px-muted); font-weight: 600; margin-bottom: .15rem; }
.px-pdp h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.3; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.px-pdp-sub { color: var(--px-muted); margin-bottom: .9rem; display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.px-best { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: 1rem 1.1rem; border-radius: var(--px-radius); background: var(--ab-tint); margin-bottom: 1rem; }
.px-best strong { font-size: 1.6rem; color: var(--ab-red-dark); font-variant-numeric: tabular-nums; }
.px-best span { color: var(--ab-red-dark); }
.px-facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1.25rem; margin: 0; }
.px-facts-list dt { color: var(--px-muted); font-weight: 500; }
.px-facts-list dd { margin: 0; overflow-wrap: anywhere; }
.px-desc { white-space: pre-line; margin: 0; }

/* Seller prices: a table on wide screens, one card per seller on phones. */
.px-offers { width: 100%; border-collapse: separate; border-spacing: 0; }
.px-offers th { color: var(--px-muted); font-weight: 600; font-size: .85rem; text-align: start; padding: .6rem .75rem; background: #FBF8F2; border-bottom: 1px solid var(--px-line); white-space: nowrap; }
.px-offers td { padding: .8rem .75rem; border-bottom: 1px solid var(--px-line-soft); vertical-align: top; }
.px-offers tr:last-child td { border-bottom: 0; }
.px-offers .px-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-offers .px-seller { font-weight: 700; }
.px-tiers { list-style: none; padding: 0; margin: .3rem 0 0; font-size: .82rem; color: var(--px-muted); }
.px-table-box { border: 1px solid var(--px-line); border-radius: var(--px-radius); overflow: hidden; background: #fff; }
@media (max-width: 767.98px) {
  .px-table-box { border: 0; background: transparent; overflow: visible; }
  .px-offers thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .px-offers, .px-offers tbody, .px-offers tr, .px-offers td { display: block; width: 100%; }
  .px-offers tr { background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: .5rem .9rem; margin-bottom: .6rem; }
  .px-offers td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  .px-offers td::before { content: attr(data-label); color: var(--px-muted); font-size: .85rem; flex: none; }
  .px-offers td.px-seller-cell { font-size: 1.05rem; }
  .px-offers td.px-seller-cell::before { content: none; }
}

/* ---------- Sign-in pages ---------- */
.px-prefix { max-width: 11rem; }
.px-code { letter-spacing: .4em; font-variant-numeric: tabular-nums; }
.px-or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--px-muted); }
.px-or::before, .px-or::after { content: ""; flex: 1; border-top: 1px solid var(--px-line); }

/* Test-mode WhatsApp simulator on the code page. */
.px-wa { background: #E5DDD5; border-radius: .75rem; overflow: hidden; }
.px-wa-head { background: #075E54; color: #fff; padding: .5rem .9rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.px-wa-head small { opacity: .8; }
.px-wa-bubble { background: #DCF8C6; margin: .9rem; padding: .6rem .8rem; border-radius: .5rem; box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: 1.05rem; }
.px-wa-none { margin: .9rem; color: #3b3b3b; }

/* ---------- Footer ---------- */
.px-footer { border-top: 1px solid var(--px-line); background: #fff; color: var(--px-muted); font-size: .875rem; }
.px-footer-in { max-width: 1280px; margin: 0 auto; padding: 1rem 1.25rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.px-footer a { color: var(--px-muted); }

/* ---------- Basket and orders ---------- */
.px-add { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; }
.px-add .form-control { width: 5.5rem; min-height: 40px; text-align: center; }
.px-add .btn { min-height: 40px; white-space: nowrap; }
.px-basket { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 992px) { .px-basket { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .px-checkout { position: sticky; top: 76px; } }
.px-basket-seller + .px-basket-seller { margin-top: 1rem; }
.px-lines { list-style: none; margin: 0; padding: 0; }
.px-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto; gap: .75rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--px-line-soft); }
.px-line:last-child { border-bottom: 0; }

.px-line-photo { width: 56px; height: 56px; border: 1px solid var(--px-line); border-radius: .5rem; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.px-line-photo img { width: 100%; height: 100%; object-fit: contain; }
.px-line-photo .px-nophoto .i { width: 24px; height: 24px; }
.px-line-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.px-line-name { font-weight: 600; color: var(--ab-ink); text-decoration: none; overflow-wrap: anywhere; }
a.px-line-name:hover { color: var(--ab-red-dark); text-decoration: underline; }
.px-line-text small { color: var(--px-muted); }
.px-line-problem { color: var(--px-bad); font-size: .85rem; font-weight: 600; display: inline-flex; gap: .3rem; align-items: center; }
.px-line-qty .form-control { width: 5.5rem; min-height: 40px; text-align: center; }
.px-line-total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-iconbtn-light { border-color: var(--px-line); color: var(--px-muted); background: #fff; width: 40px; height: 40px; }
.px-iconbtn-light:hover { background: var(--px-bad-bg); color: var(--px-bad); }
@media (max-width: 575.98px) {
  .px-line { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "photo text remove" "photo qty total"; }
  .px-line-photo { grid-area: photo; width: 48px; height: 48px; }
  .px-line-text { grid-area: text; }
  .px-line-qty { grid-area: qty; }
  .px-line-total { grid-area: total; text-align: end; }
  .px-line-remove { grid-area: remove; }
}
.px-sum { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0 0 .75rem; }
.px-sum dt { color: var(--px-muted); font-weight: 500; }
.px-sum dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.px-sum .px-sum-total { font-size: 1.15rem; font-weight: 700; color: var(--ab-ink); padding-top: .4rem; border-top: 1px solid var(--px-line); }
.px-orders { display: flex; flex-direction: column; gap: .6rem; }
.px-order { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); color: inherit; text-decoration: none; }
.px-order:hover { border-color: #D8C9B2; box-shadow: 0 6px 18px rgba(28, 20, 18, .07); color: inherit; }
.px-order-main { display: flex; flex-direction: column; min-width: 0; }
.px-order-main small { color: var(--px-muted); }
.px-order-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex: none; }
.px-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.px-history li { display: flex; gap: .5rem; align-items: flex-start; }
.px-history li .i { margin-top: .25rem; color: var(--px-muted); }
@media (max-width: 767.98px) {
  .px-offers td.px-add-cell { display: block; padding-top: .5rem; }
  .px-add { justify-content: stretch; }
  .px-add .btn { flex: 1; }
}
.px-seller-terms { display: flex; flex-direction: column; gap: .5rem; padding: .75rem 0; border-top: 1px solid var(--px-line); }
.px-seller-delivery { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.px-seller-delivery .form-select { flex: 1 1 260px; min-height: 44px; }
.px-terms-label { display: inline-flex; align-items: center; gap: .35rem; color: var(--px-muted); font-size: .9rem; font-weight: 600; }
.px-seller-sum { margin: .25rem 0 0; padding-top: .5rem; border-top: 1px dashed var(--px-line); }
.px-delivery-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; display: flex; flex-direction: column; gap: .25rem; max-width: 22rem; }
/* Sub-category rows under the main categories: lighter, so the levels read as a tree. */
.px-subchips { margin-top: -.5rem; }
.px-subchips .px-chip { min-height: 36px; font-size: .88rem; background: var(--px-muted-bg); border-color: transparent; }
.px-subchips .px-chip.active { background: var(--ab-red); border-color: var(--ab-red); color: #fff; }
/* Promotions: always labelled, the old price struck through next to the new one. */
.px-was { color: var(--px-muted); font-size: .85em; margin-inline-end: .35rem; }
.px-line-offer { color: var(--ab-red-dark); font-size: .82rem; font-weight: 600; display: inline-flex; gap: .3rem; align-items: center; }
.px-chip-offer { color: var(--ab-red-dark); border-color: var(--ab-tint); background: var(--ab-tint); }
.px-chip-offer.active { background: var(--ab-red); border-color: var(--ab-red); color: #fff; }

/* ---------- Bell, inbox and chats ---------- */
.px-iconbtn { position: relative; text-decoration: none; }
.px-iconbtn.active { background: var(--ab-red); border-color: var(--ab-red); color: #fff; }
.px-badge-count {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--ab-red); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--px-top);
}
.px-inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.px-inbox-item { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); color: inherit; text-decoration: none; }
.px-inbox-item:hover { border-color: #D8C9B2; color: inherit; }
.px-inbox-item.is-unread { border-inline-start: 4px solid var(--ab-red); background: #FFFDF9; }
.px-inbox-icon { width: 2.4rem; height: 2.4rem; flex: none; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; background: var(--px-muted-bg); color: var(--px-muted); }
.px-inbox-item.is-unread .px-inbox-icon { background: var(--ab-tint); color: var(--ab-red); }
.px-inbox-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.px-inbox-text strong { overflow-wrap: anywhere; }
.px-inbox-text small { color: var(--px-muted); }
.px-advert { display: inline-flex; align-items: center; padding: 0 .45rem; border-radius: .35rem; background: #FFF1D6; color: #7A4A00; font-size: .72rem; font-weight: 700; }
.px-thread { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); max-height: 60vh; overflow-y: auto; }
.px-msg { max-width: 78%; padding: .55rem .8rem; border-radius: .9rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.px-msg small { display: block; font-size: .72rem; opacity: .75; margin-top: .2rem; }
.px-msg.mine { align-self: flex-end; background: var(--ab-red); color: #fff; border-end-end-radius: .25rem; }
.px-msg.theirs { align-self: flex-start; background: var(--px-muted-bg); color: var(--ab-ink); border-end-start-radius: .25rem; }
.px-send { display: flex; gap: .5rem; margin-top: .75rem; }
.px-send textarea { flex: 1; min-height: 48px; border-radius: .7rem; }
.px-send .btn { border-radius: .7rem; }
.px-offers-strip { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.px-offer-card { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border-radius: var(--px-radius); background: #fff; border: 1px solid var(--px-line); color: inherit; text-decoration: none; }
.px-offer-card:hover { border-color: #D8C9B2; box-shadow: 0 6px 18px rgba(28,20,18,.07); color: inherit; }
.px-offer-card .px-offer-big { font-size: 1.5rem; font-weight: 700; color: var(--ab-red-dark); }
@media (max-width: 767.98px) { .px-top-end { gap: .35rem; } .px-top-end .px-iconbtn { width: 40px; height: 40px; } }

/* ---------- Ads and offers ---------- */
.px-product-sponsored { border-color: #E9C46A; box-shadow: 0 0 0 1px #E9C46A inset; }
.px-sponsored { display: inline-flex; align-self: flex-start; padding: 0 .45rem; border-radius: .35rem; background: #FFF1D6; color: #7A4A00; font-size: .72rem; font-weight: 700; }
.px-featured { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.25rem; }
.px-feature { position: relative; display: flex; gap: .85rem; align-items: center; padding: 1rem; border-radius: var(--px-radius); background: linear-gradient(135deg, #fff 0%, #FFF8EC 100%);
  border: 1px solid #EBD9B4; color: inherit; text-decoration: none; }
.px-feature:hover { border-color: #D9B877; box-shadow: 0 6px 18px rgba(28,20,18,.07); color: inherit; }
.px-feature-media { width: 76px; height: 76px; flex: none; border-radius: .8rem; background: #fff; border: 1px solid var(--px-line); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.px-feature-media img { width: 100%; height: 100%; object-fit: contain; }
.px-feature-media .px-offer-big { font-size: 1.25rem; }
.px-feature-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.px-feature-text strong { overflow-wrap: anywhere; }
.px-feature-text small { color: var(--px-muted); }
.px-feature .px-advert { position: absolute; top: .5rem; inset-inline-end: .5rem; }
.px-seller-offers { background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: 1rem; margin-bottom: .75rem; }
.px-seller-offers h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; }
.px-seller-offers ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.px-seller-offers li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.px-spec { background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: 1rem; }
.px-spec h2 { font-size: 1rem; font-weight: 700; }
.px-spec ul { margin: 0; padding-inline-start: 1.1rem; }
.px-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.px-checks li { display: flex; gap: .4rem; align-items: center; }
.px-checks .ok { color: #1E7B45; }
.px-checks .bad { color: var(--ab-red); }
.px-stats { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.px-stat { background: #fff; border: 1px solid var(--px-line); border-radius: .8rem; padding: .7rem .8rem; }
.px-stat strong { display: block; font-size: 1.25rem; }
.px-stat small { color: var(--px-muted); }
.px-nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; margin-inline-start: .3rem;
  border-radius: .65rem; background: var(--ab-red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.px-nav-count[hidden] { display: none; }

/* Arabic-first shopping refresh. Keep staff styling isolated from this portal. */
body.px {
  --px-bg: #FAFAF7;
  --px-line: #E8E8E1;
  --px-line-soft: #F0F0EA;
  --px-radius: 1.15rem;
  --px-muted: #625E59;
  background: var(--px-bg);
  line-height: 1.65;
}
.px-top { background: #fff; color: var(--ab-ink); border-bottom: 1px solid var(--px-line); }
.px-top-in { min-height: 76px; }
.px-company, .px-company:hover, .px-wordmark, .px-link, .px-lang, .px-lang:hover { color: var(--ab-ink); }
.px-company-text small { color: var(--px-muted); }
.px-link { border-radius: 2rem; }
.px-link:hover { background: #FFF0ED; color: var(--ab-red); }
.px-link.active { background: #FFF0ED; color: var(--ab-red); }
.px-top .px-iconbtn { color: var(--ab-ink); border-color: var(--px-line); background: #FAFAF7; }
.px-top .px-iconbtn.active { background: var(--ab-red); color: #fff; }
.px-switch .form-select { background-color: #FAFAF7; color: var(--ab-ink); border-color: var(--px-line); }
.px-main { padding-top: 1.5rem; }
.px-hero { position: relative; overflow: hidden; padding: 2.25rem; border-radius: 1.6rem; background: #B4161B; background-image: radial-gradient(ellipse at 0 0, #E13B37 0, transparent 65%); }
.px-hero::after { content: ''; position: absolute; width: 220px; height: 220px; border: 38px solid #FFD35A; border-radius: 50%; inset-inline-end: -100px; top: -115px; opacity: .9; pointer-events: none; }
.px-hello { font-size: 1rem; color: #FFE2D9; margin-bottom: .55rem; }
.px-hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.4; margin-bottom: .55rem; }
.px-hero p { color: #FFF1EC; font-size: 1.05rem; }
.px-hero .px-search { max-width: 48rem; }
.px-hero .px-search .form-control { min-height: 58px; font-size: 1rem; }
.px-hero .px-search .btn { background: #FFD35A; border-color: #FFD35A; color: #38200A; font-weight: 700; min-width: 100px; }
.px-hero .px-search .btn:hover { background: #FFE18A; }
.px-facts { gap: .65rem; }
.px-fact { background: #ffffff1f; }
.px-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 1.75rem; }
.px-shortcuts a { display: flex; align-items: center; gap: .85rem; padding: 1.2rem; background: #FFF0EC; border: 1px solid #F5DED6; border-radius: 1.15rem; color: #81201C; text-decoration: none; }
.px-shortcuts a:nth-child(2) { background: #FFF5CF; border-color: #F0E4B4; color: #644706; }
.px-shortcuts a:nth-child(3) { background: #EAF5EF; border-color: #D2E8DB; color: #24543C; }
.px-shortcuts a > .i { width: 28px; height: 28px; }
.px-shortcuts strong, .px-shortcuts small { display: block; }
.px-shortcuts strong { font-size: 1.05rem; }
.px-shortcuts small { color: inherit; font-size: .85rem; margin-top: .15rem; }
.px-shortcuts a:hover { box-shadow: 0 5px 16px #1c141210; }
.px-section-title { font-size: 1.25rem; margin-top: 1.8rem; }
.px-chip { min-height: 46px; padding-inline: 1.15rem; font-weight: 600; }
.px-chip.active { background: var(--ab-red); border-color: var(--ab-red); }
.px-chip-offer { background: #FFF5CF; border-color: #F0E4B4; color: #644706; }
.px-tile { padding: 1.35rem; }
.px-tile-icon { border-radius: 1rem; width: 3rem; height: 3rem; }
.px-tile:nth-child(even) .px-tile-icon { background: #EAF5EF; color: #24543C; }
.px-filters { padding: 1rem; border: 1px solid var(--px-line); border-radius: 1.15rem; background: #fff; }
.px-product { border-radius: 1.2rem; box-shadow: 0 3px 12px #1c141205; }
.px-product:hover { border-color: #D38D8F; box-shadow: 0 8px 24px #7f171712; }
.px-product-photo { background: #fff; padding: 1rem; }
.px-product-body { gap: .4rem; padding: 1rem; }
.px-product-name { font-weight: 700; line-height: 1.6; }
.px-price strong { font-size: 1.4rem; color: var(--ab-red); line-height: 1.5; }
.px-product-action { display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding: .65rem .8rem; border-radius: .7rem; background: #FFF0ED; color: #94151A; font-weight: 700; font-size: .9rem; margin-top: .4rem; }
.px-product-action .i { transform: rotate(90deg); }
[dir="ltr"] .px-product-action .i { transform: rotate(-90deg); }
.px-offer-card { background: #FFF8DC; border-color: #F0E4B4; padding: 1.2rem; }
.px-offer-card .px-offer-big { font-size: 2rem; }
.px .btn { min-height: 46px; border-radius: .8rem; font-weight: 600; }
.px .form-control, .px .form-select { min-height: 46px; }
.px-checkout { border-top: 5px solid var(--ab-red); }
.px-checkout .px-sum-total { font-size: 1.2rem; }
.px-empty { padding-block: 3.5rem; }
.px-empty > .i { color: var(--ab-red); padding: .65rem; width: 72px; height: 72px; background: #FFF0ED; border-radius: 1.25rem; }
@media (max-width: 991.98px) and (min-width: 768px) {
  .px-top-in { flex-wrap: wrap; }
  .px-links { order: 3; width: 100%; margin-inline-start: 0; overflow-x: auto; padding-bottom: .4rem; }
}
@media (max-width: 767.98px) {
  .px-main { padding-top: 1rem; }
  .px-top-in { min-height: 64px; }
  .px-hero { padding: 1.5rem 1.15rem; border-radius: 1.25rem; }
  .px-hero::after { width: 150px; height: 150px; border-width: 25px; top: -100px; inset-inline-end: -65px; }
  .px-hero p { font-size: .95rem; }
  .px-shortcuts { gap: .5rem; }
  .px-shortcuts a { flex-direction: column; align-items: flex-start; padding: .85rem .65rem; gap: .5rem; }
  .px-shortcuts strong { font-size: .88rem; }
  .px-shortcuts small { display: none; }
  .px-tab.active { color: var(--ab-red); background: #FFF0ED; border-radius: .8rem; }
  .px-tabbar { gap: .2rem; padding-inline: .45rem; }
}
@media (max-width: 575.98px) {
  .px-hero .px-search { gap: .4rem; }
  .px-hero .px-search .btn { min-width: 78px; padding-inline: .7rem; }
  .px-hero .px-search .form-control { font-size: .9rem; }
  .px-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .px-product { flex-direction: column; }
  .px-product-photo { width: 100%; aspect-ratio: 1; border-inline-end: 0; border-bottom: 1px solid var(--px-line-soft); padding: .6rem; }
  .px-product-body { padding: .7rem; }
  .px-product-name { font-size: .95rem; }
  .px-product-foot { align-items: flex-start; flex-direction: column; }
  .px-product-action { padding: .55rem; font-size: .78rem; }
  .px-price strong { font-size: 1.2rem; }
  .px-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .px-product { transition: none; } }
/* Extra search choices stay available without competing with the search itself. */
.px-filters { grid-template-columns: minmax(0, 1fr) auto; }
.px-filter-search { grid-column: 1; grid-row: 1; }
.px-filters > .d-flex { grid-column: 2; grid-row: 1; }
.px-filter-details { grid-column: 1 / -1; min-width: 0; }
.px-filter-details summary { min-height: 44px; cursor: pointer; color: var(--px-muted); font-weight: 600; padding-block: .5rem; }
.px-filter-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; padding-block: .5rem; }
@media (max-width: 575.98px) {
  .px-filters { padding: .8rem; gap: .5rem; }
  .px-filters .px-filter-search { grid-column: 1; }
  .px-filters > .d-flex .btn { padding-inline: .75rem; }
  .px-filter-options { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Portal redesign, step 1: look and shell (docs/PORTAL-REDESIGN.md sections 3-5).
   Warm red to amber gradient bands with a slanted edge, white rounded cards, add-to-basket steppers on every
   product card, a sticky basket bar and gentle motion (off under prefers-reduced-motion). Arabic first: no
   letter-spacing on Arabic text, logical properties throughout.
   ========================================================================== */
body.px {
  --px-bg: #FBF6EC;
  --px-line: #EADFCB;
  --px-line-soft: #F2EADC;
  --px-grad: linear-gradient(118deg, #8E1016 0%, #B4161B 42%, #E8812A 100%);
  --px-sun: #FFD35A;
  --px-sun-ink: #3A2306;
  --px-shadow: 0 1px 2px rgba(60, 20, 10, .05), 0 6px 18px rgba(60, 20, 10, .07);
  --px-shadow-hi: 0 2px 4px rgba(60, 20, 10, .06), 0 14px 30px rgba(60, 20, 10, .12);
  --px-ease: cubic-bezier(.2, .7, .2, 1);
  background: var(--px-bg);
}

/* Gradient band (home hero and page headers): short, so products are on the first screen. */
.px-band {
  position: relative; overflow: hidden; color: #fff; background: var(--px-grad);
  border-radius: 1.5rem; padding: 1.6rem 1.6rem 2.6rem; margin-bottom: 1.1rem;
  clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
}
.px-band::before {
  /* A soft light from the top corner. */
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 140%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 220, 160, .35), transparent 70%);
}
/* Mirrored for RTL (docs/PORTAL-REDESIGN.md section 3: "slant and arrows mirrored"): the band is deepest on the
   reading start side, the right in Arabic, and the light sits on the far (end) top corner, as in English. */
[dir="rtl"] .px-band { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 86%); }
[dir="rtl"] .px-band::before { inset: -40% auto auto -10%; }
.px-band > * { position: relative; }
.px-band-slim { padding: 1.1rem 1.25rem 2.1rem; border-radius: 1.25rem; }
.px-band-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.px-eyebrow { font-size: .85rem; font-weight: 600; color: #FFE4CF; margin-bottom: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="ltr"] .px-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.px-band-title { font-size: clamp(1.45rem, 3.6vw, 2.3rem); font-weight: 700; line-height: 1.35; margin: 0 0 .9rem; text-wrap: balance; }
.px-band-slim .px-band-title { margin: 0; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.px-band .px-search { max-width: 46rem; }
.px-band .px-search .form-control { border: 0; min-height: 52px; border-radius: 2rem; box-shadow: 0 6px 18px rgba(60, 10, 0, .18); }
.px-band .px-search-box > .i { inset-inline-start: 1.05rem; }
.px-band .px-search-box > .form-control { padding-inline-start: 2.8rem; }
.px-btn-sun { background: var(--px-sun); border: 0; color: var(--px-sun-ink); font-weight: 700; border-radius: 2rem !important; min-height: 52px; padding-inline: 1.4rem; }
.px-btn-sun:hover, .px-btn-sun:focus-visible { background: #FFE08A; color: var(--px-sun-ink); }
.min-w-0 { min-width: 0; }

/* Section headings with a "see all" link on the far side. */
.px-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 .7rem; }
.px-section-head .px-section-title { margin: 0; font-size: 1.2rem; }
.px-section-head a { color: var(--ab-red); font-weight: 600; text-decoration: none; font-size: .95rem; }

/* Three big start cards under the home band. */
.px-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 0 0 .5rem; }
.px-quick-card {
  display: flex; flex-direction: column; gap: .45rem; padding: 1rem; border-radius: 1.1rem; background: #fff;
  box-shadow: var(--px-shadow); color: var(--ab-ink); text-decoration: none; min-width: 0;
  transition: transform .2s var(--px-ease), box-shadow .2s var(--px-ease);
}
.px-quick-card:hover { transform: translateY(-2px); box-shadow: var(--px-shadow-hi); color: var(--ab-ink); }
.px-quick-card strong { font-size: 1rem; line-height: 1.3; }
.px-quick-card small { color: var(--px-muted); font-size: .8rem; }
.px-quick-icon { width: 2.6rem; height: 2.6rem; border-radius: .8rem; display: inline-flex; align-items: center; justify-content: center; background: #FDE7D6; color: var(--ab-red); }
.px-quick-icon .i { width: 22px; height: 22px; }
.px-quick-sun .px-quick-icon { background: #FFF1C2; color: #8A5A00; }
.px-quick-green .px-quick-icon { background: #E2F2E8; color: #1E6B44; }

/* Category cards: an icon chip and the name, four to a row on phones. */
.px-cats { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.px-cat {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .9rem .5rem .8rem; border-radius: 1.1rem;
  background: #fff; box-shadow: var(--px-shadow); color: var(--ab-ink); text-decoration: none; text-align: center; min-width: 0;
  transition: transform .2s var(--px-ease), box-shadow .2s var(--px-ease);
}
.px-cat:hover { transform: translateY(-2px); box-shadow: var(--px-shadow-hi); color: var(--ab-red-dark); }
.px-cat-icon { width: 3.1rem; height: 3.1rem; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center; background: #FDECE4; color: var(--ab-red); }
.px-cat-icon svg { width: 28px; height: 28px; }
.px-cat:nth-child(3n+2) .px-cat-icon { background: #FFF3CF; color: #8A5A00; }
.px-cat:nth-child(3n+3) .px-cat-icon { background: #E5F3EA; color: #1E6B44; }
.px-cat-name { font-size: .88rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* Small account tiles at the bottom of home. */
.px-mini-tiles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.px-mini-tiles a { display: flex; align-items: center; gap: .55rem; min-height: 52px; padding: .6rem .9rem; border-radius: .9rem; background: #fff; border: 1px solid var(--px-line); color: var(--ab-ink); text-decoration: none; font-weight: 600; }
.px-mini-tiles a .i { color: var(--ab-red); }
.px-mini-tiles a:hover { border-color: #D9B9A0; color: var(--ab-ink); }

/* Category chips carry their icon; the seller and branch filters fold away. */
.px-chip svg.i { width: 18px; height: 18px; }
.px-more-filters { margin: -.25rem 0 1rem; }
.px-more-filters summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; cursor: pointer; color: var(--px-muted); font-weight: 600; font-size: .92rem; }
.px-more-filters .px-filter-options { max-width: 40rem; }
.px-count { font-size: .85rem; }

/* ---------- Product cards with the stepper ---------- */
.px-products { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.px-product { position: relative; border: 0; border-radius: 1.15rem; box-shadow: var(--px-shadow); transition: transform .2s var(--px-ease), box-shadow .2s var(--px-ease); }
.px-product:hover { border-color: transparent; transform: translateY(-2px); box-shadow: var(--px-shadow-hi); }
.px-product-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; min-width: 0; }
.px-product-link:hover { color: inherit; }
.px-product-photo { position: relative; border-bottom: 0; padding: .8rem; }
.px-product-body { padding: .2rem .85rem .5rem; gap: .15rem; }
.px-product-brand { font-size: .76rem; }
.px-product-name { font-weight: 600; font-size: .95rem; line-height: 1.45; min-height: 2.9em; }
.px-product-size { font-size: .8rem; }
.px-product-meta { display: flex; align-items: baseline; gap: .35rem; margin-top: .25rem; }
.px-product-price { font-size: 1.2rem; font-weight: 700; color: var(--ab-ink); font-variant-numeric: tabular-nums; }
.px-product-meta small { color: var(--px-muted); font-size: .75rem; }
.px-product-sellers { color: var(--px-muted); font-size: .75rem; }
.px-offer-badge {
  position: absolute; top: .55rem; inset-inline-start: .55rem; display: inline-flex; gap: .25rem; align-items: center;
  padding: .1rem .55rem; border-radius: 1rem; background: var(--ab-red); color: #fff; font-size: .74rem; font-weight: 700;
}
.px-product-sponsored { box-shadow: 0 0 0 1.5px #E9C46A, var(--px-shadow); }

/* The stepper: a red "+ Add" pill that turns into + qty − once something is in the basket. */
.px-stepper { padding: 0 .75rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.px-best-add .px-stepper { padding: 0; min-width: 14rem; }
.px-add-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; width: 100%; min-height: 44px; border: 0;
  border-radius: 2rem; background: var(--ab-red); color: #fff; font-weight: 700; font-size: .95rem; text-decoration: none;
  transition: background .15s, transform .15s var(--px-ease);
}
.px-add-btn:hover { background: var(--ab-red-dark); color: #fff; }
.px-add-btn:active { transform: scale(.97); }
.px-add-link { width: auto; margin: 0 .75rem .8rem; background: #FDE7D6; color: var(--ab-red-dark); font-size: .88rem; }
.px-add-link:hover { background: #FBD6BE; color: var(--ab-red-dark); }
.px-step-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-radius: 2rem; background: #FDE7D6; overflow: hidden; }
.px-step-btn { width: 44px; height: 44px; flex: none; border: 0; background: var(--ab-red); color: #fff; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; transition: transform .15s var(--px-ease), background .15s; }
.px-step-btn:hover { background: var(--ab-red-dark); }
.px-step-btn:active { transform: scale(.9); }
.px-step-btn .i { width: 20px; height: 20px; }
.px-step-qty { flex: 1; text-align: center; font-weight: 700; font-size: 1.1rem; color: var(--ab-red-dark); font-variant-numeric: tabular-nums; }
.px-step-pack { color: var(--px-muted); font-size: .72rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.px-step-error { color: var(--px-bad); font-size: .78rem; font-weight: 600; text-align: center; }
.px-stepper.is-busy { opacity: .6; pointer-events: none; }
.px-best { align-items: flex-end; justify-content: space-between; }

/* ---------- Basket bar: always in reach while shopping ---------- */
.px-basketbar {
  position: fixed; z-index: 1029; inset-inline: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + var(--safe-b));
  max-width: 34rem; margin-inline: auto; display: flex; align-items: center; gap: .7rem; padding-block: .55rem; padding-inline: .6rem 1rem;
  border-radius: 2rem; background: var(--ab-ink); color: #fff; text-decoration: none; box-shadow: 0 10px 28px rgba(28, 20, 18, .28);
}
.px-basketbar[hidden] { display: none; }
.px-basketbar:hover { color: #fff; background: #2B211E; }
.px-basketbar-icon { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--ab-red); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.px-basketbar-text { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-basketbar-total { background: var(--px-sun); color: var(--px-sun-ink); border-radius: 1.5rem; padding: .35rem .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.px-with-basketbar .px-main { padding-bottom: 6rem; }
@media (max-width: 767.98px) {
  .px-basketbar { bottom: calc(var(--px-tabbar-h) + 10px + var(--safe-b)); }
  body.px-with-basketbar .px-main { padding-bottom: calc(var(--px-tabbar-h) + 6rem + var(--safe-b)); }
}

/* ---------- Top bar and tab bar touches ---------- */
.px-top { box-shadow: 0 1px 0 var(--px-line); border-bottom: 0; }
.px-link.active, .px-link:hover { background: #FDE7D6; color: var(--ab-red-dark); }
@media (max-width: 767.98px) {
  .px-tab { font-size: .72rem; }
  .px-tab.active { background: #FDE7D6; }
}

/* ---------- Offers strip as cards ---------- */
.px-offers-strip { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.px-offer-card { border: 0; box-shadow: var(--px-shadow); background: linear-gradient(135deg, #FFF8E4, #FFEFD9); }
.px-offer-card small { color: var(--px-muted); }
.px-offer-card .px-offer-big { color: var(--ab-red); }

/* ---------- Phones ---------- */
@media (max-width: 575.98px) {
  .px-band { border-radius: 1.2rem; padding: 1.15rem 1rem 2.2rem; }
  .px-band-slim { padding: .95rem .9rem 1.9rem; }
  .px-band .px-search .form-control { min-height: 48px; font-size: .95rem; }
  .px-btn-sun { min-height: 48px; padding-inline: 1rem; }
  .px-quick { gap: .5rem; }
  .px-quick-card { padding: .75rem .6rem; align-items: center; text-align: center; }
  .px-quick-card strong { font-size: .86rem; }
  .px-quick-card small { display: none; }
  .px-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
  .px-cat { padding: .7rem .25rem .6rem; border-radius: .95rem; }
  .px-cat-icon { width: 2.6rem; height: 2.6rem; border-radius: .85rem; }
  .px-cat-icon svg { width: 24px; height: 24px; }
  .px-cat-name { font-size: .76rem; }
  .px-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .px-product-photo { padding: .55rem; }
  .px-product-body { padding: .1rem .6rem .4rem; }
  .px-product-name { font-size: .86rem; }
  .px-product-price { font-size: 1.05rem; }
  .px-stepper { padding: 0 .55rem .65rem; }
  .px-best-add, .px-best-add .px-stepper { width: 100%; min-width: 0; }
}

/* ---------- Motion: one gentle entrance and a pop on change; pages are complete without it. ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* "backwards", not "both": once done, the animation lets go so hover lifts still work. */
  .px-band { animation: px-rise .5s var(--px-ease) backwards; }
  .px-product, .px-cat, .px-quick-card { animation: px-rise .45s var(--px-ease) backwards; animation-delay: calc(var(--px-i, 0) * 35ms); }
  .px-bump { animation: px-pop .35s var(--px-ease); }
  .px-basketbar { animation: px-rise .35s var(--px-ease) backwards; }
}
@keyframes px-rise { from { transform: translateY(10px); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes px-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .px-product, .px-cat, .px-quick-card, .px-add-btn, .px-step-btn { transition: none; }
}

/* == redesign: reorder == */
/* "My suppliers" (home strip and the catalogue's "By supplier" grid), the supplier page (tabs, reorder totals, product
   tiles standing on shelves) and the phone side switch (docs/PORTAL-REDESIGN.md 8A.1-8A.2, section 4). */
.px-supplier-strip { display: flex; gap: .75rem; overflow-x: auto; padding: .15rem .1rem .6rem; margin-bottom: 1rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.px-supplier-strip .px-supplier-card { flex: 0 0 min(15rem, 72vw); scroll-snap-align: start; }
.px-supplier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.px-supplier-card {
  display: flex; flex-direction: column; gap: .6rem; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius);
  padding: .85rem .95rem; color: inherit; text-decoration: none; min-width: 0; box-shadow: 0 1px 2px rgba(28, 20, 18, .05);
  transition: transform .15s ease, box-shadow .15s ease;
}
a.px-supplier-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(28, 20, 18, .1); color: inherit; }
.px-supplier-card.is-pinned { border-color: var(--ab-red, #B4161B); }
.px-supplier-link { display: flex; align-items: center; gap: .7rem; min-height: 44px; color: inherit; text-decoration: none; min-width: 0; }
a.px-supplier-card.px-supplier-link { flex-direction: column; align-items: stretch; }
a.px-supplier-card .px-badge { align-self: flex-start; }
.px-supplier-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.px-supplier-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-supplier-text small { color: var(--px-muted); display: flex; flex-wrap: wrap; gap: .5rem; }
.px-supplier-go {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; border-radius: 2rem;
  background: var(--ab-red, #B4161B); color: #fff; font-weight: 600;
}
.px-supplier-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.px-supplier-actions .btn { min-height: 44px; display: inline-flex; align-items: center; gap: .3rem; }
.px-supplier-badge { width: 3rem; height: 3rem; font-size: 1.1rem; }
.px-pin { min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.px-pin.is-pinned { background: #FFF0ED; color: var(--ab-red, #B4161B); }

.px-switch-by { display: flex; gap: .45rem; margin-bottom: 1rem; }
.px-switch-by .px-chip { min-height: 44px; }

.px-tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--px-line); margin-bottom: 1rem; overflow-x: auto; }
.px-tabs-item {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .9rem; color: var(--px-muted); text-decoration: none;
  font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap;
}
.px-tabs-item:hover { color: inherit; }
.px-tabs-item.active { color: var(--ab-red, #B4161B); border-bottom-color: var(--ab-red, #B4161B); }

.px-reorder-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.px-reorder-stats .px-stat span { display: block; color: var(--px-muted); font-size: .85rem; }

/* Tiles stand on shelves: each tile has a shelf edge under it. */
.px-shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 1.1rem .75rem; margin-bottom: 1.5rem;
  padding: .75rem .6rem 0; border-radius: var(--px-radius); background: linear-gradient(#FBF6EC, #F3EBDD);
}
.px-shelf-item { display: flex; flex-direction: column; gap: .3rem; min-width: 0; padding-bottom: .75rem; border-bottom: 6px solid #D9C7AA; }
.px-times { font-size: .78rem; font-weight: 600; color: var(--px-muted); background: #fff; border-radius: 1rem; padding: .15rem .55rem; align-self: flex-start; }
@media (max-width: 575.98px) { .px-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.px-side-switch {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: 0 .7rem; border-radius: 2rem;
  color: #fff; background: rgba(255,255,255,.12); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.px-side-switch:hover { color: #fff; background: rgba(255,255,255,.2); }
@media (min-width: 768px) { .px-side-switch { display: none; } }
.px-tabbar-selling .px-tab.active { color: #8E1016; }
@media (max-width: 767.98px) { .px-tabbar .px-tab { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .px-supplier-card { transition: none; } }
/* == redesign: loyalty == */
.px-loyalty-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.px-loyalty-stats .px-card + .px-card { margin-top: 0; }
.px-loyalty-stat { display: flex; flex-direction: column; gap: .25rem; }
.px-loyalty-stat > strong { font-size: 1.8rem; font-weight: 800; line-height: 1.2; color: var(--ab-ink); }
.px-loyalty-stat small { color: var(--px-muted); }
.px-loyalty-bar { height: 10px; border-radius: 999px; background: var(--px-muted-bg); overflow: hidden; margin: .35rem 0; }
.px-loyalty-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ab-red), #E0892B); border-radius: inherit; }
.px-loyalty-list { display: flex; flex-direction: column; }
.px-loyalty-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--px-line); flex-wrap: wrap; }
.px-loyalty-row:first-child { border-top: 0; }
.px-loyalty-row-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.px-loyalty-row-main small { color: var(--px-muted); overflow-wrap: anywhere; }
.px-loyalty-points { font-size: 1.1rem; font-weight: 700; }
.px-loyalty-points.is-plus { color: var(--px-ok); }
.px-loyalty-points.is-minus { color: var(--px-bad); }
/* Home: the loyalty card sits between the suppliers strip and the quick tiles; its own space below keeps the tiles off it. */
.px-loyalty-card { margin: 0 0 1rem; display: flex; align-items: center; gap: .9rem; text-decoration: none; color: inherit; min-height: 44px; }
.px-loyalty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ab-tint); color: var(--ab-red); flex: none; }
.px-loyalty-icon .i { width: 22px; height: 22px; }
.px-loyalty-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.px-loyalty-main strong { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.px-loyalty-main small { color: var(--px-muted); }
/* == redesign: selling == */
/* Selling side: dark red → ink band (buying is red → amber), so a person on both sides always knows where they are. */
.px-band-sell { background: linear-gradient(135deg, #8E1016 0%, #4A0F12 55%, #1C1412 100%); }
.px-sell-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.px-sell-stat {
  display: flex; flex-direction: column; gap: .15rem; min-height: 44px; padding: .75rem .8rem; border-radius: 1rem;
  background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; transition: background .15s;
}
.px-sell-stat:hover, .px-sell-stat:focus-visible { background: rgba(255, 255, 255, .2); color: #fff; }
.px-sell-stat strong { font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.px-sell-stat small { opacity: .85; font-size: .78rem; }
.px-sell-stat.is-hot { background: #fff; color: var(--ab-red-dark); }
.px-sell-stat.is-hot small { opacity: 1; color: var(--px-muted); }
.px-sell-stat-icon .i { width: 20px; height: 20px; }

.px-sell-orders { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.px-sell-order { background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: .9rem 1rem; box-shadow: 0 6px 18px rgba(28, 20, 18, .05); }
.px-sell-order header { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; margin-bottom: .5rem; }
.px-sell-order-who { display: flex; flex-direction: column; color: var(--ab-ink); text-decoration: none; min-width: 0; }
.px-sell-order-who strong { overflow-wrap: anywhere; }
.px-sell-order-who small { color: var(--px-muted); }
.px-sell-order-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex: none; }
.px-sell-lines { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .3rem; }
.px-sell-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--px-line-soft); }
.px-sell-lines li small { color: var(--px-muted); grid-column: 1; }
.px-sell-lines li strong { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .92rem; }
.px-sell-line-name { font-weight: 600; overflow-wrap: anywhere; }
.px-sell-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.px-sell-actions .btn { min-height: 44px; }
.px-sell-confirm { flex: 1 1 10rem; }
.px-sell-adjust { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--px-line); }
.px-sell-adjust-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .6rem; align-items: center; margin-bottom: .6rem; }
.px-sell-adjust-row label { overflow-wrap: anywhere; }
.px-sell-adjust-row .px-sell-why { grid-column: 1 / -1; }
.px-sell-stepper { flex-direction: row; align-items: center; padding: 0; gap: .35rem; }
.px-sell-stepper .px-step-qty { width: 4.5rem; text-align: center; min-height: 44px; }
.px-sell-empty { padding: 1.2rem; }

.px-sell-chats { display: grid; gap: .5rem; }
.px-sell-chat { display: flex; gap: .7rem; align-items: flex-start; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: .75rem .9rem; color: var(--ab-ink); text-decoration: none; }
.px-sell-chat:hover { border-color: var(--ab-red); }
.px-sell-chat .px-sell-stat-icon { color: var(--ab-red); }
.px-sell-chat-text { display: flex; flex-direction: column; min-width: 0; }
.px-sell-chat-text span { overflow-wrap: anywhere; }
.px-sell-chat-text small { color: var(--px-muted); }

.px-sell-scanner { display: block; width: 100%; max-width: 420px; margin-top: .75rem; border-radius: .9rem; background: #000; }
.px-sell-prices { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.px-sell-price { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: .5rem .8rem; background: #fff; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: .8rem; }
.px-sell-price.is-paused { background: var(--px-muted-bg); }
.px-sell-price.is-paused .px-sell-price-photo { opacity: .55; }
.px-sell-price-photo { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: .6rem; overflow: hidden; }
.px-sell-price-photo img { width: 100%; height: 100%; object-fit: contain; }
.px-sell-price-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.px-sell-price-body strong { overflow-wrap: anywhere; line-height: 1.3; }
.px-sell-price-body small { color: var(--px-muted); }
.px-sell-price-form { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; }
.px-sell-price-form .form-control { min-height: 44px; max-width: 8rem; font-weight: 700; }
.px-sell-price-form .btn { min-height: 44px; }
.px-sell-price-symbol { color: var(--px-muted); font-weight: 700; }
.px-sell-live { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; }
.px-sell-live .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
.px-sell-live .form-check-label { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

.px-sell-pick { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 60vh; overflow-y: auto; padding: .15rem; }
.px-sell-pick-card { position: relative; display: flex; flex-direction: column; gap: .35rem; }
.px-sell-pick-card[hidden] { display: none; }
.px-sell-pick-check { position: absolute; inset-block-start: .55rem; inset-inline-start: .55rem; width: 1.3rem; height: 1.3rem; accent-color: var(--ab-red); z-index: 1; }
.px-sell-pick-card label {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: .7rem .5rem .6rem; min-height: 44px; cursor: pointer;
  background: #fff; border: 2px solid var(--px-line); border-radius: .9rem; transition: border-color .15s, box-shadow .15s;
}
.px-sell-pick-card label img { width: 72px; height: 72px; object-fit: contain; }
.px-sell-pick-check:checked + label { border-color: var(--ab-red); box-shadow: 0 0 0 3px rgba(180, 22, 27, .15); }
.px-sell-pick-check:focus-visible + label { box-shadow: var(--px-focus); }
.px-sell-pick-name { font-weight: 600; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.px-sell-pick-card small { color: var(--px-muted); }
.px-sell-offer-save { position: sticky; bottom: calc(var(--px-tabbar-h) + .5rem); }
.px-sell-offer-save .btn { min-height: 48px; box-shadow: 0 8px 20px rgba(28, 20, 18, .18); }

@media (max-width: 767.98px) {
  .px-sell-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .px-sell-stats .px-sell-stat:first-child { grid-column: 1 / -1; }
  .px-sell-orders, .px-sell-prices { grid-template-columns: minmax(0, 1fr); }
  .px-sell-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* == redesign: layouts == */
/* A supplier's fridge / shelf layout as the store sees it (/app/suppliers/{id}/layouts): shelves drawn as rows of
   front-facing product photos, one photo per facing (up to 4, then "×n"); tapping one opens the stepper. */
.px-fx-choices { flex-wrap: wrap; margin-bottom: .75rem; }
.px-fx-choices .px-pill { margin-inline-start: .35rem; }
.px-fx { background: #F4F1EA; border: 4px solid #D9D2C3; border-radius: 18px; padding: .75rem; display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.px-fx-fridge { background: linear-gradient(180deg, #F2F8FC, #E6F1F8); border-color: #9CC3DC; }
.px-fx-freezer { background: linear-gradient(180deg, #F1F3FC, #E3E8F8); border-color: #9AA8D8; }
.px-fx-checkout { background: #FBF3EE; border-color: #D8B39A; }
.px-fx-title { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; }
.px-fx-title small { font-weight: 400; color: var(--px-muted); }
.px-fx-shelf { position: relative; background: rgba(255, 255, 255, .55); border-bottom: 8px solid #B9AE98; border-radius: 10px 10px 3px 3px; padding: .5rem .4rem .35rem; }
.px-fx-fridge .px-fx-shelf, .px-fx-freezer .px-fx-shelf { border-bottom-color: #C9D7E2; }
.px-fx-label { font-size: .75rem; color: var(--px-muted); display: block; margin-bottom: .25rem; }
.px-fx-row { list-style: none; margin: 0; padding: 0; display: flex; gap: .35rem; overflow-x: auto; scroll-snap-type: x proximity; }
.px-fx-slot { flex: 0 0 auto; scroll-snap-align: start; position: relative; }
.px-fx-slot summary { list-style: none; cursor: pointer; display: block; position: relative; border-radius: 8px; min-width: 44px; min-height: 44px; }
.px-fx-slot summary::-webkit-details-marker { display: none; }
.px-fx-slot summary:focus-visible { box-shadow: var(--px-focus); outline: none; }
.px-fx-fronts { display: flex; gap: 1px; }
.px-fx-fronts img, .px-fx-fronts .px-nophoto { width: 64px; height: 80px; object-fit: contain; background: #fff; border-radius: 4px; }
@media (min-width: 768px) { .px-fx-fronts img, .px-fx-fronts .px-nophoto { width: 84px; height: 104px; } }
.px-fx-count { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; background: var(--px-top); color: #fff; font-size: .7rem; border-radius: 999px; padding: 0 .4rem; }
.px-fx-tick { position: absolute; inset-block-end: 2px; inset-inline-start: 2px; background: var(--px-ok); color: #fff; border-radius: 999px; width: 1.4rem; height: 1.4rem; display: inline-flex; align-items: center; justify-content: center; }
.px-fx-tick svg { width: .9rem; height: .9rem; }
.px-fx-slot.is-in-basket summary { box-shadow: 0 0 0 2px var(--px-ok); }
.px-fx-slot details[open] summary { box-shadow: 0 0 0 2px #B4161B; }
.px-fx-pop { position: absolute; z-index: 20; inset-block-start: calc(100% + 6px); inset-inline-start: 0; width: min(16rem, 80vw); background: var(--px-surface); border: 1px solid var(--px-line); border-radius: var(--px-radius); box-shadow: 0 10px 28px rgba(28, 20, 18, .18); padding: .65rem; display: flex; flex-direction: column; gap: .35rem; }
.px-fx-name { font-weight: 600; color: inherit; }
/* The row scrolls sideways; an open card must not be cut off by it. */
.px-fx-row:has(details[open]) { overflow: visible; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) {
  .px-fx-pop { animation: px-fx-pop .15s ease-out; }
}
@keyframes px-fx-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* == redesign: photos == */
.ph-score { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: center; }
.ph-score-num { font-size: 1.1rem; }
.ph-score-num strong { font-size: 2rem; font-weight: 800; color: var(--tx-red, #B4161B); }
.ph-score-text { display: flex; flex-direction: column; gap: .1rem; }
.ph-score-text small { color: #6b5e55; }
.ph-score-bar { grid-column: 1 / -1; height: .5rem; background: #efe7da; border-radius: 1rem; overflow: hidden; }
.ph-score-bar span { display: block; height: 100%; background: #1f7a3f; }
.ph-tips { display: grid; grid-template-columns: 5rem 5rem 1fr; gap: .75rem; align-items: start; }
.ph-example { margin: 0; text-align: center; font-size: .8rem; }
.ph-example svg { width: 100%; height: auto; border-radius: .5rem; display: block; }
.ph-example.is-bad figcaption { color: #8E1016; }
.ph-tip-list { margin: 0; padding-inline-start: 1.1rem; font-size: .9rem; }
.ph-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.ph-item { padding: .9rem; }
.ph-item-head { display: flex; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.ph-item-photo { width: 4rem; height: 4rem; flex: none; display: grid; place-items: center; background: #fff; border: 1px solid #e6dfd3; border-radius: .5rem; overflow: hidden; }
.ph-item-photo img { width: 100%; height: 100%; object-fit: contain; }
.ph-item-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.ph-item-text small { color: #6b5e55; }
.ph-frame { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: 100%; max-width: 20rem; margin: 0 auto; background: #fff; border: 2px dashed #c9c2b6; border-radius: .75rem; overflow: hidden; cursor: pointer; }
.ph-frame:focus-within { outline: 3px solid #B4161B; outline-offset: 2px; }
.ph-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ph-frame-guide { position: absolute; inset: 6%; border: 2px solid rgba(31, 122, 63, .55); border-radius: .4rem; pointer-events: none; }
.ph-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ph-frame-text { position: relative; z-index: 1; background: rgba(255, 255, 255, .9); padding: .35rem .6rem; border-radius: 1rem; font-size: .85rem; pointer-events: none; }
.ph-upload.is-small .ph-frame { border-color: #8E1016; }
.ph-upload.is-small .ph-frame-text { color: #8E1016; }
@media (max-width: 575.98px) { .ph-tips { grid-template-columns: 4rem 4rem 1fr; } }

/* ---------- Suppliers first (owner, 2026-11-20; docs/PORTAL-REDESIGN.md) ---------- */
/* A supplier's mark: a fixed square; the logo sits on top of the initials badge and never changes the square's size. */
.px-mark {
  --px-hue: 0;
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 3.5rem; aspect-ratio: 1; max-width: 100%; border-radius: 22%;
  background: hsl(var(--px-hue) 45% 38%); color: #fff; font-weight: 700;
}
.px-mark > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.px-mark-initials { font-size: 1.1rem; letter-spacing: .02em; }
.px-mark-more { background: transparent; color: var(--px-muted); border: 1px dashed var(--px-line); }
.px-badge-logo { position: relative; overflow: hidden; }
.px-badge-logo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; border-radius: inherit; }

/* Home tiles: same size whatever the name or logo; names get two lines, never an ellipsis mid-word. */
.px-sup-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.px-sup-tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; min-width: 0;
  padding: .9rem .6rem .8rem; background: var(--px-surface, #fff); border: 1px solid var(--px-line); border-radius: 1.1rem;
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.px-sup-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(28, 20, 18, .1); color: inherit; }
.px-sup-tile.is-pinned { border-color: var(--ab-red, #B4161B); }
.px-sup-tile .px-mark { width: min(5rem, 70%); margin-bottom: .25rem; }
.px-sup-name { font-size: .92rem; line-height: 1.3; width: 100%; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(2 * 1.3em); }
.px-sup-kind { display: inline-flex; align-items: center; gap: .25rem; color: var(--px-muted); font-size: .78rem; }
.px-sup-kind .i { width: 15px; height: 15px; }
.px-sup-meta { color: var(--px-ok, #1E6B44); font-size: .76rem; font-weight: 600; min-height: 1.2em; }
.px-sup-all .px-sup-meta { color: var(--px-muted); font-weight: 400; }
@media (max-width: 575.98px) {
  .px-sup-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .px-sup-tile { padding: .65rem .35rem .6rem; border-radius: .9rem; }
  .px-sup-name { font-size: .8rem; }
  .px-sup-kind { font-size: .68rem; }
  .px-sup-meta { font-size: .66rem; }
}

/* Category chips: the second way in, one scrolling row. */
.px-cat-chips { display: flex; gap: .5rem; overflow-x: auto; padding: .1rem .1rem .5rem; scrollbar-width: thin; }
.px-cat-chip {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--px-line); border-radius: 999px; background: var(--px-surface, #fff); color: var(--ab-ink);
  font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.px-cat-chip svg, .px-cat-chip .i { width: 18px; height: 18px; flex: none; color: var(--ab-red); }
.px-cat-chip:hover { border-color: #D38D8F; color: var(--ab-ink); }
.px-cat-chip.is-on { background: var(--ab-red); border-color: var(--ab-red); color: #fff; }
.px-cat-chip.is-on .i { color: #fff; }

/* Suppliers page. */
.px-sup-filters { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.px-sup-find { max-width: 36rem; }
.px-sup-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.px-sup-card { display: flex; flex-direction: column; gap: .65rem; min-width: 0; padding: .9rem; background: var(--px-surface, #fff);
  border: 1px solid var(--px-line); border-radius: 1.1rem; }
.px-sup-card.is-pinned { border-color: var(--ab-red, #B4161B); }
.px-sup-card[hidden] { display: none; }
.px-sup-card-top { display: flex; align-items: center; gap: .75rem; min-width: 0; color: inherit; text-decoration: none; }
.px-sup-card-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.px-sup-card-text strong { line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.px-sup-card-text small { display: flex; flex-wrap: wrap; gap: .25rem .6rem; color: var(--px-muted); font-size: .8rem; }
.px-sup-brands { display: flex; flex-wrap: wrap; gap: .35rem; }
.px-brand-tag { font-size: .76rem; font-weight: 700; padding: .2rem .55rem; border-radius: .5rem; background: #fff; border: 1px solid var(--px-line); color: var(--ab-ink); }
.px-brand-tag.is-more { border-style: dashed; color: var(--px-muted); }
.px-sup-card .px-supplier-actions { margin-top: auto; }
.px-sup-go { flex: 1 1 auto; justify-content: center; }

/* Product cards: the photo stage is a fixed square whatever the photo's shape (a tall can or a wide bag used to
   stretch the card: an aspect-ratio box grows with its content unless its minimum height is 0). The name keeps
   two lines and the size line keeps its place, so prices line up across a row. */
.px-product-photo { position: relative; aspect-ratio: 1 / 1; min-height: 0; overflow: hidden; }
.px-product-photo img { position: absolute; inset: .75rem; width: calc(100% - 1.5rem); height: calc(100% - 1.5rem); object-fit: contain; }
.px-product-photo .px-nophoto { position: absolute; inset: 0; display: grid; place-items: center; }
.px-product-name { min-height: calc(2 * 1.6em); }
.px-product-size { min-height: 1.3em; }
@media (max-width: 575.98px) {
  .px-product-photo img { inset: .5rem; width: calc(100% - 1rem); height: calc(100% - 1rem); }
}
@media (prefers-reduced-motion: reduce) { .px-sup-tile { transition: none; } }
.px-sup-date { white-space: nowrap; }
.px-section-head > a { white-space: nowrap; }
.px-band-row > .px-mark { width: 3.5rem; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.px-fx-auto { padding: .85rem 1rem; margin-bottom: .75rem; border-inline-start: 4px solid var(--ab-red); }
.px-fx-auto .i { color: var(--ab-red); }
.px-fx-agree { margin: 1rem 0; }
.px-fx-agree .btn { width: 100%; }
@media (min-width: 768px) { .px-fx-agree .btn { width: auto; } }
/* Layouts follow the portal's motion (px-rise, the same as product cards): the fixture rises in, the products on its
   shelves follow one after another, and the "agree" note and button come last. */
@media (prefers-reduced-motion: no-preference) {
  .px-fx, .px-fx-auto, .px-fx-agree { animation: px-rise .45s var(--px-ease) backwards; }
  .px-fx-slot { animation: px-rise .4s var(--px-ease) backwards; animation-delay: calc(min(var(--px-i, 0), 24) * 30ms); }
}
/* Language switch in the signed-in top bar: same round button as chats and the bell, with "ع" / "EN" as its face. */
.px-langbtn { font-weight: 700; font-size: .95rem; text-decoration: none; }

/* == redesign: black top bar (owner, 2026-11-21: "change the design to black, no slant in mobile, and reflect it in
   Arabic"; mock-up docs/design/portal-suppliers-first.html) ==
   The top bar is ink black again with light text on every size (it overrides the white bar of the earlier refresh).
   On phones the band hangs straight under it, edge to edge, rounded at the bottom and without the slant; wider
   screens keep the slant. In Arabic the gradient is mirrored so its dark red sits on the reading start (right). */
.px-top { background: var(--px-top); color: #F3EBDD; border-bottom: 0; box-shadow: none; }
.px-company, .px-company:hover, .px-wordmark { color: #fff; }
.px-company-text small { color: #CDBFAE; }
.px-link, .px-lang { color: #F3EBDD; }
.px-link:hover, .px-lang:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.px-link.active { background: var(--ab-red); color: #fff; }
.px-top .px-iconbtn { color: #F3EBDD; border-color: #4A3F3B; background: transparent; }
.px-top .px-iconbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.px-top .px-iconbtn.active { background: var(--ab-red); border-color: var(--ab-red); color: #fff; }
.px-switch .form-select { background-color: #2B211E; border-color: #4A3F3B; color: #F3EBDD; }
.px-badge { box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }

/* Mirrored gradients for Arabic (118deg ↔ 242deg, 135deg ↔ 225deg). */
[dir="rtl"] body.px, [dir="rtl"] .px { --px-grad: linear-gradient(242deg, #8E1016 0%, #B4161B 42%, #E8812A 100%); }
[dir="rtl"] .px-band-sell { background: linear-gradient(225deg, #8E1016 0%, #4A0F12 55%, #1C1412 100%); }

@media (max-width: 767.98px) {
  /* No slant on phones, in either language. */
  .px-band, [dir="rtl"] .px-band { clip-path: none; border-radius: 0 0 22px 22px; padding-bottom: 1.25rem; }
  .px-band-slim, [dir="rtl"] .px-band-slim { padding-bottom: 1.05rem; }
  /* The page's first band joins the black bar: no gap above and full width (the page padding is 1rem / .9rem). */
  .px-main > .px-band:first-child { margin: -1rem -.9rem 1.1rem; }
}
/* The attached band fades in without rising, so no gap opens under the black bar while it moves. */
@media (max-width: 767.98px) and (prefers-reduced-motion: no-preference) {
  .px-main > .px-band:first-child { animation-name: px-fade; }
}
@keyframes px-fade { from { opacity: .35; } to { opacity: 1; } }
