/* =====================================================================
   حِبر — مكتبة عربية دافئة وعصرية
   ثلاثة ألوان فقط: كريمي #FBF6F0 · فحمي #26221F · طوبي #C0532C
   كل الدرجات الأخرى مشتقة منها بالمزج (color-mix) أو الشفافية.
   مكتوب "للجوال أولًا": القواعد الأساسية للشاشات الصغيرة، ثم min-width للأكبر.
   ===================================================================== */

/* ===== الخطوط =====
   تُعرَّف في fonts.css التي يولّدها الخادم: خط ثمانية محليًا (إن وُجدت ملفاته)، وخط مجاني (IBM Plex Sans Arabic + Amiri) على الإنترنت */

/* ===== الألوان والخطوط ===== */
:root {
  --c-cream: #FBF6F0;
  --c-ink: #26221F;
  --c-gold: #C0532C;

  /* أدوار الألوان (تتبدّل في الوضع الليلي) */
  --bg: var(--c-cream);
  --ink: var(--c-ink);                                          /* لون النص */
  --muted: color-mix(in srgb, var(--ink) 62%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 12%, var(--bg));
  --surface: color-mix(in srgb, var(--c-ink) 3%, var(--bg));    /* بطاقات */
  --surface-2: color-mix(in srgb, var(--c-ink) 7%, var(--bg));  /* خلفيات ثانوية */
  --paper: var(--surface);
  --gold: var(--c-gold);
  --gold-soft: color-mix(in srgb, var(--c-gold) 14%, var(--bg));
  --deep: var(--c-ink);                                         /* أقسام داكنة (كتاب الشهر، التذييل) */
  --on-deep: var(--c-cream);
  --btn: var(--c-ink);
  --on-btn: var(--c-cream);

  /* أسماء قديمة تستخدمها لوحة التحكم وأجزاء من الواجهة */
  --brand: var(--gold);
  --brand-2: color-mix(in srgb, var(--c-gold) 85%, var(--c-ink));
  --forest: var(--deep);
  --forest-2: color-mix(in srgb, var(--deep) 88%, var(--c-gold));
  --success: var(--gold);
  --wood: var(--gold);

  --shadow-sm: 0 2px 12px -4px color-mix(in srgb, var(--c-ink) 18%, transparent);
  --shadow: 0 28px 50px -24px color-mix(in srgb, var(--c-ink) 45%, transparent);
  --radius: 20px;
  --t: 250ms cubic-bezier(.2, .7, .2, 1);
  --gutter: 16px;
  --font-body: "Site Sans", system-ui, sans-serif;
  --font-display: "Site Display", "Site Sans", serif;
  --paper-grain: none;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: var(--c-ink);
  --ink: var(--c-cream);
  --surface: color-mix(in srgb, var(--c-cream) 5%, var(--c-ink));
  --surface-2: color-mix(in srgb, var(--c-cream) 9%, var(--c-ink));
  --deep: color-mix(in srgb, var(--c-cream) 6%, var(--c-ink));
  --btn: var(--c-gold);
  --on-btn: var(--c-ink);
  --shadow-sm: 0 2px 12px -4px rgba(0, 0, 0, .5);
  --shadow: 0 28px 50px -24px rgba(0, 0, 0, .75);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: var(--c-ink); --ink: var(--c-cream);
    --surface: color-mix(in srgb, var(--c-cream) 5%, var(--c-ink));
    --surface-2: color-mix(in srgb, var(--c-cream) 9%, var(--c-ink));
    --deep: color-mix(in srgb, var(--c-cream) 6%, var(--c-ink));
    --btn: var(--c-gold); --on-btn: var(--c-ink);
    --shadow-sm: 0 2px 12px -4px rgba(0, 0, 0, .5); --shadow: 0 28px 50px -24px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}

/* ===== أساسيات ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg); line-height: 1.8;
  font-family: var(--font-body); font-size: 16px; -webkit-font-smoothing: antialiased;
  transition: background-color var(--t), color var(--t);
  padding-bottom: 92px; /* مساحة لزر واتساب الثابت */
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; transition: color var(--t); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background-color: var(--surface); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.35; margin: 0; letter-spacing: 0; }
img { max-width: 100%; }
.container { width: min(1200px, 100% - var(--gutter) * 2); margin-inline: auto; }
.muted { color: var(--muted); }
::selection { background: var(--gold); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ===== الأيقونات: Lucide موحّدة (sprite داخل الصفحة، انظر tools/icons.mjs) ===== */
.ic {
  width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.22em;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.ic--sm { width: 1em; height: 1em; vertical-align: -.14em; }
.ic--lg { width: 28px; height: 28px; }
.ic--fill { fill: currentColor; }
/* أيقونات الاتجاه: سهم "التالي" في الواجهة العربية يشير لليسار — نعكس عند الحاجة فقط */
.ic--flip { transform: scaleX(-1); }

/* ===== أزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 12px 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background-color var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--btn); color: var(--on-btn); }
.btn--primary:hover { background: var(--gold); color: var(--c-ink); box-shadow: 0 12px 24px -12px var(--gold); }
.btn--ghost { border-color: var(--line); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--gold { background: var(--gold); color: var(--c-ink); }
.btn--gold:hover { background: var(--c-cream); }
.btn--outline-light { border-color: color-mix(in srgb, var(--on-deep) 35%, transparent); color: var(--on-deep); background: transparent; }
.btn--outline-light:hover { border-color: var(--gold); color: var(--gold); }
.btn--block { width: 100%; }
.btn:disabled, .add-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.icon-btn {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: border-color var(--t), color var(--t), background-color var(--t), transform var(--t);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn--dark { background: var(--btn); color: var(--on-btn); border-color: transparent; }
.icon-btn--dark:hover { background: var(--gold); color: var(--c-ink); }
.icon-btn .ic { width: 20px; height: 20px; }
.badge {
  position: absolute; top: -4px; inset-inline-start: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--gold); color: var(--c-ink); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; transition: transform var(--t); border: 2px solid var(--bg);
}
.badge[data-zero] { display: none; }
.badge.bump { transform: scale(1.35); }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 0; transition: color var(--t); }
.link-btn:hover { color: var(--gold); }

/* زر الوضع الليلي */
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* ===== الشريط العلوي والترويسة ===== */
.topbar {
  display: flex; justify-content: center; gap: 4px 14px; flex-wrap: wrap;
  background: var(--deep); color: color-mix(in srgb, var(--on-deep) 80%, transparent);
  font-size: 12.5px; padding: 8px var(--gutter); text-align: center;
}
.topbar b, .topbar__sep { color: var(--gold); }
.topbar__sep { display: none; }
.header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line); transition: background-color var(--t), border-color var(--t);
}
.header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo__mark {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--gold); color: var(--gold);
}
.logo__mark .ic { width: 22px; height: 22px; }
.logo__text { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.1; display: flex; flex-direction: column; gap: 2px; }
.logo__text small { display: none; font-family: var(--font-body); font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .02em; }
.nav { display: none; gap: 2px; }
.nav a { position: relative; padding: 8px 14px; color: var(--muted); font-weight: 500; font-size: 15px; }
.nav a::after { content: ""; position: absolute; inset-inline: 14px; bottom: 2px; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform var(--t); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.header__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 44px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
/* خانة البحث: سطر كامل تحت الشعار على الجوال، وفي وسط الترويسة على الكمبيوتر */
.search--header { position: relative; order: 3; width: 100%; height: 48px; padding-inline-end: 4px; }
.search--header input { font-size: 16px; } /* ١٦px تمنع Safari من تكبير الصفحة عند الكتابة */
.search__btn { min-height: 40px; padding: 6px 18px; font-size: 14px; }
.track-btn { display: none; }
.suggest {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 35; max-height: min(70vh, 480px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 8px; box-shadow: var(--shadow);
  animation: drop var(--t);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.suggest__item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 14px;
  background: none; cursor: pointer; text-align: start; transition: background-color var(--t);
}
.suggest__item:hover, .suggest__item:focus-visible { background: var(--surface-2); }
.suggest__item .book { width: 34px; flex: none; }
.suggest__item b { display: block; font-weight: 600; line-height: 1.4; }
.suggest__item small { color: var(--muted); font-size: 12.5px; }
.suggest__icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); }
.suggest__all { width: 100%; margin-top: 4px; padding: 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--gold); font-weight: 600; cursor: pointer; }
.suggest__empty { margin: 0; padding: 14px; color: var(--muted); text-align: center; font-size: 14px; }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.header__actions { gap: 6px; }
.search > .ic { width: 18px; height: 18px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }

