/* ============================================================================
   AI-ENG MART - site.css : هوية متجر «أسواق AI-ENG» التجريبي - المظهران الفاتح والغامق
   EN: Styles of the «AI-ENG Mart» demo store - light and dark themes
   ----------------------------------------------------------------------------
   - كل الألوان متغيرات هنا فقط (:root و[data-theme="dark"]). لا تدرّج لوني للزينة.
   - الألوان دلالة: أخضر --ok = عرض/متوفر/تم، أحمر --bad = نفد/خطأ، ذهبي --warn = كمية محدودة، والأزرق المخضر --brand هوية المتجر،
     والأصفر --accent لمسة الهوية في العلامة والعناوين فقط.
   - الخطان: Baloo Bhaijaan 2 للعناوين، وCairo للنص. RTL أولًا مع خصائص منطقية (inline-start/end).
   - الجوال 375px: هوامش 16px وبلا تمرير أفقي. وتقليل الحركة يلغي الانتقالات.
   ============================================================================ */
:root {
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1200px;
  --gutter: 16px;
  --f-display: "Baloo Bhaijaan 2", "Cairo", Tahoma, sans-serif;
  --f-body: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --bg: #F6F7F2;
  --bg-alt: #ECF1EC;
  --surface: #FFFFFF;
  --surface-2: #F1F4EF;
  --line: #DCE3DC;
  --text: #1B2527;
  --text-soft: #3A4749;
  --mute: #5C6A6C;
  --brand: #0E5E6F;
  --brand-strong: #0A4A58;
  --brand-ink: #FFFFFF;
  --brand-soft: #E1EFF1;
  --accent: #F2B705;
  --ok: #1D7A3A;
  --ok-soft: #E3F3E7;
  --warn: #9A6200;
  --warn-soft: #FBF0D9;
  --bad: #B3261E;
  --bad-soft: #FBE5E3;
  --info: #285E9E;
  --info-soft: #E3ECF8;
  --tile: #EEF3EE;
  --focus: #F2B705;
  --shadow: 0 1px 2px rgba(20, 40, 40, .06), 0 6px 20px rgba(20, 40, 40, .07);
  --scrim: rgba(10, 20, 22, .48);
  --ill-line: rgba(20, 30, 30, .55);
  --ill-shadow: rgba(20, 40, 40, .10);
  --map-bg: #E6EDE4;
  --map-road: #FFFFFF;
  --map-block: #D3DDD1;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1517;
  --bg-alt: #131C1F;
  --surface: #172124;
  --surface-2: #1D292D;
  --line: #2B3A3E;
  --text: #E6EEEC;
  --text-soft: #C8D3D1;
  --mute: #97A6A4;
  --brand: #4DB3C6;
  --brand-strong: #7CCAD8;
  --brand-ink: #0B1B1F;
  --brand-soft: #173238;
  --accent: #F5C536;
  --ok: #5BC77F;
  --ok-soft: #173326;
  --warn: #F0B04A;
  --warn-soft: #3A2E15;
  --bad: #FF7A6E;
  --bad-soft: #3D1D1B;
  --info: #84B4F0;
  --info-soft: #1B2A3D;
  --tile: #1E2B2F;
  --focus: #F5C536;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --scrim: rgba(0, 0, 0, .62);
  --ill-line: rgba(0, 0, 0, .55);
  --ill-shadow: rgba(0, 0, 0, .35);
  --map-bg: #1C282B;
  --map-road: #33464B;
  --map-block: #26363A;
  color-scheme: dark;
}

/* ---------------- الأساس ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.65;
  overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column;
}
body.locked { overflow: hidden; }
main { flex: 1; outline: none; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.25; margin: 0 0 .4em; color: var(--text); }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 .7em; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.mute { color: var(--mute); }
.small { font-size: .88rem; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
[dir="ltr"] .flip { display: inline-block; transform: scaleX(-1); }
code { font-family: Consolas, "Courier New", monospace; }

.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 8px; color: var(--brand-ink); }

/* ---------------- شريط المتجر التجريبي ---------------- */
.demo-bar {
  background: var(--info-soft); color: var(--text); border-bottom: 1px solid var(--line);
  text-align: center; font-size: .86rem; padding: 6px var(--gutter); line-height: 1.5;
}
.demo-bar i { color: var(--info); }
.demo-bar a { font-weight: 700; color: var(--info); white-space: nowrap; }