/* ===== الواجهة ===== */
.hero { position: relative; padding: 56px 0 0; overflow: hidden; text-align: center; }
.hero__inner { display: flex; flex-direction: column; align-items: center; }
.hero__text { display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold);
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.hero h1 { font-size: clamp(40px, 10vw, 84px); line-height: 1.25; margin: 26px 0 0; font-weight: 600; }
.hero h1 em { font-style: normal; color: var(--gold); }
.lead { font-size: 17px; color: var(--muted); max-width: 520px; margin: 22px auto 36px; line-height: 1.9; }
.hero__tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 28px; font-size: 14px; }
.hero__tags button {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 14px; cursor: pointer; font-size: 13px;
  transition: border-color var(--t), color var(--t);
}
.hero__tags button:hover { border-color: var(--gold); color: var(--gold); }
.stats { display: flex; justify-content: center; gap: 28px; margin: 44px 0 0; padding: 0; }
.stats div { min-width: 80px; }
.stats dt { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.2; color: var(--gold); }
.stats dd { margin: 0; color: var(--muted); font-size: 13px; }

/* شريط الأغلفة المتحرك */
.marquee {
  position: relative; margin-top: 56px; padding: 26px 0 64px; overflow: hidden;
  mask-image: linear-gradient(to left, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(to left, transparent, #000 10%, #000 90%, transparent);
}
.marquee::before { /* خط الرف */
  content: ""; position: absolute; inset-inline: 0; bottom: 52px; height: 1px; background: var(--line);
}
.marquee__track { display: flex; gap: 26px; width: max-content; animation: marquee 80s linear infinite; }
.marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(50%); } }
.marquee__item { flex: none; width: 116px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform var(--t); }
.marquee__item:nth-child(even) { margin-top: 18px; }
.marquee__item:hover { transform: translateY(-10px) rotate(-2deg); }

/* ===== غلاف الكتاب ===== */
.book { position: relative; display: block; }
.cover {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden; isolation: isolate;
  border-start-start-radius: 3px; border-end-start-radius: 3px; border-start-end-radius: 6px; border-end-end-radius: 6px;
  background: var(--c1); color: var(--c2);
  display: flex; flex-direction: column; justify-content: space-between; padding: 16% 13% 13%;
  box-shadow:
    -2px 2px 0 var(--c-cream), -3px 3px 0 color-mix(in srgb, var(--c-ink) 18%, var(--c-cream)),
    -12px 22px 32px -14px color-mix(in srgb, var(--c-ink) 60%, transparent);
}
.cover::before { /* ظل الكعب على اليمين */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to left, color-mix(in srgb, var(--c-ink) 40%, transparent) 0, color-mix(in srgb, var(--c-cream) 20%, transparent) 2.5%, transparent 8%),
              linear-gradient(135deg, color-mix(in srgb, var(--c-cream) 14%, transparent), transparent 40%);
}
/* درجات الأغلفة من الألوان الثلاثة */
.tone-0 { --c1: var(--c-ink); --c2: var(--c-gold); }
.tone-1 { --c1: var(--c-gold); --c2: var(--c-ink); }
.tone-2 { --c1: var(--c-cream); --c2: var(--c-ink); }
.tone-2.cover--frame::after, .tone-2.cover--band::after { border-color: var(--c-gold); }
.cover__title { position: relative; font-family: var(--font-display); font-weight: 600; font-size: clamp(13px, 1.4vw, 19px); line-height: 1.45; }
.cover__orn { width: 28px; height: 1.5px; background: currentColor; margin: 10px 0; opacity: .8; }
.cover__author { position: relative; font-size: 11px; opacity: .85; }
.cover--frame::after { content: ""; position: absolute; inset: 7%; border: 1px solid currentColor; opacity: .5; border-radius: 2px; }
.cover--band { justify-content: center; text-align: center; align-items: center; }
.cover--band::after {
  content: ""; position: absolute; inset-inline: 0; top: 30%; height: 40%; z-index: -1;
  border-block: 1px solid color-mix(in srgb, var(--c2) 60%, transparent); background: color-mix(in srgb, var(--c2) 10%, transparent);
}
.cover--band .cover__orn { margin-inline: auto; }
.cover--band .cover__author { position: absolute; bottom: 10%; }
.cover--sun::after {
  content: ""; position: absolute; width: 85%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  inset-inline-end: -25%; bottom: -18%; border: 1px solid currentColor; opacity: .35;
  box-shadow: 0 0 0 12px color-mix(in srgb, currentColor 10%, transparent);
}
.cover--mini { padding: 0; box-shadow: -2px 2px 0 var(--c-cream), 0 6px 12px -4px color-mix(in srgb, var(--c-ink) 40%, transparent); }
.cover--mini > * { display: none; }
.cover--image { padding: 0; background: var(--surface-2); }
.cover--image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cover--image.cover--mini img { display: block; }

/* ===== الأقسام العامة ===== */
.section { padding: 72px 0; }
.section--last { padding-bottom: 96px; }
.section--tight { padding: 32px 0 8px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(28px, 6vw, 44px); }
.section__note { margin: 0; font-size: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 500; font-size: 13px; letter-spacing: .04em; margin: 0 0 8px; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.eyebrow--light { color: var(--gold); }

/* ظهور تدريجي عند التمرير */
.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ===== رف الأقسام ===== */
.bookshelf {
  position: relative; padding: 28px 16px 0; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(to bottom, var(--surface), var(--surface-2));
}
.bookshelf__row { display: flex; align-items: flex-end; justify-content: flex-start; gap: 6px; min-height: 240px; overflow-x: auto; scrollbar-width: none; padding-top: 24px; }
.bookshelf__row::-webkit-scrollbar { display: none; }
.bookshelf__plank {
  height: 14px; margin-inline: -16px; border-radius: 3px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--c-gold) 80%, var(--c-cream)), var(--c-gold) 40%, color-mix(in srgb, var(--c-gold) 70%, var(--c-ink)));
  box-shadow: 0 18px 24px -12px color-mix(in srgb, var(--c-ink) 45%, transparent);
}
.spine {
  position: relative; flex: none; width: 58px; height: var(--h, 240px); border: 0; cursor: pointer;
  border-radius: 3px 3px 1px 1px; color: var(--c2); background: var(--c1);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 0 14px;
  box-shadow: inset 4px 0 6px -3px color-mix(in srgb, var(--c-cream) 30%, transparent), inset -6px 0 8px -3px color-mix(in srgb, var(--c-ink) 40%, transparent);
  transition: transform var(--t), box-shadow var(--t);
}
.spine::before, .spine::after { content: ""; position: absolute; inset-inline: 10px; height: 6px; border-block: 1px solid currentColor; opacity: .7; }
.spine::before { top: 8px; }
.spine::after { bottom: 34px; }
.spine__name { writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 600; font-size: 18px; margin-top: 6px; }
.spine__count { font-size: 11px; font-weight: 600; opacity: .8; }
.spine:hover, .spine[aria-selected="true"] { transform: translateY(-18px); box-shadow: inset 4px 0 6px -3px color-mix(in srgb, var(--c-cream) 30%, transparent), 0 14px 22px -10px color-mix(in srgb, var(--c-ink) 55%, transparent); }
.spine--lean { transform: rotate(7deg); transform-origin: bottom left; margin-inline-start: 30px; }
.spine--lean:hover, .spine--lean[aria-selected="true"] { transform: rotate(7deg) translateY(-12px); }
.shelf-deco { display: none; }

/* ===== الأكثر مبيعًا ===== */
.arrows { display: none; gap: 8px; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 24px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rank {
  scroll-snap-align: start; display: grid; grid-template-columns: auto 88px 1fr; align-items: center; gap: 16px;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.rank__num { font-family: var(--font-display); font-size: 52px; font-weight: 600; line-height: 1; width: 40px; text-align: center; color: transparent; -webkit-text-stroke: 1px var(--gold); }
.rank .book { cursor: pointer; }
.rank__title { font-family: var(--font-display); font-weight: 600; line-height: 1.45; cursor: pointer; }
.rank__author { font-size: 13px; color: var(--muted); }
.rank .price { font-size: 17px; margin: 6px 0 10px; }

/* ===== كتاب الشهر ===== */
.featured { position: relative; overflow: hidden; color: var(--on-deep); background: var(--deep); padding: 80px 0; text-align: center; }
.featured__inner { position: relative; display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.featured__art { position: relative; display: grid; place-items: center; padding: 20px 0; }
.featured__art::before { content: ""; position: absolute; width: 260px; aspect-ratio: 1; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.featured__art .book { width: 190px; transform: rotate(-3deg); transition: transform var(--t); cursor: pointer; }
.featured__art .book:hover { transform: rotate(0) translateY(-6px); }
.featured h2 { font-size: clamp(34px, 7vw, 56px); }
.featured__author { color: var(--gold); font-weight: 500; font-size: 17px; margin: 6px 0 18px; }
.featured__desc { color: color-mix(in srgb, var(--on-deep) 78%, transparent); font-size: 17px; max-width: 600px; margin-inline: auto; }
.featured__quote {
  margin: 26px auto; max-width: 600px; padding: 18px 22px; text-align: start; border-inline-start: 2px solid var(--gold);
  font-family: var(--font-display); font-size: 20px; line-height: 1.8;
}
.featured__meta { display: flex; justify-content: center; gap: 32px; margin-bottom: 30px; flex-wrap: wrap; }
.featured__meta b { display: block; font-size: 20px; color: var(--gold); }
.featured__meta small { color: color-mix(in srgb, var(--on-deep) 65%, transparent); }
.featured__buy { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.featured .price { font-size: 28px; color: var(--on-deep); margin-inline-end: 8px; }
.featured .price del { color: color-mix(in srgb, var(--on-deep) 50%, transparent); }
.featured .eyebrow { justify-content: center; }
.featured .btn--gold:hover { background: var(--on-deep); color: var(--c-ink); }
.featured .person-link:hover { color: var(--on-deep); }

/* ===== شبكة الكتب ===== */
.toolbar { display: flex; align-items: center; gap: 12px; }
.toolbar select, .filters-bar select, .filter-price input {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color var(--t);
}
.toolbar select:hover, .filters-bar select:hover { border-color: var(--gold); }
.chips { display: flex; gap: 8px; margin-bottom: 28px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  cursor: pointer; font-weight: 500; font-size: 14px; transition: background-color var(--t), color var(--t), border-color var(--t);
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip[aria-selected="true"] { background: var(--btn); color: var(--on-btn); border-color: transparent; }
.chip small { opacity: .6; margin-inline-start: 6px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 14px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid transparent;
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.card__media { position: relative; cursor: pointer; padding: 20px 18px 18px; border-radius: 14px; background: var(--surface-2); }
.card__media .book { z-index: 1; transition: transform var(--t); }
.ribbon {
  position: absolute; top: 0; inset-inline-start: 12px; z-index: 3; width: 30px; padding: 7px 0 13px;
  background: var(--gold); color: var(--c-ink); font-size: 10px; font-weight: 700; text-align: center; line-height: 1.25;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}
.card__wish {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--bg); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: opacity var(--t), transform var(--t), color var(--t);
}
.card__wish .ic { width: 17px; height: 17px; }
.card__wish:hover { color: var(--gold); }
.card__wish[aria-pressed="true"] .ic { fill: var(--gold); stroke: var(--gold); }
.card__cat { font-size: 11.5px; font-weight: 500; color: var(--gold); letter-spacing: .02em; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.5; cursor: pointer; transition: color var(--t); }
.card__title:hover { color: var(--gold); }
.card__author { color: var(--muted); font-size: 13px; }
.rating { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.rating > span:not(.stars-ic) { color: var(--muted); letter-spacing: 0; margin-inline-start: 4px; }
.stars-ic { display: inline-flex; gap: 1px; vertical-align: -.1em; }
.ic.is-empty { color: var(--line); fill: var(--line); stroke: none; } /* نجمة غير ممتلئة في التقييم */
.card__foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.price { font-weight: 700; font-size: 17px; }
.price del { color: var(--muted); font-weight: 400; font-size: 12px; margin-inline-start: 6px; }
.add-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0;
  background: var(--btn); color: var(--on-btn); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px;
  transition: background-color var(--t), color var(--t);
}
.add-btn:hover { background: var(--gold); color: var(--c-ink); }
.add-btn.added { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* البطاقة ترتفع وتميل عند المرور (الأجهزة ذات المؤشر فقط) */
@media (hover: hover) {
  .card:hover { transform: translateY(-8px) rotate(-.8deg); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
  .card:hover .card__media .book { transform: translateY(-4px); }
  .card__wish { opacity: 0; transform: scale(.85); }
  .card:hover .card__wish, .card__wish[aria-pressed="true"], .card__wish:focus-visible { opacity: 1; transform: none; }
  .rank:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
}

/* ===== الاقتباس ===== */
.quote { padding: 88px 0; text-align: center; position: relative; }
.ornament { display: flex; justify-content: center; color: var(--gold); }
.ornament .ic { width: 26px; height: 26px; stroke-width: 1.5; }
.featured > .ornament { position: absolute; top: 26px; inset-inline: 0; }
.quote__mark { display: block; color: var(--gold); opacity: .35; margin: 18px 0 -6px; }
.quote blockquote { margin: 0; }
.quote p { font-family: var(--font-display); font-size: clamp(26px, 6vw, 44px); line-height: 1.8; margin: 18px 0; }
.quote cite { font-style: normal; color: var(--gold); font-size: 15px; letter-spacing: .03em; }

/* ===== المزايا ===== */
.features { display: grid; grid-template-columns: 1fr; gap: 14px; }
.feature { display: flex; gap: 16px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); transition: border-color var(--t), transform var(--t); }
.feature:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.feature__icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--gold); font-size: 19px; color: var(--gold); }
.feature h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ===== النشرة ===== */
.newsletter {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr; align-items: center; gap: 28px;
  padding: 40px 22px; border-radius: 28px; color: var(--on-deep); background: var(--deep); text-align: center;
}
.newsletter__books { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.newsletter__books .spine { width: 44px; cursor: default; }
.newsletter__books .spine:hover { transform: none; }
.newsletter__books .spine__name { font-size: 14px; }
.newsletter h2 { font-size: clamp(28px, 6vw, 42px); }
.newsletter p { color: color-mix(in srgb, var(--on-deep) 75%, transparent); margin: 12px 0 24px; }
.newsletter .eyebrow { justify-content: center; }
.newsletter__form { display: flex; gap: 8px; max-width: 480px; margin-inline: auto; padding: 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--on-deep) 22%, transparent); }
.newsletter__form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 14px; color: var(--on-deep); }
.newsletter__form input::placeholder { color: color-mix(in srgb, var(--on-deep) 55%, transparent); }
.newsletter__form .btn { padding-inline: 18px; }

/* ===== التذييل ===== */
.footer { background: var(--deep); color: color-mix(in srgb, var(--on-deep) 75%, transparent); padding: 64px 0 28px; }
.footer__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 24px; }
.footer__brand { grid-column: 1 / -1; }
.footer .logo__text { color: var(--on-deep); }
.footer .logo__text small { color: color-mix(in srgb, var(--on-deep) 55%, transparent); }
.footer__brand p { max-width: 320px; }
.footer h4 { margin: 0 0 14px; color: var(--gold); font-size: 16px; }
.footer__inner a:not(.logo) { display: block; padding: 4px 0; transition: color var(--t); }
.footer__inner a:not(.logo):hover { color: var(--gold); }
.footer__copy { margin-top: 48px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--on-deep) 12%, transparent); font-size: 13px; }
#legal a { text-decoration: underline; }