/* ---------------- الأزرار والحقول ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; padding: 8px 18px;
  border-radius: 999px; border: 2px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: 700 .97rem/1.2 var(--f-body); cursor: pointer; text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand-strong); }
.btn.ghost.bad { color: var(--bad); border-color: var(--bad); }
.btn.ghost.bad:hover { background: var(--bad-soft); }
.btn.big { min-height: 50px; padding: 10px 24px; font-size: 1.05rem; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .86rem; }
.btn.block { width: 100%; }
.btn[disabled] { background: var(--surface-2); border-color: var(--line); color: var(--mute); cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: inline-grid; place-items: center; cursor: pointer; font: 700 .95rem var(--f-body); flex: none;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.link-btn { background: none; border: 0; padding: 6px 4px; font: 600 .86rem var(--f-body); color: var(--brand); cursor: pointer; min-height: 36px; }
.link-btn.bad { color: var(--bad); }
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; min-height: 36px; margin: 0; }
label.check input { width: 20px; height: 20px; accent-color: var(--brand); }
input[type="text"], input[type="search"], input[type="tel"], input[type="number"], select {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font: 500 1rem var(--f-body);
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.row-input { display: flex; gap: 8px; align-items: center; }
.row-input input { flex: 1; min-width: 0; }
.row-input .unit { color: var(--mute); font-weight: 700; }
.msg { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; font-weight: 600; font-size: .9rem; padding: 8px 10px; border-radius: var(--radius-sm); }
.msg.ok { color: var(--ok); background: var(--ok-soft); }
.msg.bad { color: var(--bad); background: var(--bad-soft); }

/* ---------------- الرأس ---------------- */
.site-head { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand .mark { flex: none; }
.brand-word { font-family: var(--f-display); font-size: 1.3rem; line-height: 1; white-space: nowrap; display: inline-flex; align-items: baseline; gap: .28em; }
[dir="ltr"] .brand-word { flex-direction: row-reverse; }
.brand-word b { color: var(--brand); font-weight: 800; }
.brand-latin { font-weight: 800; letter-spacing: .02em; border-bottom: 3px solid var(--accent); }
.nav { margin-inline-start: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--text-soft); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--brand); }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.head-tools { display: flex; align-items: center; gap: 8px; }
.branch-pick { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--brand); }
.branch-pick select { min-height: 42px; width: auto; max-width: 150px; padding-block: 6px; font-weight: 700; font-size: .9rem; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink); border: 0; font-size: 1.2rem; cursor: pointer;
}
.cart-btn:hover { background: var(--brand-strong); }
.cart-count { font: 800 .82rem var(--f-body); background: var(--brand-ink); color: var(--brand); min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; padding: 0 5px; }
.cart-count.has { background: var(--accent); color: #1B2527; }
.menu-btn { display: none; }

@media (max-width: 1060px) {
  .menu-btn { display: inline-grid; }
  .nav { position: absolute; inset-inline: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); display: none; margin: 0; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: 8px var(--gutter) 14px; }
  .nav a { padding: 12px; }
  .head-tools { margin-inline-start: auto; }
}
@media (max-width: 560px) {
  .head-row { gap: 8px; min-height: 60px; }
  .brand-word { font-size: 1.05rem; }
  .brand .mark { width: 34px; height: 34px; }
  .head-tools { gap: 6px; }
  .branch-pick i { display: none; }
  .branch-pick select { max-width: 104px; font-size: .8rem; padding-inline: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .cart-btn { padding: 0 10px; height: 38px; }
  .site-head .brand-word { display: none; }
}

/* ---------------- الأقسام ---------------- */
.section { padding: 48px 0; }
.section.tight { padding: 24px 0 48px; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-sub { color: var(--text-soft); max-width: 760px; }
.more { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.page-head { padding: 36px 0 8px; }
.eyebrow { color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.lead { font-size: 1.1rem; color: var(--text-soft); max-width: 640px; }

/* ---------------- البطل ---------------- */
.hero { padding: 40px 0 48px; background: var(--brand-soft); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
.hero h1 { color: var(--text); }
.hero-facts { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-soft); font-weight: 600; font-size: .93rem; }
.hero-facts i { color: var(--brand); }
.hero-panel { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel-title { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--accent); }
.hero-offers { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.hero-offer { display: grid; grid-template-columns: auto 1fr 64px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--ok-soft); border-inline-start: 4px solid var(--ok); }
.ho-big { font: 800 1.5rem/1 var(--f-display); color: var(--ok); min-width: 56px; text-align: center; }
.ho-title { font-weight: 700; margin: 0; line-height: 1.35; }
.hero-offer .mute { margin: 0; }
.ho-art { width: 64px; height: 64px; display: grid; place-items: center; }
.ho-icon { font-size: 2rem; color: var(--ok); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .hero-offer { grid-template-columns: auto 1fr 44px; gap: 8px; } .ho-art { width: 44px; height: 44px; } .ho-big { min-width: 44px; font-size: 1.3rem; } .hero-panel { padding: 14px; } }

/* ---------------- التصنيفات ---------------- */
.cat-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 14px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s var(--ease); height: 100%; }
.cat-tile:hover { border-color: var(--brand); color: var(--text); transform: translateY(-2px); }
.cat-art { width: 86px; height: 86px; background: var(--tile); border-radius: 50%; display: grid; place-items: center; padding: 8px; }
.cat-name { font-weight: 700; margin-top: 6px; }
.cat-name i { color: var(--brand); }
@media (max-width: 420px) { .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------- العروض ---------------- */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.offer .btn { margin-top: auto; align-self: flex-start; }
.offer-head { display: flex; align-items: center; justify-content: space-between; }
.offer-head i { font-size: 1.6rem; color: var(--ok); }
.offer-big { font: 800 2rem/1 var(--f-display); color: var(--ok); }
.offer-items { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.offer-items li { width: 52px; height: 52px; background: var(--tile); border-radius: 12px; padding: 4px; }
.codes-box { margin-top: 22px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; }
.codes-box h3 { display: flex; gap: 8px; align-items: center; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.code-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border-inline-start: 4px solid var(--line); }
.code-row.ok { border-color: var(--ok); }
.code-row.warn { border-color: var(--warn); }
.code-row.bad { border-color: var(--bad); }
.code-row code { font-weight: 800; font-size: 1rem; color: var(--text); background: var(--surface); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.code-row span { font-size: .9rem; }
@media (max-width: 560px) { .code-row { grid-template-columns: auto 1fr; } .code-row .btn { grid-column: 1 / -1; justify-self: start; } }

/* ---------------- الشبكة وبطاقة الصنف ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: box-shadow .2s var(--ease), border-color .2s; }
.card:hover { box-shadow: var(--shadow); border-color: var(--brand-soft); }
.card.is-out .ill { opacity: .45; filter: grayscale(.7); }
.card-art { position: relative; display: block; width: 100%; aspect-ratio: 1 / .82; background: var(--tile); border: 0; padding: 12px 18px; cursor: pointer; }
.card-art .ill { width: 100%; height: 100%; }
.badges { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font: 700 .74rem/1.6 var(--f-body); white-space: nowrap; }
.badge.ok { background: var(--ok); color: #fff; }
:root[data-theme="dark"] .badge.ok { color: #0B1B12; }
.badge.muted { background: var(--surface); color: var(--mute); border: 1px solid var(--line); }
.badge.info { background: var(--info-soft); color: var(--info); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body .btn { margin-top: auto; min-height: 40px; padding-inline: 10px; font-size: .9rem; }
.card-title { font-family: var(--f-body); font-size: .98rem; font-weight: 700; margin: 0; line-height: 1.4; }
.price { margin: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.price s { font-size: .86rem; }
.money { font-weight: 800; white-space: nowrap; }
.price .money { font-size: 1.15rem; color: var(--text); }
.money.ok, .price .money.ok { color: var(--ok); }
.money .cur { font-size: .78em; font-weight: 700; color: var(--mute); }
.per { font-size: .8rem; color: var(--mute); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 6px; background: var(--info-soft); color: var(--info); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.stock { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; margin-bottom: 6px; }
.stock.ok { color: var(--ok); }
.stock.low { color: var(--warn); }
.stock.out { color: var(--bad); }
@media (max-width: 380px) { .card-body { padding: 8px 9px 10px; } .card-title { font-size: .9rem; } .price .money { font-size: 1.02rem; } .badge { font-size: .68rem; } }

/* ---------------- المتجر ---------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 14px; }
.field { min-width: 0; }
.field.grow { flex: 1 1 280px; }
.field.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.search-box { position: relative; }
.search-box i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: var(--mute); pointer-events: none; }
.search-box input { padding-inline-start: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text-soft); font: 600 .9rem var(--f-body); cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.sub { font-size: .84rem; }
.result-count { margin: 12px 0; font-weight: 600; }
.empty { text-align: center; padding: 28px 12px; color: var(--mute); }
.empty i { font-size: 2.6rem; color: var(--brand); display: block; margin-bottom: 6px; }
.empty.wide { grid-column: 1 / -1; }

/* ---------------- الإعلانات الصغيرة ---------------- */
.teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.teaser { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); transition: border-color .2s; }
.teaser:hover { border-color: var(--brand); color: var(--text); }
.teaser > i { font-size: 1.8rem; color: var(--brand); }
.teaser h2 { font-size: 1.2rem; margin-top: 6px; }
.teaser p { color: var(--text-soft); }
.teaser .more { color: var(--brand); margin-top: auto; }
.teaser.system > i { color: var(--accent); }
@media (max-width: 860px) { .teasers { grid-template-columns: 1fr; } }

/* ---------------- الولاء ---------------- */
.steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: none; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; margin-bottom: 8px; }
.steps p { color: var(--text-soft); font-size: .93rem; margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.rule-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rule-list li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; background: var(--surface); padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.rule-list i { color: var(--brand); font-size: 1.15rem; }
.lookup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.lookup h2 { font-size: 1.25rem; display: flex; gap: 8px; align-items: center; }
.lookup-form { margin-bottom: 10px; }
.lookup-out { margin-top: 14px; outline: none; }
.loy-card { border-radius: var(--radius); padding: 18px; background: var(--brand); color: var(--brand-ink); }
.loy-card .mute { color: inherit; opacity: .85; }
.loy-card .btn { background: var(--brand-ink); color: var(--brand); border-color: var(--brand-ink); margin-top: 6px; }
.loy-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.demo-chip { font-size: .76rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; border: 1.5px solid currentColor; }
.loy-name { font: 800 1.4rem/1.2 var(--f-display); margin: 0; }
.loy-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.loy-stats div { background: rgba(255, 255, 255, .14); border-radius: 12px; padding: 8px 12px; }
:root[data-theme="dark"] .loy-stats div { background: rgba(0, 0, 0, .14); }
.loy-stats dt { font-size: .8rem; opacity: .9; }
.loy-stats dd { margin: 0; font: 800 1.35rem var(--f-display); }
.loy-stats .money .cur { color: inherit; }

/* ---------------- الفروع ---------------- */
.branches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 860px) { .branches { grid-template-columns: 1fr; } }
.branch { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.branch.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.map { display: block; width: 100%; height: auto; }
.branch-body { padding: 16px 18px 18px; }
.branch-body h2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 1.35rem; }
.facts { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.facts li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; color: var(--text-soft); }
.facts i { color: var(--brand); }
details.tax { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
details.tax summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
details.tax p { margin: 6px 0 0; }

/* ---------------- السلة (الدرج) ---------------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100vw); z-index: 60; background: var(--surface);
  box-shadow: var(--shadow); display: flex; flex-direction: column; outline: none; transform: translateX(0);
}
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.35rem; margin: 0; }
.drawer-head p { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px 24px; overscroll-behavior: contain; }
.lines { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; }
.line.line-bad { border-color: var(--bad); background: var(--bad-soft); }
.line-art { width: 56px; height: 56px; background: var(--tile); border-radius: 10px; padding: 3px; }
.line-main { min-width: 0; }
.line-name { font-weight: 700; margin: 0; line-height: 1.35; }
.line-main .mute { margin: 0; }
.line-disc { margin: 2px 0 0; font-size: .84rem; color: var(--ok); font-weight: 700; }
.line-note { margin: 2px 0 0; font-size: .82rem; color: var(--mute); }
.line-note.bad { color: var(--bad); font-weight: 700; }
.line-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.line-total { margin-inline-start: auto; display: flex; gap: 6px; align-items: baseline; }
.line-total s { font-size: .82rem; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper button { width: 36px; height: 36px; border: 0; background: none; color: var(--brand); font-size: 1.1rem; cursor: pointer; border-radius: 50%; }
.stepper button:hover { background: var(--brand-soft); }
.stepper span { min-width: 44px; text-align: center; font-weight: 700; font-size: .9rem; }
.box { background: var(--surface-2); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.box .mute.small { margin: 6px 0 0; }
.box select { margin-bottom: 4px; }
.totals { margin: 0 0 14px; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; gap: 10px; }
.totals dt { font-weight: 600; }
.totals dd { margin: 0; }
.totals .grand { font-size: 1.12rem; padding-top: 6px; border-top: 1px solid var(--line); }
.totals .grand dt, .totals .grand .money { font-weight: 800; }
.totals .mute { font-size: .9rem; }
.totals .ok-row, .totals .ok-row .money { color: var(--ok); font-weight: 700; }
.totals.compact { margin: 12px 0; }

/* ---------------- الحوار ---------------- */
.dlg-wrap { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.dlg { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); outline: none; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { font-size: 1.25rem; margin: 0; }
.dlg-body { padding: 16px; }
.dlg-body input + .mute { margin-top: 4px; }
.notice { display: grid; grid-template-columns: 28px 1fr; gap: 8px; background: var(--info-soft); border-radius: 12px; padding: 12px; }
.notice > i { color: var(--info); font-size: 1.3rem; }
.notice p { margin: 0 0 4px; }
.co-steps { padding-inline-start: 22px; color: var(--text-soft); font-size: .93rem; }
.pd { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: start; }
.pd-art { background: var(--tile); border-radius: var(--radius); padding: 10px; aspect-ratio: 1; }
.pd-price { margin: 0; }
.pd-price .price { margin: 0; }
.pd-flags { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 2px; font-size: .88rem; color: var(--text-soft); }
.pd-flags i { color: var(--brand); width: 18px; display: inline-block; }
.pd-flags .ok, .pd-flags .ok i { color: var(--ok); font-weight: 700; }
.pd-form { margin-top: 14px; display: grid; gap: 8px; }
.pd-form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; margin: 0; }
.pd-form legend { font-weight: 700; padding: 0 6px; }
.opts { display: grid; gap: 6px; }
.opt { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 0; padding: 6px 8px; border-radius: 10px; cursor: pointer; min-height: 40px; }
.opt:hover { background: var(--surface-2); }
.opt input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.opt.disabled { opacity: .55; cursor: not-allowed; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ill-line); flex: none; }
.pd-line { margin: 4px 0; font-weight: 700; }
@media (max-width: 480px) { .pd { grid-template-columns: 96px 1fr; } }

/* ---------------- التنبيهات ---------------- */
.toasts { position: fixed; bottom: 16px; inset-inline: 16px; z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 440px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 600; display: flex; gap: 8px; align-items: center; transition: opacity .35s, transform .35s var(--ease);
}
.toast.ok i { color: var(--ok); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.bad i { color: #fff; }
.toast.info i { color: var(--accent); }
:root[data-theme="dark"] .toast.ok i { color: #1D7A3A; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------------- التذييل ---------------- */
.site-foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 0; padding: 36px 0 16px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr .7fr 1.2fr .9fr; gap: 24px; }
.foot-grid p { color: var(--text-soft); font-size: .92rem; }
.foot-brand .brand { margin-bottom: 8px; }
.foot-h { font-size: 1rem; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.foot-links a { color: var(--text-soft); text-decoration: none; }
.foot-links a:hover { color: var(--brand); }
.foot-disclaimer { display: flex; gap: 6px; font-weight: 700; color: var(--text) !important; }
.foot-disclaimer i { color: var(--info); }
.foot-small { font-size: .84rem !important; }
.powered { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: var(--mute); font-size: .86rem; font-weight: 600; }
.powered-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.powered-link:hover { border-color: var(--brand); color: var(--text); }
.powered-link img { width: 120px; height: auto; display: block; }
.powered-name { font: 800 1.05rem var(--f-display); }
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 14px; color: var(--mute); font-size: .84rem; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------------- تقليل الحركة ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