/* ===== زر الطلب عبر واتساب (ثابت أسفل الشاشة) ===== */
.wa-order {
  position: fixed; z-index: 45; bottom: max(14px, env(safe-area-inset-bottom)); inset-inline: var(--gutter);
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px;
  border-radius: 999px; background: var(--gold); color: var(--c-ink); font-weight: 600; font-size: 15.5px;
  box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--c-ink) 65%, transparent), 0 0 0 1px color-mix(in srgb, var(--c-ink) 8%, transparent);
  transition: transform var(--t), background-color var(--t), box-shadow var(--t);
}
.wa-order:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--c-gold) 88%, var(--c-cream)); }
.wa-order__count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--c-ink); color: var(--c-cream); font-size: 12px; display: grid; place-items: center; }
.wa-order__count[data-zero] { display: none; }
body.locked .wa-order { opacity: 0; pointer-events: none; }
.drawer__wa { margin-top: 8px; }

/* ===== السلة ===== */
.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--c-ink) 55%, transparent); backdrop-filter: blur(3px); z-index: 40; animation: fade var(--t); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100%); z-index: 50;
  background: var(--bg); display: flex; flex-direction: column; visibility: hidden;
  transform: translateX(-100%); transition: transform 350ms cubic-bezier(.2,.7,.2,1), visibility 350ms;
}
.drawer.open { transform: none; visibility: visible; box-shadow: 20px 0 60px color-mix(in srgb, var(--c-ink) 30%, transparent); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 22px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.drawer__foot { padding: 18px 22px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.drawer__empty { text-align: center; padding: 70px 0; color: var(--muted); }
.drawer__empty .btn { margin-top: 16px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line__title { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.45; }
.line__meta { color: var(--muted); font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; margin-top: 8px; }
.qty button { width: 34px; height: 32px; border: 0; background: transparent; cursor: pointer; font-size: 16px; transition: color var(--t); }
.qty button:hover { color: var(--gold); }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.line__side { text-align: end; }
.sum { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--muted); }
.sum--total { color: var(--ink); font-weight: 700; font-size: 19px; margin: 12px 0 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sum--discount { color: var(--gold); }
.sum .link-btn { margin-inline-start: 6px; }
.hint { font-size: 13px; background: var(--gold-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--gold); transition: width var(--t); }
.coupon { display: flex; gap: 8px; margin-bottom: 12px; }
.coupon input { flex: 1; min-width: 0; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase; outline: 0; transition: border-color var(--t); }
.coupon input:focus { border-color: var(--gold); }
.coupon .btn { min-height: 44px; padding: 8px 18px; }

/* ===== النافذة ===== */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding: 0;
  background: color-mix(in srgb, var(--c-ink) 60%, transparent); backdrop-filter: blur(4px); animation: fade var(--t);
}
.modal__card {
  position: relative; background: var(--bg); width: 100%; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  padding: 30px 18px max(28px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
  animation: sheet 350ms cubic-bezier(.2,.7,.2,1);
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.modal__close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; background: var(--bg); }
.detail { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.detail__art { padding: 28px; border-radius: var(--radius); background: var(--surface-2); max-width: 240px; width: 100%; margin-inline: auto; }
.detail h2 { font-size: clamp(28px, 6vw, 40px); margin-bottom: 4px; }
.detail__author { color: var(--gold); font-weight: 500; font-size: 16px; }
.detail__desc { color: var(--muted); font-size: 16px; line-height: 1.9; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 26px; }
.specs div { border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.specs b { display: block; }
.specs small { color: var(--muted); }
.detail__buy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail__buy .price { font-size: 26px; margin-inline-end: 8px; }
.low-stock { color: var(--gold); font-weight: 600; font-size: 14px; }
.sample { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; }
.sample summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.sample div { padding: 4px 18px 18px; font-family: var(--font-body); font-size: 17px; line-height: 2.1; white-space: pre-line; max-height: 340px; overflow-y: auto; }
.notify { width: 100%; background: var(--gold-soft); border-radius: 16px; padding: 16px; }
.notify p { margin: 0 0 10px; font-size: 14px; }
.notify div { display: flex; gap: 8px; flex-wrap: wrap; }
.notify input { flex: 1; min-width: 180px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); outline: 0; }
.related, .reviews { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.related h3, .reviews h3 { margin: 0 0 16px; font-size: 21px; }
.related__row { display: grid; grid-auto-flow: column; grid-auto-columns: 118px; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.related__item { cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-size: 13px; transition: transform var(--t); }
.related__item:hover { transform: translateY(-4px); }
.related__item .book { margin-bottom: 6px; }
.related__item small { color: var(--muted); }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review p { margin: 6px 0 0; color: var(--muted); white-space: pre-line; }
.review-form-wrap { margin-top: 16px; }
.review-form-wrap > summary { list-style: none; display: inline-flex; }
.review-form-wrap > summary::-webkit-details-marker { display: none; }
.review-form { margin-top: 16px; display: grid; gap: 14px; justify-items: start; }
.review-form .form-grid { width: 100%; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; } /* النجمة الأولى يمينًا كما يُقرأ بالعربية */
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { color: var(--line); cursor: pointer; transition: color var(--t); padding: 2px; }
.star-input .ic { width: 28px; height: 28px; stroke: none; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--gold); }
.star-input input:focus-visible + label { outline: 2px solid var(--gold); border-radius: 4px; }

/* النماذج */
.checkout h2, .track h2, .info-page h2 { font-size: clamp(26px, 6vw, 34px); margin-bottom: 8px; }
.checkout h2 { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field--full { grid-column: 1 / -1; }
.field input, .field textarea, .field select {
  padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); outline: 0; transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.pay { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pay label { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color var(--t), background-color var(--t); }
.pay label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.pay input { accent-color: var(--c-gold); }
.pay--soon { opacity: .5; cursor: not-allowed !important; }
.terms-note { font-size: 13px; text-align: center; margin: 12px 0 0; }
.ship-note { font-size: 12.5px; margin: -4px 0 8px; }
.form-error { color: var(--ink); font-size: 14px; background: var(--gold-soft); border-inline-start: 3px solid var(--gold); padding: 9px 14px; border-radius: 10px; }
.success { text-align: center; padding: 24px 0; }
.success__icon { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-size: 34px; }
.success__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.filter-check input, .filters-bar input[type=checkbox] { accent-color: var(--c-gold); }

/* ===== الفلاتر ===== */
.filters-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -8px 0 30px; font-size: 14px; }
.filter-price { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.filter-price input { width: 74px; cursor: text; outline: 0; }
.filter-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* ===== تتبع الطلب وصفحات المعلومات ===== */
.steps { list-style: none; padding: 0; margin: 26px 0 10px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.steps li { position: relative; padding-inline-start: 46px; min-height: 34px; font-size: 14px; color: var(--muted); }
.step-mark {
  position: absolute; top: 0; inset-inline-start: 0; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-weight: 700; background: var(--bg);
}
.steps li.done { color: var(--ink); }
.steps li.done .step-mark { background: var(--gold); border-color: var(--gold); color: var(--c-ink); }
.steps small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.track__items { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); font-size: 14px; }
.track .form-error { margin-top: 16px; }
.info-page { max-width: 680px; }
.info-page__body { white-space: pre-line; line-height: 2; font-size: 16px; }

/* ===== إشعار ===== */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translate(-50%, 30px); opacity: 0; z-index: 70; visibility: hidden;
  width: calc(100% - var(--gutter) * 2); max-width: 460px; text-align: center;
  background: var(--btn); color: var(--on-btn); padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: 14px;
  transition: transform var(--t), opacity var(--t), visibility var(--t); box-shadow: var(--shadow);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ===== صفحات المؤلفين ودور النشر ===== */
.profile-mode main > :not(#profileView) { display: none; }
.profile { padding: 28px 0 80px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--gold); }
.crumbs b { color: var(--ink); font-weight: 500; }
.profile__head {
  display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; text-align: center;
  margin: 24px 0 20px; padding: 32px 20px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line);
}
.profile__head > .avatar { width: 136px; height: 136px; font-size: 56px; margin: 0 auto; }
.profile__info h1 { font-size: clamp(32px, 7vw, 52px); margin: 0 0 6px; }
.profile__info .eyebrow { justify-content: center; }
.profile__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--muted); }
.profile__meta span + span::before { content: "•"; margin-inline-end: 18px; color: var(--gold); }
.profile__meta a { color: var(--gold); }
.profile__bio { font-size: 17px; line-height: 2; max-width: 72ch; white-space: pre-line; margin: 16px auto 0; text-align: start; }
.profile__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 36px; margin: 22px 0; }
.profile__stats div { display: flex; flex-direction: column-reverse; }
.profile__stats dt { font-weight: 700; font-size: 20px; color: var(--gold); }
.profile__stats dd { margin: 0; color: var(--muted); font-size: 13px; }
.profile__empty { text-align: center; padding: 80px 0; }
.index__title { font-size: clamp(32px, 7vw, 48px); margin: 0; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar--square { border-radius: 22%; }
.avatar--letter {
  display: grid; place-items: center; font-family: var(--font-display); font-size: 24px; font-weight: 600;
  color: var(--c-gold); background: var(--c-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-gold) 50%, transparent);
}
.profile__head .avatar--letter { box-shadow: inset 0 0 0 1px var(--c-gold), inset 0 0 0 8px var(--c-ink), inset 0 0 0 9px color-mix(in srgb, var(--c-gold) 45%, transparent); }
.people { display: flex; flex-wrap: wrap; gap: 12px; }
.people--grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
.person {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 999px; border: 1px solid var(--line);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.person:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--gold); }
.person b { display: block; line-height: 1.4; font-weight: 600; }
.person small { color: var(--muted); }
.person-link {
  color: inherit; background-image: linear-gradient(var(--gold), var(--gold)); background-size: 0 1px; background-repeat: no-repeat;
  background-position: 100% 100%; transition: background-size var(--t), color var(--t);
}
.person-link:hover { color: var(--gold); background-size: 100% 1px; }


/* ===== البانرات المتبدّلة ===== */
.banners { position: relative; padding: 16px 0 0; }
.banners__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  width: min(1200px, 100% - var(--gutter) * 2); margin-inline: auto; border-radius: 24px;
}
.banners__track::-webkit-scrollbar { display: none; }
.banner {
  position: relative; flex: 0 0 100%; scroll-snap-align: start; overflow: hidden; display: block;
  border-radius: 24px; color: var(--c-cream); background: var(--c-ink);
}
.banner--gold { background: var(--c-gold); color: var(--c-ink); }
.banner--cream { background: var(--surface-2); color: var(--ink); }
.banner::before { /* زخرفة دوائر خفيفة */
  content: ""; position: absolute; width: 520px; aspect-ratio: 1; border-radius: 50%; inset-inline-start: -160px; bottom: -260px;
  border: 1px solid currentColor; opacity: .12; box-shadow: 0 0 0 40px color-mix(in srgb, currentColor 4%, transparent), 0 0 0 80px color-mix(in srgb, currentColor 3%, transparent);
}
/* على الجوال: النص بجانب غلاف صغير، بارتفاع مضغوط */
.banner__inner { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 26px 22px; width: auto; min-height: 220px; }
.banner__text h2 { font-size: clamp(21px, 6vw, 52px); line-height: 1.35; }
.banner--dark .banner__text h2 { color: var(--c-cream); }
.banner__text p { margin: 8px 0 16px; max-width: 520px; font-size: 14px; line-height: 1.7; opacity: .85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.banner__text .btn { min-height: 40px; padding: 8px 18px; font-size: 14px; }
.banner__art { display: grid; place-items: center; }
.banner__art .book { width: 86px; transform: rotate(-4deg); transition: transform var(--t); }
.banner__art .cover__title { font-size: 11px; }
.banner__art .cover__author { font-size: 8px; }
.banner:hover .banner__art .book { transform: rotate(0) translateY(-6px); }
.banner--image { min-height: 0; background: var(--surface-2); }
.banner--image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.banners__dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 0; }
.banners__dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: var(--line); cursor: pointer; transition: width var(--t), background-color var(--t); }
.banners__dots button[aria-selected="true"] { width: 26px; background: var(--gold); }

/* ===== صفوف الكتب ===== */
.section--rail { padding: 48px 0 8px; }
.section--rail .section__head { margin-bottom: 20px; align-items: center; }
.section--rail .section__head h2 { font-size: clamp(24px, 5.5vw, 34px); }
.rail-head__side { display: flex; align-items: center; gap: 14px; }
.see-all { font-size: 14px; font-weight: 600; color: var(--gold); text-decoration: none; }
.see-all:hover { text-decoration: underline; }
.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 22px; margin-inline: -2px;
}
.row-scroll::-webkit-scrollbar { display: none; }
.row-scroll > .card { scroll-snap-align: start; animation: none; }
.more-wrap { display: flex; justify-content: center; margin-top: 36px; }
#clearPreset { display: block; margin-top: 6px; }


/* ===== القائمة الجانبية (تنفتح من اليمين) ===== */
.side-menu { position: fixed; inset: 0; z-index: 55; visibility: hidden; transition: visibility 350ms; }
.side-menu.open { visibility: visible; }
.side-menu__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--c-ink) 55%, transparent); backdrop-filter: blur(3px); opacity: 0; transition: opacity 350ms; }
.side-menu.open .side-menu__backdrop { opacity: 1; }
.side-menu__panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(380px, 88%);
  display: flex; flex-direction: column; background: var(--bg); outline: 0;
  transform: translateX(100%); transition: transform 350ms cubic-bezier(.2,.7,.2,1);
  box-shadow: -20px 0 60px color-mix(in srgb, var(--c-ink) 30%, transparent);
}
.side-menu.open .side-menu__panel { transform: none; }
.side-menu__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.side-menu__head .logo__text small { display: none; }
.side-menu__body { flex: 1; overflow-y: auto; padding: 8px 20px max(24px, env(safe-area-inset-bottom)); }
.side-menu__sec { padding: 18px 0; border-bottom: 1px solid var(--line); }
.side-menu__sec h3 { font-size: 15px; color: var(--gold); margin-bottom: 8px; font-family: var(--font-body); font-weight: 600; letter-spacing: .02em; }
.cat-list-menu, .main-menu, .main-menu ul { list-style: none; margin: 0; padding: 0; }
.cat-list-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cat-list-menu a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); font-weight: 500; font-size: 15px; transition: background-color var(--t), color var(--t); }
.cat-list-menu a:hover { color: var(--gold); background: var(--surface-2); }
.cat-list-menu small { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.cat-dot { width: 10px; height: 14px; border-radius: 2px; background: var(--c1); box-shadow: inset -2px 0 0 color-mix(in srgb, var(--c-ink) 25%, transparent); flex: none; }
.cat-dot.tone-2 { box-shadow: inset 0 0 0 1px var(--line); }
.main-menu > li > a, .main-menu summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 4px;
  font-family: var(--font-display); font-size: 19px; font-weight: 500; cursor: pointer; list-style: none; transition: color var(--t);
}
.main-menu summary::-webkit-details-marker { display: none; }
.main-menu > li > a:hover, .main-menu summary:hover { color: var(--gold); }
.main-menu .chev { width: 18px; height: 18px; transition: transform var(--t); }
.main-menu details[open] .chev { transform: rotate(180deg); }
.main-menu details[open] summary { color: var(--gold); }
.main-menu ul { padding: 0 14px 10px; border-inline-start: 1px solid var(--line); margin-inline-start: 6px; animation: drop var(--t); }
.main-menu ul a { display: block; padding: 8px 4px; color: var(--muted); font-size: 15px; transition: color var(--t); }
.main-menu ul a:hover { color: var(--gold); }
.side-menu__foot { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; }


/* ===== صفحة الكتب المستقلة (كل الكتب / قسم / قائمة / بحث / مفضلة) ===== */
body:not(.shop-mode) #books { display: none; }
.shop-mode main > :not(#books) { display: none; }
.shop-mode #books { padding-top: 24px; min-height: 70vh; }
.shop-head {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin: 18px 0 24px; padding: 28px 22px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line);
}
.shop-head h1 { font-size: clamp(32px, 8vw, 56px); line-height: 1.2; }
.shop-head__desc { margin: 10px 0 0; color: var(--muted); max-width: 60ch; }
.shop-head__art { display: none; align-items: flex-end; gap: 4px; margin-bottom: -29px; }
.shop-head__art .spine { width: 40px; cursor: default; padding: 0; }
.shop-head__art .spine:hover { transform: none; }
.shop-people { margin-bottom: 18px; }
.shop-people:empty { display: none; }
.shop-people__title { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.shop-people .people { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.shop-people .people::-webkit-scrollbar { display: none; }
.shop-people .person { flex: none; padding: 6px 14px 6px 6px; }
.shop-people .avatar { width: 38px; height: 38px; font-size: 18px; }
.shop-bar { margin-bottom: 14px; }
.shop-bar .toolbar { width: 100%; justify-content: space-between; }
a.chip { display: inline-flex; align-items: center; }

/* ===== الشاشات الأكبر ===== */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .logo__text small { display: block; }
  .track-btn { display: grid; }
  .header__actions { gap: 8px; }
  .topbar__sep { display: inline; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 22px; }
  .card__foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .form-grid, .pay { grid-template-columns: 1fr 1fr; }
  .specs { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: 1fr 1fr; }
  .people--grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .rail { grid-auto-columns: minmax(320px, 46%); }
  .row-scroll { grid-auto-columns: 30%; gap: 18px; }
  .banner__inner { padding: 40px; min-height: 320px; gap: 32px; }
  .banner__text p { font-size: 16px; margin: 14px 0 24px; }
  .banner__text .btn { min-height: 48px; padding: 12px 26px; font-size: 15px; }
  .banner__art .book { width: 150px; }
  .banner__art .cover__title { font-size: 16px; }
  .banner__art .cover__author { font-size: 11px; }
  .banner--image img { aspect-ratio: 16 / 7; }
  .marquee__item { width: 136px; }
  .steps { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .steps li { padding: 44px 0 0; text-align: center; }
  .step-mark { inset-inline: 0; margin: auto; }
  .steps li::after { content: ""; position: absolute; top: 17px; inset-inline-start: calc(50% + 22px); width: calc(100% - 36px); height: 1px; background: var(--line); }
  .steps li:last-child::after { display: none; }
  .steps li.done:has(+ li.done)::after { background: var(--gold); }
  .modal { place-items: center; padding: 24px; }
  .modal__card { width: min(900px, 100%); max-height: calc(100vh - 48px); padding: 44px; border-radius: 28px; }
  .wa-order { inset-inline: auto; inset-inline-start: 24px; bottom: 24px; }
  body { padding-bottom: 0; }
  .toast { bottom: 28px; width: auto; white-space: nowrap; }
  .newsletter { padding: 56px 40px; }
}
@media (min-width: 900px) {
  /* على الكمبيوتر: المربع داخل الترويسة، ويختفي بهدوء ما دام بحث الواجهة ظاهرًا */
  /* سطر أول: الشعار | البحث | الأيقونات — سطر ثانٍ: روابط الأقسام */
  .header__inner { flex-wrap: wrap; height: auto; padding: 14px 0 0; gap: 14px 32px; }
  .search--header { order: 0; flex: 1; width: auto; max-width: 640px; margin-inline: auto; }
  .header__actions { margin-inline-start: 0; }
  .nav { display: flex; order: 4; width: 100%; justify-content: center; gap: 6px; border-top: 1px solid var(--line); padding: 4px 0; }
  .section { padding: 112px 0; }
  .section--last { padding-bottom: 128px; }
  .section__head { margin-bottom: 48px; }
  .hero { padding-top: 96px; }
  .marquee { margin-top: 80px; }
  .marquee__item { width: 156px; }
  .stats { gap: 64px; }
  .bookshelf { padding: 40px 32px 0; }
  .bookshelf__row { justify-content: center; min-height: 290px; }
  .bookshelf__plank { margin-inline: -32px; }
  .spine { width: 70px; }
  .spine__name { font-size: 20px; }
  .shelf-deco { display: block; flex: none; align-self: flex-end; font-size: 40px; margin: 0 12px 2px; }
  .arrows { display: flex; }
  .banners { padding-top: 24px; }
  .banner__inner { padding: 56px 72px; gap: 48px; min-height: 420px; }
  .shop-head { padding: 40px 44px; margin-top: 22px; }
  .shop-head__art { display: flex; }
  .shop-bar .toolbar { width: auto; }
  .banner__art .book { width: 210px; }
  .banner__art .cover__title { font-size: 20px; }
  .banner--image img { aspect-ratio: 1200 / 440; }
  .section--rail { padding: 72px 0 8px; }
  .section--rail .section__head { margin-bottom: 28px; }
  .row-scroll { grid-auto-columns: calc((100% - 4 * 24px) / 5); gap: 24px; }
  .rail { grid-auto-columns: minmax(320px, 1fr); gap: 22px; }
  .featured { padding: 120px 0; text-align: start; }
  .featured__inner { grid-template-columns: 360px 1fr; gap: 80px; }
  .featured__art::before { width: 320px; }
  .featured__art .book { width: 240px; }
  .featured__desc, .featured__quote { margin-inline: 0; }
  .featured__meta, .featured__buy, .featured .eyebrow { justify-content: flex-start; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 28px; }
  .card { padding: 14px 14px 16px; }
  .card__media { padding: 30px 32px 26px; }
  .card__title { font-size: 18px; }
  .features { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .quote { padding: 140px 0; }
  .newsletter { grid-template-columns: 1fr 1.3fr; gap: 48px; padding: 72px 64px; text-align: start; }
  .newsletter .eyebrow { justify-content: flex-start; }
  .newsletter__form { margin-inline: 0; }
  .footer { padding: 88px 0 32px; }
  .footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
  .footer__brand { grid-column: auto; }
  .detail { grid-template-columns: 280px 1fr; gap: 48px; }
  .profile__head { grid-template-columns: 200px 1fr; gap: 44px; text-align: start; padding: 44px; }
  .profile__head > .avatar { width: 200px; height: 200px; font-size: 80px; margin: 0; }
  .profile__info .eyebrow, .profile__meta, .profile__stats { justify-content: flex-start; }
  .profile__bio { margin-inline: 0; }
}


/* ===== تقليل الحركة ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .marquee__track { animation: none; }
  .marquee { overflow-x: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; }
  .card:hover, .rank:hover { transform: none; }
}

/* أيقونات متفرقة */
.feature__icon .ic { width: 22px; height: 22px; }
.shelf-deco .ic { width: 40px; height: 40px; color: var(--gold); stroke-width: 1.25; }
.empty-ic { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface-2); color: var(--gold); }
.empty-ic .ic { width: 32px; height: 32px; stroke-width: 1.5; }
.success__icon .ic { width: 36px; height: 36px; }
.wa-order > .ic { width: 22px; height: 22px; }
.suggest__icon .ic { width: 16px; height: 16px; }
.btn .ic, .add-btn .ic, .link-btn .ic { flex: none; }
.see-all { display: inline-flex; align-items: center; gap: 4px; }
.toast .ic { color: var(--gold); margin-inline-end: 4px; }
.topbar .ic { color: var(--gold); }
.sample summary .ic, .side-menu__foot .ic { color: var(--gold); }

/* ===== التصميم الجديد: واجهة المربعات، الأغلفة ثلاثية الأبعاد، شريط الجوال ===== */
/* كتاب مائل بعمق (يعتدل عند المرور) */
.book3d { transform: perspective(1100px) rotateY(16deg) rotateX(2deg); transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.book3d .cover { box-shadow: -1px 0 0 #ece4d6, -2px 1px 0 #d9cfbd, -3px 1px 0 #ebe3d4, -4px 2px 0 #d6ccb9, -5px 2px 0 #e6ddcd, -6px 3px 0 #cfc4b0, -18px 26px 40px -12px rgb(0 0 0 / .5); }
.book3d:hover, .tile:hover .book3d { transform: perspective(1100px) rotateY(4deg) translateY(-4px); }
.featured__art .book, .banner__art .book { transform: perspective(1100px) rotateY(14deg); transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.featured__art:hover .book, .banner:hover .banner__art .book { transform: perspective(1100px) rotateY(3deg) translateY(-4px); }

.bento-wrap { padding: 18px 0 0; }
.bento { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.tile { position: relative; min-width: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: 18px; overflow: hidden; color: inherit; text-decoration: none; transition: border-color var(--t), transform var(--t); }
.tile:hover { border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.tile h3 { font-family: var(--font-display); font-size: 18px; line-height: 1.4; margin: 0; text-wrap: balance; }
.tile .eyebrow { font-size: 12px; margin-bottom: 4px; }
.tile__sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tile--new { cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.tile__row { display: flex; align-items: flex-end; gap: 14px; }
.tile--new .book3d { width: 78px; flex: none; }
.tile--sale { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); display: flex; flex-direction: column; justify-content: flex-end; }
.tile__pct { font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 9vw, 72px); line-height: 1.05; color: var(--gold); margin: 6px 0; font-variant-numeric: tabular-nums; }
.tile--perks { grid-column: 1 / -1; padding: 16px 16px 12px; display: grid; gap: 12px; }
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.perk { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.perk > .ic { width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); flex: none; }
.perk b { display: block; font-size: 13.5px; line-height: 1.5; }
.perk span { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; }
.govs { overflow: hidden; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 12.5px; color: var(--muted); mask-image: linear-gradient(to left, transparent, #000 8%, #000 92%, transparent); }
.govs__track { display: flex; gap: 20px; width: max-content; animation: govs 55s linear infinite; white-space: nowrap; }
.govs__track span::before { content: "•"; color: var(--gold); margin-inline-end: 8px; }
.govs:hover .govs__track { animation-play-state: paused; }
@keyframes govs { to { transform: translateX(50%); } }
.bento[data-n="2"] .tile--new, .bento[data-n="2"] .tile--sale { grid-column: 1 / -1; }

/* تنبيه الكمية القليلة على البطاقة */
.low-stock { position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 3; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--btn); color: var(--on-btn); }
.low-stock--inline { position: static; display: inline-block; margin-top: 6px; }

/* البطاقة: الغلاف يميل بعمق عند المرور */
@media (hover: hover) {
  .card:hover .card__media .book { transform: perspective(900px) rotateY(12deg) translateY(-4px); }
}

/* شريط التنقّل السفلي (الجوال فقط) */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 44; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px 6px max(4px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid var(--line);
}
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; border: 0; background: none; color: var(--muted); font: 500 13px/1.3 var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar .ic { width: 24px; height: 24px; }
.tabbar button[aria-current] { color: var(--ink); font-weight: 600; }
.tabbar button[aria-current] .ic { color: var(--gold); }
.tabbar .badge { top: 0; inset-inline-end: calc(50% - 28px); inset-inline-start: auto; }
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
/* زر واتساب على الجوال: دائري صغير فوق الشريط بدل شريط كامل */
@media (max-width: 599px) {
  .wa-order { inset-inline: auto 16px; bottom: calc(82px + env(safe-area-inset-bottom)); width: 56px; min-height: 56px; padding: 0; }
  .wa-order #waLabel { display: none; }
  .wa-order__count { position: absolute; top: -4px; inset-inline-end: -4px; }
  .header__actions #wishBtn { display: none; } /* المفضلة في الشريط السفلي */
}
@media (min-width: 600px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  .toast { bottom: 28px; }
  .bento { grid-template-columns: 1fr 1fr 2fr; gap: 16px; }
  .tile--perks { grid-column: auto; }
  .bento[data-n="2"] { grid-template-columns: 1fr 2fr; }
  .bento[data-n="2"] .tile--new, .bento[data-n="2"] .tile--sale { grid-column: auto; }
  .tile { padding: 22px; }
  .tile h3 { font-size: 20px; }
  .tile--new .book3d { width: 96px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile--perks { grid-column: 1 / -1; }
  .perks { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .govs__track { animation: none; }
  .govs { overflow-x: auto; }
  .book3d, .book3d:hover { transform: none; }
}
.tile__link { margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 600; font-size: 13.5px; }
.tile .price { white-space: nowrap; }
.tile__row { flex-wrap: wrap; }
@media (max-width: 599px) { .tile--new .book3d { width: 70px; } .tile .price { font-size: 15px; } .tile__pct { font-size: 52px; } }

/* ===== الشعار: «حِبر» بخط ريم كوفي في وسط الترويسة =====
   الخط مقتطع لحروف الاسم فقط (٢٫٤ كيلوبايت، رخصة OFL — fonts/free/OFL-ReemKufi.txt)؛
   أي اسم آخر يُكتب بخط العرض الافتراضي تلقائيًا */
@font-face { font-family: "Hibr Logo"; src: url("fonts/free/reemkufi-hibr-700.woff") format("woff"); font-weight: 700; font-style: normal; font-display: block; unicode-range: U+628, U+62D, U+631, U+650; }
.logo { text-decoration: none; color: var(--ink); }
.logo__text { align-items: center; text-align: center; gap: 0; }
.logo__word { font-family: "Hibr Logo", var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.35; letter-spacing: .01em; }
.logo__text small { margin-top: 1px; }
.footer .logo__word { color: var(--on-deep); font-size: 40px; }
.side-menu__head .logo__word { font-size: 28px; }

/* الجوال والتابلت: القائمة يمينًا، الشعار في المنتصف تمامًا، الأيقونات يسارًا، والبحث في سطر كامل */
@media (max-width: 899px) {
  .header__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "menu logo actions" "search search search"; column-gap: 8px; }
  .menu-btn { grid-area: menu; justify-self: start; }
  .header .logo { grid-area: logo; }
  .header__actions { grid-area: actions; justify-self: end; margin-inline-start: 0; }
  .search--header { grid-area: search; }
}
/* الكمبيوتر: القائمة والبحث يمينًا، الشعار في منتصف الترويسة، الأيقونات يسارًا */
@media (min-width: 900px) {
  .header__inner { position: relative; }
  .search--header { flex: 0 1 380px; max-width: min(380px, calc(50% - 150px)); margin-inline: 0; }
  .header .logo { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); height: 68px; display: flex; align-items: center; }
  .header__actions { margin-inline-start: auto; }
  .logo__word { font-size: 34px; }
}
.footer .logo__text, .side-menu__head .logo__text { align-items: flex-start; text-align: start; }

/* ===== الكتب المستعملة ===== */
.used-pill {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: var(--shadow-sm);
}
.used-pill .ic { color: var(--gold); width: 13px; height: 13px; }
.used-pill { white-space: nowrap; }
.card__cond { color: var(--ink); font-weight: 600; }
.cond-meter { display: inline-flex; gap: 3px; flex: none; }
.cond-meter i { width: 12px; height: 6px; border-radius: 3px; background: var(--line); }
.cond-meter i.on { background: var(--gold); }
.cond-box { margin: 18px 0 4px; padding: 16px 18px; border-radius: 16px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.cond-box__head { display: flex; align-items: center; gap: 12px; }
.cond-box__head > .ic { width: 26px; height: 26px; color: var(--gold); flex: none; }
.cond-box__head > div { flex: 1; }
.cond-box__head small { display: block; color: var(--muted); font-size: 12px; }
.cond-box__head b { font-size: 18px; }
.cond-box p { margin: 10px 0 0; font-size: 14px; line-height: 1.8; }
.cond-box__note { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.cond-box > small { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.twin {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: start;
  transition: background var(--t);
}
.twin:hover { background: var(--gold-soft); }
.twin .ic:first-child { color: var(--gold); }
.twin .ic:last-child { margin-inline-start: auto; }
.save-note { color: var(--gold); font-weight: 600; font-size: 14px; }
.gallery { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.gallery__thumb { width: 52px; height: 70px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--surface-2); position: relative; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb .book, .gallery__thumb .cover { width: 100%; height: 100%; }
.gallery__thumb.is-on { border-color: var(--gold); }
.gallery__hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
.cover--photo img { object-fit: contain; }
.line__used { color: var(--gold); font-weight: 600; }
.menu-used { display: flex !important; align-items: center; justify-content: flex-start !important; gap: 8px; color: var(--gold) !important; font-weight: 700; }
.menu-used small { margin-inline-start: auto; color: var(--muted); font-weight: 400; }
.used-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.used-guide { flex: 1 1 320px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.used-guide summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.used-guide summary::-webkit-details-marker { display: none; }
.used-guide summary > .ic:first-child { color: var(--gold); }
.used-guide summary .chev { margin-inline-start: auto; width: 18px; height: 18px; transition: transform var(--t); }
.used-guide[open] summary .chev { transform: rotate(180deg); }
.used-guide ul { list-style: none; margin: 0; padding: 4px 16px 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.used-guide li { display: flex; gap: 10px; align-items: flex-start; }
.used-guide li .cond-meter { margin-top: 8px; }
.used-guide li b { display: block; font-size: 15px; }
.used-guide li small { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.used-guide__note { margin: 12px 16px 14px; color: var(--muted); font-size: 13px; }
.used-bar__sell { flex: none; }

/* أقسام الرئيسية المخفية من لوحة التحكم ← الصفحة الرئيسية */
.home-off { display: none !important; }

/* حسابات التواصل الاجتماعي */
.ic--brand { fill: currentColor; stroke: none; }
.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.social a.social__link { width: 40px; height: 40px; padding: 0; margin: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); color: inherit; transition: background var(--t), color var(--t), border-color var(--t); }
.social__link .ic { width: 18px; height: 18px; vertical-align: 0; } /* «.footer a» يجعل الروابط block، فنعيدها شبكة تُوسّط الأيقونة */
.social a.social__link:hover { background: var(--gold); border-color: var(--gold); color: var(--c-cream); }
.social--menu { justify-content: center; margin: 0 0 12px; color: var(--ink); }
.rating--none { color: var(--muted); font-size: 12.5px; }
