/* ==========================================================================
   قالب «نَبْض» — منصّة ناشر
   طابع حيويّ جريء مأخوذ عن متاجر اللياقة: أقسام فاتحة تتخلّلها أقسام فحميّة
   بحوافّ مائلة، وبرتقاليّ محمرّ للأزرار، وليمونيّ للإبراز على الداكن،
   وعناوين بأثقل وزن.
   ألوان الهويّة الخمسة وحدها يغيّرها الناشر؛ وما سواها محايد.
   ========================================================================== */

:root {
  /* ألوان الهويّة (قيم تجريبيّة) */
  --store-primary: #d23c12;
  --store-primary-dark: #a92e0b;
  --store-accent: #c6f432;
  --store-bg: #ffffff;
  --store-text: #16181d;

  /* ألوان أنواع الكتب (ثابتة في كلّ القوالب) */
  --type-paper: #db7056;
  --type-ebook: #5675a3;
  --type-audio: #986ab0;
  --type-edu: #3f8f6b;

  /* ألوان محايدة */
  --gold: #f5a623;
  --surface: #f4f4f2;
  --surface-2: #e9e9e5;
  --line: #e2e2dd;
  --muted: #5b6170;
  --muted-2: #616776;
  --danger: #c0262d;
  --success: #1e7d4f;
  --ink-dark: #16181d;
  --charcoal: #16181d;
  --charcoal-2: #20232a;
  --on-dark: #f2f3f5;
  --on-dark-muted: #a9adb8;
  --footer-bg: #101216;
  --footer-text: #b4b8c2;

  /* المقاييس */
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1320px;
  --gutter: 16px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, .06);
  --shadow: 0 10px 26px rgba(22, 24, 29, .1);
  --shadow-lg: 0 20px 48px rgba(22, 24, 29, .2);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --cut: 36px;
}

/* الزوايا الحادّة (خيار الناشر) */
body[data-corners="sharp"] {
  --radius: 2px;
  --radius-sm: 2px;
  --radius-pill: 2px;
}

/* ---------- أساسيّات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 180px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--store-text);
  background: var(--store-bg);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i-fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid var(--store-primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: 28px; }
.section--surface { background: var(--surface); }
.stack > * + * { margin-top: 12px; }

/* ==========================================================================
   الأزرار
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: 15px; line-height: 1;
  border: 2px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--store-primary); color: #fff; }
.btn--primary:hover { background: var(--store-primary-dark); }
.btn--accent { background: var(--store-accent); color: var(--ink-dark); }
.btn--accent:hover { filter: brightness(.95); }
.btn--outline { border-color: var(--store-primary); color: var(--store-primary); background: transparent; }
.btn--outline:hover { background: var(--store-primary); color: #fff; }
.btn--light { background: #fff; color: var(--ink-dark); border-color: var(--line); }
.btn--light:hover { border-color: var(--ink-dark); }
.btn--dark { background: var(--ink-dark); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 30px; font-size: 16px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--surface-2); color: var(--muted-2); border-color: transparent; cursor: not-allowed; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--store-primary); font-size: 14px;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(-4px); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: var(--store-text);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--store-primary); color: #fff; border-color: var(--store-primary); }
.icon-btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   الشريط العلويّ
   ========================================================================== */
.topbar { background: var(--ink-dark); color: #d9dde5; font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar__promo { display: flex; align-items: center; gap: 8px; }
.topbar__promo strong { color: var(--store-accent); font-weight: 800; }
.topbar__links { display: flex; align-items: center; gap: 18px; }
.topbar__links a { display: inline-flex; align-items: center; gap: 6px; }
.topbar__links a:hover { color: #fff; }
.topbar__links svg { width: 15px; height: 15px; }

/* ==========================================================================
   الرأس
   ========================================================================== */
.header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header__main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand__name { font-size: 22px; font-weight: 800; color: var(--ink-dark); line-height: 1.1; }
.brand__tag { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }

.search { position: relative; }
.search__box {
  display: flex; align-items: stretch;
  border: 2px solid var(--store-primary); border-radius: var(--radius-pill);
  background: #fff; overflow: hidden; height: 50px;
}
.search__cat {
  display: inline-flex; align-items: center; gap: 6px; padding-inline: 18px 14px;
  border-inline-end: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--store-text);
  background: var(--surface); white-space: nowrap;
}
.search__cat svg { width: 14px; height: 14px; }
.search__input { flex: 1; min-width: 0; border: 0; padding-inline: 16px; background: transparent; font-size: 15px; }
.search__input:focus { outline: none; }
.search__input::placeholder { color: var(--muted-2); }
.search__btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--store-primary); color: #fff; padding-inline: 22px; font-weight: 700;
}
.search__btn:hover { background: var(--store-primary-dark); }
.search__btn svg { width: 18px; height: 18px; }
.search__hints { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: 13px; color: var(--muted); padding-inline: 18px; }
.search__hints span { color: var(--muted-2); }
.search__hints a:hover { color: var(--store-primary); }

.header__actions { display: flex; align-items: center; gap: 22px; }
.hact { display: inline-flex; align-items: center; gap: 10px; color: var(--store-text); }
.hact__icon { position: relative; display: inline-grid; place-items: center; }
.hact__icon svg { width: 26px; height: 26px; }
.hact__badge {
  position: absolute; top: -6px; inset-inline-start: -8px;
  min-width: 19px; height: 19px; padding-inline: 5px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--store-accent); color: var(--ink-dark); font-size: 11px; font-weight: 800; line-height: 1;
  border: 2px solid #fff;
}
.hact__text { display: flex; flex-direction: column; line-height: 1.25; font-size: 12px; color: var(--muted); }
.hact__text strong { font-size: 14px; color: var(--store-text); font-weight: 700; }
.hact:hover .hact__icon { color: var(--store-primary); }
.burger { display: none; }
.mobile-search { display: none; }

/* شريط التنقّل */
.navbar { background: var(--store-primary); color: #fff; }
.navbar .container { display: flex; align-items: stretch; gap: 8px; min-height: 52px; }
.allcats { position: relative; }
.allcats__btn {
  height: 100%; min-width: 250px;
  display: flex; align-items: center; gap: 12px; padding-inline: 18px;
  background: var(--store-primary-dark); color: #fff; font-weight: 700;
}
.allcats__btn svg:last-child { margin-inline-start: auto; width: 16px; height: 16px; transition: transform .2s; }
.allcats.is-open .allcats__btn svg:last-child { transform: rotate(180deg); }
.allcats__menu {
  position: absolute; top: 100%; inset-inline-start: 0; width: 100%;
  background: #fff; color: var(--store-text);
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-lg); padding-block: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.allcats.is-open .allcats__menu, .allcats:hover .allcats__menu { opacity: 1; visibility: visible; transform: none; }
.allcats__menu a { display: flex; align-items: center; gap: 12px; padding: 10px 18px; font-size: 14px; font-weight: 500; }
.allcats__menu a:hover { background: var(--surface); color: var(--store-primary); }
.allcats__menu a svg { width: 18px; height: 18px; color: var(--muted); }
.allcats__menu a span { margin-inline-start: auto; color: var(--muted-2); font-size: 12px; }
.allcats__menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.allcats__menu .is-more { color: var(--store-primary); font-weight: 700; }

.mainnav { display: flex; align-items: stretch; gap: 2px; flex: 1; }
.mainnav a {
  display: inline-flex; align-items: center; gap: 7px; padding-inline: 14px;
  font-weight: 600; font-size: 15px; border-radius: 0;
  transition: background .2s;
}
.mainnav a:hover, .mainnav a.is-active { background: rgba(255, 255, 255, .14); }
.mainnav .dot { width: 9px; height: 9px; border-radius: 50%; }
.mainnav__tag {
  font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px;
  background: var(--store-accent); color: var(--ink-dark); line-height: 1.3;
}
.navbar__extra { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.navbar__extra svg { width: 18px; height: 18px; }

/* درج الهاتف */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(10, 12, 18, .5); z-index: 90;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(330px, 86vw);
  background: #fff; z-index: 100; display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden;
  transition: transform .3s var(--ease), visibility .3s;
  box-shadow: var(--shadow-lg);
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer__tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.drawer__tabs button { padding: 12px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
.drawer__tabs button.is-active { color: var(--store-primary); border-color: var(--store-primary); }
.drawer__body { overflow-y: auto; flex: 1; }
.drawer__panel { display: none; }
.drawer__panel.is-active { display: block; }
.drawer__panel a { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--surface-2); font-weight: 600; }
.drawer__panel a svg { width: 18px; height: 18px; color: var(--muted); }
.drawer__foot { padding: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; }
.drawer__foot a { display: flex; align-items: center; gap: 10px; }
.drawer__foot svg { width: 18px; height: 18px; color: var(--store-primary); }

/* شريط الهاتف السفليّ */
.tabbar { display: none; }

/* ==========================================================================
   عنوان القسم
   ========================================================================== */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-head__title { font-size: 22px; font-weight: 800; color: var(--ink-dark); display: flex; align-items: center; gap: 12px; }
.sec-head__title::before { content: ""; width: 5px; height: 24px; border-radius: 3px; background: var(--store-primary); }
.sec-head__tools { display: flex; align-items: center; gap: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  padding: 7px 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
}
.tabs button:is(.is-active, [aria-selected="true"]) { color: var(--store-primary); border-color: var(--store-primary); background: #fff; }
.tabs button:hover { color: var(--store-primary); }
.arrows { display: flex; gap: 6px; }
.arrows button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; }
.arrows button:hover { background: var(--store-primary); color: #fff; border-color: var(--store-primary); }
.arrows svg { width: 16px; height: 16px; }

/* ==========================================================================
   بطاقة الكتاب
   ========================================================================== */
.grid-books {
  --cols: 5;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 16px;
}
body[data-books-per-row="3"] .grid-books { --cols: 3; }
body[data-books-per-row="4"] .grid-books { --cols: 4; }
body[data-books-per-row="5"] .grid-books { --cols: 5; }
body[data-books-per-row="6"] .grid-books { --cols: 6; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow); border-color: transparent; }

/* شكل البطاقة: مؤطَّرة (الافتراضيّ) / كلاسيكيّة / بسيطة */
body[data-card-style="classic"] .card { border-color: transparent; box-shadow: var(--shadow-sm); }
body[data-card-style="classic"] .card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
body[data-card-style="minimal"] .card { border-color: transparent; background: transparent; padding: 0; }
body[data-card-style="minimal"] .card:hover { box-shadow: none; }
body[data-card-style="minimal"] .card__media { background: var(--surface); }

.card__media {
  position: relative; display: block; aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
}
.card__media > a { display: block; height: 100%; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }

/* دائرة نوع الكتاب على ركن الغلاف */
.type-dot {
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22); border: 2px solid #fff;
}
.type-dot svg { width: 16px; height: 16px; }
.type-dot--paper { background: var(--type-paper); }
.type-dot--ebook { background: var(--type-ebook); }
.type-dot--audio { background: var(--type-audio); }
.type-dot--edu { background: var(--type-edu); }

/* الشارات */
.badges { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.badge { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; line-height: 1.4; }
.badge--sale { background: var(--danger); color: #fff; }
.badge--new { background: var(--store-accent); color: var(--ink-dark); }

/* المفضّلة والنظرة السريعة: تطفوان فوق الغلاف ولا تحجزان مكانًا؛ تظهران عند التحويم في الحاسوب، ودائمًا في أجهزة اللمس */
.card__tools {
  position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 3;
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.card:hover .card__tools, .card__tools:focus-within { opacity: 1; transform: none; }
.card__wish, .card__quick {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--store-text); box-shadow: var(--shadow); transition: background .2s, color .2s;
}
.card__wish svg, .card__quick svg { width: 18px; height: 18px; }
.card__quick:hover { background: var(--store-accent); color: var(--charcoal); }
.card__wish:hover, .card__wish.is-active { color: var(--danger); }
.card__wish.is-active svg { fill: currentColor; }
@media (hover: none) { .card__tools { opacity: 1; transform: none; } }

/* نفدت الكمّيّة */
.card__soldout {
  position: absolute; inset-inline: 0; top: 50%; transform: translateY(-50%); z-index: 1;
  background: rgba(18, 21, 28, .84); color: #fff; text-align: center;
  font-weight: 700; font-size: 13px; padding: 8px;
}
.card.is-soldout .card__media img { filter: grayscale(.85); opacity: .75; }

.card__body { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; flex: 1; }
.card__author { font-size: 13px; color: var(--muted); }
.card__author:hover { color: var(--store-primary); }
.card__title {
  font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--ink-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__title a:hover { color: var(--store-primary); }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.card__foot .price { flex-direction: column; align-items: flex-start; gap: 0; }
.card__foot .price__old { order: -1; }
.card__cart {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--store-primary); transition: background .2s, color .2s;
}
.card__cart svg { width: 19px; height: 19px; }
.card__cart:hover { background: var(--store-primary); color: #fff; }
.card__cart[disabled] { color: var(--muted-2); background: var(--surface); cursor: not-allowed; }

/* السعر */
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.price__now { font-size: 17px; font-weight: 800; color: var(--store-text); }
.price--sale .price__now { color: var(--danger); }
.price__old { font-size: 13px; color: var(--muted-2); text-decoration: line-through; }
.price--lg .price__now { font-size: 28px; }
.price--lg .price__old { font-size: 17px; }

/* التقييم: النجوم ذهبيّة دائمًا */
.rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars svg { width: 14px; height: 14px; }
.stars .is-empty { color: #d8dce3; }
.rating--lg .stars svg { width: 18px; height: 18px; }
.rating--lg { font-size: 14px; }

/* ==========================================================================
   بطاقة عرض اليوم
   ========================================================================== */
.deal {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
  background: #fff; border: 2px solid var(--store-primary); border-radius: var(--radius);
  padding: 16px; position: relative;
}
.deal .card__media { aspect-ratio: 2 / 3; }
.deal .badges { top: auto; bottom: 8px; }
.deal__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.deal__title { font-size: 17px; font-weight: 800; line-height: 1.4; }
.countdown { display: flex; gap: 6px; margin-top: 4px; }
.countdown div {
  flex: 1; min-width: 0; max-width: 62px; padding: 6px 2px; border-radius: var(--radius-sm);
  background: var(--surface); text-align: center; line-height: 1.15;
}
.countdown b { display: block; font-size: 19px; font-weight: 800; color: var(--ink-dark); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   البطاقة الأفقيّة الصغيرة
   ========================================================================== */
.mini { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 0; }
.mini + .mini { border-top: 1px dashed var(--line); }
.mini__cover { aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface); }
.mini__cover img { width: 100%; height: 100%; object-fit: cover; }
.mini__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini__title {font-size: 14px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini__title:hover { color: var(--store-primary); }
.mini .price__now { font-size: 15px; }

/* ==========================================================================
   البانرات
   ========================================================================== */
.banner {
  position: relative; display: flex; align-items: center; overflow: hidden;
  border-radius: var(--radius); min-height: 190px; padding: 26px 28px; isolation: isolate;
  color: var(--ink-dark);
}
.banner__bg { position: absolute; inset: 0; z-index: -1; }
.banner__art {
  position: absolute; inset-block: 0; inset-inline-end: 0; width: 42%;
  display: flex; align-items: center; justify-content: center; z-index: -1; padding-inline: 8px;
}
.banner__art img { width: 32%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-lg); }
.banner__art img:nth-child(1) { transform: rotate(-8deg) translateX(-14%); }
.banner__art img:nth-child(2) { width: 38%; z-index: 1; }
.banner__art img:nth-child(3) { transform: rotate(8deg) translateX(14%); }
.banner__body { width: 56%; display: flex; flex-direction: column; gap: 6px; }
.banner__kicker { font-size: 13px; font-weight: 700; color: var(--muted); }
.banner__title { font-size: 23px; font-weight: 800; line-height: 1.3; }
.banner__text { font-size: 14px; color: var(--muted); }
.banner .link-arrow { margin-top: 8px; }
.banner--soft-blue .banner__bg { background: linear-gradient(135deg, #e8f0fd, #d6e4fb); }
.banner--soft-sand .banner__bg { background: linear-gradient(135deg, #fdf3e2, #f8e5c6); }
.banner--soft-mint .banner__bg { background: linear-gradient(135deg, #e6f5ee, #d1ecdf); }
.banner--soft-lilac .banner__bg { background: linear-gradient(135deg, #f1eafb, #e3d6f5); }
.banner--dark { color: #fff; background-color: var(--ink-dark); }
.banner--dark .banner__bg { background: radial-gradient(120% 140% at 0% 0%, #2a3142 0%, var(--ink-dark) 60%); }
.banner--dark .banner__kicker, .banner--dark .banner__text { color: #c7ccd6; }
.banner--dark .link-arrow { color: var(--store-accent); }
.banner--primary { color: #fff; background-color: var(--store-primary-dark); }
.banner--primary .banner__bg { background: radial-gradient(120% 140% at 0% 100%, var(--store-primary) 0%, var(--store-primary-dark) 75%); }
.banner--primary .banner__kicker, .banner--primary .banner__text { color: rgba(255, 255, 255, .86); }
.banner--primary .link-arrow { color: #fff; }

/* ==========================================================================
   التصنيف والمؤلّف
   ========================================================================== */
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 16px 10px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.cat:hover { border-color: var(--store-primary); box-shadow: var(--shadow); }
.cat__img { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--surface); }
.cat__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.cat:hover .cat__img img { transform: scale(1.08); }
.cat__name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.cat__count { font-size: 12px; color: var(--muted); background: var(--surface); padding: 2px 10px; border-radius: var(--radius-pill); }

.author { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.author__img { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); transition: box-shadow .2s; }
.author:hover .author__img { box-shadow: 0 0 0 2px var(--store-primary); }
.author__img img { width: 100%; height: 100%; object-fit: cover; }
.author__name { font-weight: 700; }
.author__meta { font-size: 13px; color: var(--muted); }

/* ==========================================================================
   شريط الثقة
   ========================================================================== */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.trust__item { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.trust__item + .trust__item { border-inline-start: 1px solid var(--line); }
.trust__icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--store-primary); flex: none; }
.trust__icon svg { width: 24px; height: 24px; }
.trust__title { font-weight: 800; font-size: 15px; line-height: 1.35; }
.trust__text { font-size: 13px; color: var(--muted); }

/* ==========================================================================
   ترقيم الصفحات
   ========================================================================== */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 42px; height: 42px; padding-inline: 10px; border-radius: var(--radius-sm);
  display: inline-grid; place-items: center; font-weight: 700;
  border: 1px solid var(--line); background: #fff;
}
.pager a:hover { border-color: var(--store-primary); color: var(--store-primary); }
.pager .is-current { background: var(--store-primary); border-color: var(--store-primary); color: #fff; }
.pager .is-gap { border: 0; background: transparent; min-width: 20px; color: var(--muted); }
.pager svg { width: 16px; height: 16px; }

/* ==========================================================================
   الاشتراك البريديّ
   ========================================================================== */
.newsletter {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  padding: 30px 34px; border-radius: var(--radius);
  background: var(--store-primary); color: #fff; position: relative; overflow: hidden; isolation: isolate;
}
.newsletter::after {
  content: ""; position: absolute; inset-inline-end: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); z-index: -1;
}
.newsletter__title { font-size: 24px; font-weight: 800; line-height: 1.35; }
.newsletter__text { color: rgba(255, 255, 255, .88); font-size: 14px; margin-top: 4px; }
.newsletter__form { display: flex; gap: 8px; background: #fff; padding: 6px; border-radius: var(--radius-pill); min-width: min(440px, 100%); }
.newsletter__form input { flex: 1; min-width: 0; border: 0; padding-inline: 16px; color: var(--store-text); background: transparent; }
.newsletter__form input:focus { outline: none; }

/* ==========================================================================
   التذييل
   ========================================================================== */
.footer { background: var(--footer-bg); color: var(--footer-text); font-size: 14px; margin-top: 0; }
.footer a:hover { color: #fff; }
.footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; padding-block: 48px 36px; }
.footer .brand__name { color: #fff; }
.footer .brand__tag { color: var(--footer-text); }
.footer__about { margin-top: 14px; line-height: 1.8; max-width: 34ch; }
.footer__call { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.footer__call svg { width: 34px; height: 34px; color: var(--store-accent); }
.footer__call small { display: block; font-size: 12px; }
.footer__call b { display: block; color: #fff; font-size: 19px; font-weight: 800; direction: ltr; text-align: end; }
.footer__title { color: #fff; font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.footer__links li + li { margin-top: 9px; }
.footer__social { display: flex; gap: 8px; margin-top: 18px; }
.footer__social a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.footer__social a:hover { background: var(--store-primary); }
.footer__social svg { width: 17px; height: 17px; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); }
.footer__bottom .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; font-size: 13px; flex-wrap: wrap; }
.pay { display: flex; gap: 6px; flex-wrap: wrap; }
.pay span {
  height: 28px; padding-inline: 10px; border-radius: 5px; display: inline-grid; place-items: center;
  background: #fff; color: var(--ink-dark); font-size: 12px; font-weight: 800;
}

/* ==========================================================================
   حقول النماذج
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.input, .select {
  height: 46px; padding-inline: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; width: 100%;
}
.input:focus, .select:focus { outline: none; border-color: var(--store-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--store-primary) 18%, transparent); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-pill); height: 46px; overflow: hidden; }
.qty button { width: 42px; height: 100%; display: grid; place-items: center; }
.qty button:hover { background: var(--surface); }
.qty input { width: 44px; text-align: center; border: 0; font-weight: 700; background: transparent; }
.qty svg { width: 16px; height: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface); font-size: 13px; font-weight: 600; }
.chip svg { width: 14px; height: 14px; }

/* ==========================================================================
   صفحة المكوّنات (للمراجعة فقط)
   ========================================================================== */
.cmp-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 26px; }
.cmp-hero h1 { font-size: 28px; font-weight: 800; }
.cmp-hero p { color: var(--muted); margin-top: 4px; }
.cmp-block { padding-block: 30px; border-bottom: 1px solid var(--line); }
.cmp-block > .container > h2 { font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.cmp-block > .container > h2 code { font-family: ui-monospace, monospace; font-size: 12px; background: var(--surface); padding: 2px 8px; border-radius: 6px; color: var(--store-text); direction: ltr; }
.cmp-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cmp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cmp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cmp-grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cmp-label { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }
.cmp-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.cmp-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cmp-legend .type-dot { position: static; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: 13px; }
.swatch i { display: block; height: 64px; }
.swatch div { padding: 8px 10px; }
.swatch code { display: block; font-size: 12px; color: var(--muted); direction: ltr; text-align: end; }

.preview-panel {
  position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 80;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 260px; font-size: 13px;
}
.preview-panel summary { padding: 12px 14px; font-weight: 800; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.preview-panel summary::-webkit-details-marker { display: none; }
.preview-panel summary svg { width: 18px; height: 18px; color: var(--store-primary); }
.preview-panel__body { padding: 0 14px 14px; display: grid; gap: 10px; }
.preview-panel__body .select { height: 38px; font-size: 13px; }
.preview-panel__note { color: var(--muted); font-size: 12px; line-height: 1.5; }


/* الكوبون */
.coupon { display: flex; gap: 8px; }
.coupon .input { flex: 1; min-width: 0; }
.coupon-applied {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding-inline: 14px 8px;
  border: 1px dashed var(--success); border-radius: var(--radius-sm); background: #eef8f2; color: var(--success); font-size: 14px;
}
.coupon-applied > svg { width: 18px; height: 18px; flex: none; }
.coupon-applied span { flex: 1; min-width: 0; color: var(--store-text); }
.coupon-applied button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.coupon-applied button:hover { background: #fff; color: var(--danger); }
.coupon-applied button svg { width: 16px; height: 16px; }

/* ==========================================================================
   الرئيسيّة
   ========================================================================== */
.hero { padding-block: 22px 8px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 16px; }
.hero__side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; }

.slider { position: relative; display: grid; border-radius: var(--radius); overflow: hidden; min-height: 460px; isolation: isolate; }
.slide {
  grid-area: 1 / 1; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center;
  padding: 40px 54px; gap: 24px;
  opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility .6s;
}
.slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.slide--1 { background: radial-gradient(110% 130% at 100% 0%, #e9f1fe 0%, #d3e3fb 55%, #c3d8f8 100%); }
.slide--2 { background: radial-gradient(110% 130% at 100% 0%, var(--store-primary) 0%, var(--store-primary-dark) 80%); color: #fff; }
.slide--3 { background: radial-gradient(110% 130% at 100% 0%, #fff6e2 0%, #fbe6bb 70%); }
.slide__body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.slide__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--store-primary); background: #fff; padding: 5px 12px; border-radius: var(--radius-pill); }
.slide--2 .slide__kicker { color: var(--ink-dark); background: var(--store-accent); }
.slide__kicker svg { width: 16px; height: 16px; }
.slide__title { font-size: 42px; line-height: 1.2; font-weight: 800; color: inherit; text-wrap: balance; }
.slide--1 .slide__title, .slide--3 .slide__title { color: var(--ink-dark); }
.slide__text { font-size: 16px; color: var(--muted); max-width: 40ch; }
.slide--2 .slide__text { color: rgba(255, 255, 255, .86); }
.slide__price { display: flex; align-items: baseline; gap: 10px; font-size: 15px; }
.slide__price b { font-size: 28px; font-weight: 800; }
.slide__price del { color: var(--muted); }
.slide--2 .slide__price del { color: rgba(255, 255, 255, .7); }
.slide__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.slide--2 .btn--outline { border-color: #fff; color: #fff; }
.slide--2 .btn--outline:hover { background: #fff; color: var(--store-primary-dark); }
.slide__art { position: relative; height: 100%; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.slide__art img { position: absolute; width: 40%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 50px rgba(10, 20, 40, .32); }
.slide__art img:nth-child(1) { transform: translateX(-52%) rotate(-9deg) scale(.86); }
.slide__art img:nth-child(2) { z-index: 2; width: 46%; }
.slide__art img:nth-child(3) { transform: translateX(52%) rotate(9deg) scale(.86); }
.slide__art::before { content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.slide--2 .slide__art::before { background: rgba(255, 255, 255, .1); }
.slider__dots { position: absolute; bottom: 18px; inset-inline-start: 54px; display: flex; gap: 8px; z-index: 3; }
.slider__dots button { width: 10px; height: 10px; border-radius: 6px; background: rgba(18, 21, 28, .25); transition: width .3s var(--ease), background .3s; }
.slider__dots button.is-active { width: 28px; background: var(--store-primary); }
.slider--on-dark .slider__dots button.is-active { background: var(--store-accent); }
.slider__arrows { position: absolute; bottom: 12px; inset-inline-end: 16px; display: flex; gap: 8px; z-index: 3; }

.banner--compact { min-height: 0; padding: 18px 20px; }
.banner--compact .banner__title { font-size: 18px; }
.banner--compact .banner__kicker { font-size: 12px; }
.banner--compact .banner__art { width: 40%; }
.banner--compact .banner__body { width: 60%; gap: 2px; }
.banner--compact .link-arrow { margin-top: 4px; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-cats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.grid-authors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.grid-deals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.banner--wide { min-height: 220px; padding: 34px 44px; }
.banner--wide .banner__title { font-size: 30px; }
.banner--wide .banner__art { width: 36%; }
.banner--wide .banner__art img { width: 24%; max-width: 120px; }
.banner--wide .banner__art img:nth-child(2) { width: 29%; max-width: 145px; }

.deals-head__timer { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--danger); background: #fdecee; padding: 6px 12px; border-radius: var(--radius-pill); }
.deals-head__timer svg { width: 16px; height: 16px; }

/* الأكثر مبيعًا: عمود جانبيّ وشبكة */
.split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-box__head { padding: 14px 18px; font-weight: 800; border-bottom: 1px solid var(--line); }
.side-box__list a { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; font-size: 14px; font-weight: 500; }
.side-box__list a + a { border-top: 1px solid var(--surface-2); }
.side-box__list a:hover { color: var(--store-primary); background: var(--surface); }
.side-box__list span { font-size: 12px; color: var(--muted); background: var(--surface); padding: 1px 9px; border-radius: var(--radius-pill); }
.side-promo { margin-top: 16px; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 360px; padding: 24px; }
.side-promo .banner__body { width: 100%; }
.side-promo .banner__art { inset-block: auto 0; height: 55%; width: 100%; padding-bottom: 18px; }
.split .grid-books { --cols: 4 !important; }

/* قوائم صغيرة في ثلاثة أعمدة */
.mini-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 8px; }
.mini-col__title { font-size: 17px; font-weight: 800; padding-bottom: 8px; border-bottom: 2px solid var(--surface-2); margin-bottom: 4px; position: relative; }
.mini-col__title::after { content: ""; position: absolute; bottom: -2px; inset-inline-start: 0; width: 46px; height: 2px; background: var(--store-primary); }

/* آراء القرّاء */
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.review__text { font-size: 15px; line-height: 1.8; flex: 1; }
.review__foot { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--surface-2); }
.review__foot img { width: 40px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; }
.review__name { font-weight: 800; font-size: 14px; }
.review__book { font-size: 13px; color: var(--muted); }
.review__book:hover { color: var(--store-primary); }
.review__quote { width: 30px; height: 30px; color: var(--store-primary); opacity: .25; }


/* ==========================================================================
   صفحة التصنيف والبحث
   ========================================================================== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--store-primary); }
.crumbs svg { width: 14px; height: 14px; color: var(--muted-2); }
.crumbs [aria-current] { color: var(--store-text); font-weight: 700; }

.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 22px; }
.page-head__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; }
.page-head__title { font-size: 30px; font-weight: 800; color: var(--ink-dark); line-height: 1.25; }
.page-head__text { color: var(--muted); margin-top: 4px; max-width: 60ch; }
.page-head__img { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: none; border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.page-head__img img { width: 100%; height: 100%; object-fit: cover; }
.subcats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.subcats a { padding: 7px 14px; border-radius: var(--radius-pill); background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.subcats a:hover, .subcats a.is-active { border-color: var(--store-primary); color: var(--store-primary); }

.shop { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; padding-block: 24px 40px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 183px; }
.filters__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters__head h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.filters__head h2 svg { width: 18px; height: 18px; color: var(--store-primary); }
.filters__clear { font-size: 13px; font-weight: 700; color: var(--danger); }
.filters__close { display: none; }
.fgroup { padding: 14px 18px; border-bottom: 1px solid var(--surface-2); }
.fgroup:last-of-type { border-bottom: 0; }
.fgroup summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 15px; }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.fgroup[open] summary svg { transform: rotate(180deg); }
.fgroup__body { display: grid; gap: 8px; padding-top: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--store-primary); margin: 0; flex: none; }
.check .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.check small { margin-inline-start: auto; color: var(--muted-2); font-size: 12px; }
.check .stars svg { width: 13px; height: 13px; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.range .input { height: 40px; text-align: center; padding-inline: 8px; }
.range span { color: var(--muted); font-size: 13px; }
.filters__foot { padding: 14px 18px; border-top: 1px solid var(--line); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar__count { color: var(--muted); font-size: 14px; }
.toolbar__count b { color: var(--store-text); }
.toolbar__tools { display: flex; align-items: center; gap: 10px; }
.toolbar .select { height: 42px; width: auto; min-width: 190px; }
.filter-btn { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.active-filters .chip { background: #fff; border: 1px solid var(--line); }
.active-filters .chip button { display: grid; place-items: center; color: var(--muted); }
.active-filters .chip button:hover { color: var(--danger); }
.shop .grid-books { --cols: 4 !important; }
.shop__pager { margin-top: 28px; }
.results-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }


/* ==========================================================================
   صفحة الكتاب
   ========================================================================== */
.crumbs-bar { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 12px; }
.product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; padding-block: 28px 36px; align-items: start; }
.gallery { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; position: sticky; top: 183px; }
.gallery__thumbs { display: flex; flex-direction: column; gap: 10px; }
.gallery__thumbs button { aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: var(--surface); padding: 0; }
.gallery__thumbs button.is-active { border-color: var(--store-primary); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main { position: relative; background: var(--surface); border-radius: var(--radius); padding: 34px; display: grid; place-items: center; }
.gallery__main img { width: 74%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 22px 44px rgba(18, 21, 28, .22); }
.gallery__main .type-dot { width: 40px; height: 40px; top: 14px; inset-inline-start: 14px; }
.gallery__main .type-dot svg { width: 20px; height: 20px; }
.gallery__main .badges { top: 14px; inset-inline-end: 14px; }
.gallery__sample { position: absolute; bottom: 14px; inset-inline: 14px; display: flex; justify-content: center; }

.pinfo { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.type-pill { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 13px; font-weight: 800; padding: 4px 4px 4px 14px; border-radius: var(--radius-pill); color: var(--store-text); background: var(--surface); border: 1px solid var(--line); }
.type-pill svg { width: 24px; height: 24px; padding: 5px; border-radius: 50%; color: #fff; background: var(--t); }
.type-pill--paper { --t: var(--type-paper); }
.type-pill--ebook { --t: var(--type-ebook); }
.type-pill--audio { --t: var(--type-audio); }
.type-pill--edu { --t: var(--type-edu); }
.pinfo__title { font-size: 32px; line-height: 1.3; font-weight: 800; color: var(--ink-dark); text-wrap: balance; }
.pinfo__by { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.pinfo__by a { color: var(--store-primary); font-weight: 700; }
.pinfo__by .rating a { color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.pinfo__price { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-block: 14px; border-block: 1px solid var(--line); }
.save-pill { font-size: 13px; font-weight: 800; color: var(--danger); background: #fdecee; padding: 4px 10px; border-radius: var(--radius-pill); }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--success); }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock--low { color: #b35c00; }
.stock--out { color: var(--danger); }
.pinfo__desc { color: var(--muted); line-height: 1.9; max-width: 65ch; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fact { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.fact small { display: block; font-size: 12px; color: var(--muted); }
.fact b { display: block; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.buybox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.buybox .btn--primary { flex: 1 1 200px; }
.buybox .btn--accent { flex: 1 1 160px; }
.pinfo__links { display: flex; gap: 18px; font-size: 14px; font-weight: 600; color: var(--muted); }
.pinfo__links button { display: inline-flex; align-items: center; gap: 6px; }
.pinfo__links button:hover { color: var(--store-primary); }
.pinfo__links svg { width: 18px; height: 18px; }
.formats { display: grid; gap: 8px; }
.formats__title { font-size: 14px; font-weight: 800; }
.formats__list { display: flex; flex-wrap: wrap; gap: 8px; }
.format { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; background: #fff; }
.format .type-dot { position: static; width: 28px; height: 28px; border-width: 0; box-shadow: none; }
.format .type-dot svg { width: 14px; height: 14px; }
.format b { display: block; font-size: 14px; }
.format small { color: var(--muted); font-size: 12px; }
.format.is-current { border-color: var(--store-primary); box-shadow: 0 0 0 1px var(--store-primary); }
.format:not(.is-current):hover { border-color: var(--ink-dark); }
.perks { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.perk { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 14px; }
.perk + .perk { border-top: 1px solid var(--line); }
.perk svg { width: 22px; height: 22px; color: var(--store-primary); flex: none; }
.perk b { font-weight: 800; }

.ptabs { border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ptabs button { padding: 14px 18px; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptabs button.is-active { color: var(--store-primary); border-color: var(--store-primary); }
.ptab-panel { padding-block: 24px; }
.ptab-panel[hidden] { display: none; }
.prose { max-width: 72ch; line-height: 1.95; display: grid; gap: 14px; }
.prose h3 { font-size: 18px; font-weight: 800; margin-top: 6px; }
.spec { width: 100%; max-width: 720px; border-collapse: collapse; font-size: 15px; }
.spec th, .spec td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.spec th { width: 38%; color: var(--muted); font-weight: 600; background: var(--surface); }

.rsum { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.rsum__score { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 22px; display: grid; gap: 6px; justify-items: center; }
.rsum__score b { font-size: 48px; font-weight: 800; line-height: 1; }
.rsum__score .stars svg { width: 20px; height: 20px; }
.rsum__score small { color: var(--muted); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 70px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.bar__track { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar__track i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.rlist { display: grid; gap: 0; margin-top: 24px; }
.ritem { padding-block: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ritem__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ritem__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.ritem__name { font-weight: 800; }
.ritem__date { font-size: 13px; color: var(--muted-2); }
.ritem__badge { font-size: 12px; color: var(--success); display: inline-flex; align-items: center; gap: 4px; }
.ritem__badge svg { width: 14px; height: 14px; }
.ritem p { line-height: 1.85; max-width: 72ch; }

.buybar { display: none; }


/* مشغّل العيّنة الصوتيّة (شكل فقط) */
.sample-player { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); background: #f5f0f8; border: 1px solid #e6dcee; }
.sample-player__btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--type-audio); color: #fff; flex: none; }
.sample-player__btn svg { width: 20px; height: 20px; margin-inline-start: 3px; }
.sample-player__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.sample-player__title { font-size: 14px; font-weight: 800; }
.sample-player__track { height: 6px; border-radius: 4px; background: #e2d6ea; overflow: hidden; }
.sample-player__track i { display: block; width: 0; height: 100%; background: var(--type-audio); }
.sample-player__time { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.duration-pill { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--store-text); background: var(--surface); padding: 5px 12px; border-radius: var(--radius-pill); }
.duration-pill svg { width: 16px; height: 16px; color: var(--type-audio); }


/* أبرز بيانات الوسيلة التعليميّة */
.edu-hl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.edu-hl__item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: #eef6f2; border: 1px solid #d3e8dd; }
.edu-hl__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--type-edu); color: #fff; flex: none; }
.edu-hl__icon svg { width: 22px; height: 22px; }
.edu-hl small { display: block; font-size: 12px; color: var(--muted); }
.edu-hl b { display: block; font-size: 18px; font-weight: 800; }
.safety { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8a4b00; background: #fff6e5; border-radius: var(--radius-sm); padding: 8px 12px; }
.safety svg { width: 18px; height: 18px; flex: none; }
.box-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
.box-list li { display: flex; align-items: center; gap: 8px; }
.box-list svg { width: 16px; height: 16px; color: var(--type-edu); flex: none; }
@media (max-width: 575px) { .box-list { grid-template-columns: 1fr; } .edu-hl b { font-size: 16px; } }


/* ==========================================================================
   صفحة المؤلّف
   ========================================================================== */
.author-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 22px 32px; }
.author-hero__card { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: center; margin-top: 18px; }
.author-hero__img { width: 180px; height: 180px; border-radius: 50%; overflow: hidden; border: 5px solid #fff; box-shadow: var(--shadow); }
.author-hero__img img { width: 100%; height: 100%; object-fit: cover; }
.author-hero__body { display: grid; gap: 12px; min-width: 0; }
.author-hero__kicker { font-size: 13px; font-weight: 800; color: var(--store-primary-dark); }
.author-hero__name { font-size: 34px; font-weight: 800; line-height: 1.2; color: var(--ink-dark); }
.author-hero__bio { color: var(--muted); line-height: 1.9; max-width: 70ch; }
.author-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.author-stats span { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 6px 14px; font-size: 14px; }
.author-stats b { font-weight: 800; }
.author-stats .dot { width: 9px; height: 9px; border-radius: 50%; }
@media (max-width: 575px) {
  .author-hero__card { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 16px; }
  .author-hero__img { width: 132px; height: 132px; }
  .author-hero__name { font-size: 26px; }
  .author-stats { justify-content: center; }
}


/* ==========================================================================
   السلّة
   ========================================================================== */
.cart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; }
.cart-head h1 { font-size: 28px; font-weight: 800; color: var(--ink-dark); }
.cart-head h1 span { color: var(--muted); font-weight: 600; font-size: 18px; }
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; align-items: start; padding-block: 18px 40px; }
.freeship { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 8px; margin-bottom: 14px; }
.freeship p { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.freeship p svg { width: 20px; height: 20px; color: var(--store-primary); }
.freeship b { color: var(--store-primary); }
.freeship__track { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.freeship__track i { display: block; height: 100%; border-radius: 6px; background: var(--store-primary); }
.citems { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.citems__head { display: grid; grid-template-columns: minmax(0, 1fr) 130px 140px 110px 40px; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.citem { display: grid; grid-template-columns: minmax(0, 1fr) 130px 140px 110px 40px; gap: 14px; align-items: center; padding: 16px 18px; }
.citem + .citem { border-top: 1px solid var(--line); }
.citem__prod { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; }
.citem__cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface); }
.citem__cover img { width: 100%; height: 100%; object-fit: cover; }
.citem__cover .type-dot { top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-width: 1.5px; }
.citem__cover .type-dot svg { width: 12px; height: 12px; }
.citem__title { font-weight: 800; line-height: 1.45; }
.citem__title:hover { color: var(--store-primary); }
.citem__meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.citem__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-top: 6px; color: var(--muted); }
.citem__tag i { width: 8px; height: 8px; border-radius: 50%; }
.citem .price { flex-direction: column; align-items: flex-start; gap: 0; }
.citem .price__now { font-size: 16px; }
.citem__digital { font-size: 13px; color: var(--muted); }
.citem__total { font-weight: 800; font-size: 17px; }
.citem__remove { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.citem__remove:hover { background: #fdecee; color: var(--danger); }
.citem__remove svg { width: 18px; height: 18px; }
.citem__label { display: none; }
.citems__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); }
.citems__foot .link-arrow svg { transform: scaleX(-1); }
.citems__foot .link-arrow:hover svg { transform: scaleX(-1) translateX(-4px); }

.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 16px; position: sticky; top: 183px; }
.summary h2 { font-size: 19px; font-weight: 800; }
.summary__rows { display: grid; gap: 10px; font-size: 15px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; }
.summary__row span:first-child { color: var(--muted); }
.summary__row--discount span:last-child { color: var(--success); font-weight: 700; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px dashed var(--line); }
.summary__total span { font-weight: 800; }
.summary__total b { font-size: 26px; font-weight: 800; }
.summary__note { display: flex; gap: 8px; font-size: 13px; color: var(--muted); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.summary__note svg { width: 18px; height: 18px; flex: none; color: var(--type-ebook); }
.summary .pay { justify-content: center; }
.summary .pay span { background: var(--surface); }
.summary__secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); }
.summary__secure svg { width: 15px; height: 15px; }

.empty-cart { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 56px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-cart__icon { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--store-primary); }
.empty-cart__icon svg { width: 44px; height: 44px; }
.empty-cart h2 { font-size: 22px; font-weight: 800; }
.empty-cart p { color: var(--muted); max-width: 44ch; }
.preview-toggle { display: flex; justify-content: center; margin-top: 8px; }

@media (max-width: 1199px) {
  .cart { grid-template-columns: minmax(0, 1fr) 320px; }
  .citems__head { display: none; }
  .citem { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "prod remove" "price qty" "total total"; row-gap: 10px; }
  .citem__prod { grid-area: prod; }
  .citem__remove { grid-area: remove; align-self: start; }
  .citem__unit { grid-area: price; }
  .citem__qty { grid-area: qty; justify-self: end; }
  .citem__sum { grid-area: total; display: flex; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 10px; }
  .citem__label { display: inline; color: var(--muted); font-size: 14px; }
}
@media (max-width: 991px) {
  .cart { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 575px) {
  .cart-head h1 { font-size: 22px; }
  .citem { padding: 14px; }
  .citem__prod { grid-template-columns: 60px minmax(0, 1fr); gap: 10px; }
  .citem__title { font-size: 14px; }
}


/* ==========================================================================
   صفحة 404
   ========================================================================== */
.nf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 48px 56px; }
.nf__art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; isolation: isolate; }
.nf__art::before { content: ""; position: absolute; width: min(80%, 330px); aspect-ratio: 1; border-radius: 50%; background: var(--surface); z-index: -1; }
.nf__code { font-size: clamp(90px, 12vw, 150px); font-weight: 800; color: var(--store-primary); opacity: .16; line-height: .9; margin-bottom: -34px; letter-spacing: -.02em; }
.nf__shelf { position: relative; display: flex; align-items: flex-end; gap: 6px; padding-bottom: 10px; border-bottom: 8px solid var(--ink-dark); border-radius: 0 0 4px 4px; }
.nf__shelf img { width: 70px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: var(--shadow); }
.nf__shelf img:nth-child(2) { width: 78px; }
.nf__shelf .gap { width: 70px; aspect-ratio: 2 / 3; border: 2px dashed var(--muted-2); border-radius: 3px; display: grid; place-items: center; color: var(--muted); font-weight: 800; font-size: 26px; }
.nf__shelf img:last-child { transform: rotate(14deg) translate(-6px, 4px); transform-origin: bottom left; }
.nf__body { display: grid; gap: 14px; justify-items: start; }
.nf__kicker { font-size: 14px; font-weight: 800; color: var(--store-primary); }
.nf__title { font-size: 36px; font-weight: 800; line-height: 1.25; color: var(--ink-dark); text-wrap: balance; }
.nf__text { color: var(--muted); max-width: 46ch; line-height: 1.9; }
.nf__body .search { width: 100%; max-width: 520px; }
.nf__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.nf__cats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
@media (max-width: 991px) {
  .nf { grid-template-columns: 1fr; gap: 16px; padding-block: 28px 40px; }
  .nf__art { min-height: 270px; }
  .nf__body { justify-items: center; text-align: center; }
  .nf__actions, .nf__cats { justify-content: center; }
  .nf .search { display: block; }
}
@media (max-width: 575px) {
  .nf__title { font-size: 26px; }
  .nf__shelf img, .nf__shelf .gap { width: 56px; }
  .nf__shelf img:nth-child(2) { width: 62px; }
  .nf .search__cat { display: none; }
  .nf .search__btn span { display: none; }
}


/* ==========================================================================
   طابع «نَبْض» — ما يختلف عن الأساس
   ========================================================================== */
.topbar { background: var(--charcoal); color: var(--on-dark-muted); }
.topbar__promo { position: relative; min-height: 22px; min-width: 0; flex: 1; overflow: hidden; }
.ticker { position: relative; display: block; flex: 1; width: 100%; height: 22px; overflow: hidden; }
.ticker svg { width: 15px; height: 15px; vertical-align: -3px; color: var(--store-accent); }
.ticker span { line-height: 22px; }
.ticker span { position: absolute; inset-inline-start: 0; top: 0; white-space: nowrap; animation: tick 8s infinite; opacity: 0; }
.ticker span:nth-child(2) { animation-delay: 4s; }
.ticker strong { color: var(--store-accent); }
@keyframes tick { 0% { opacity: 0; transform: translateY(8px); } 6%, 44% { opacity: 1; transform: none; } 50%, 100% { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .ticker span:nth-child(2) { display: none; } .ticker span { opacity: 1; } }

.brand__name { font-weight: 800; letter-spacing: -.01em; }
.search__box { border-width: 2px; border-color: var(--charcoal); border-radius: var(--radius-sm); }
.search__cat { background: var(--surface); }
.search__btn { background: var(--charcoal); }
.search__btn:hover { background: var(--store-primary); }
.hact__badge { background: var(--store-primary); color: #fff; }

.navbar { background: var(--charcoal); }
.allcats__btn { background: var(--store-primary); }
.allcats__btn:hover { background: var(--store-primary-dark); }
.mainnav a { font-weight: 800; }
.mainnav a:hover, .mainnav a.is-active { background: transparent; color: var(--store-accent); box-shadow: inset 0 -3px 0 var(--store-accent); }
.mainnav__tag { background: var(--store-accent); color: var(--charcoal); }
.navbar__extra { color: var(--store-accent); }

.btn { border-radius: var(--radius-sm); font-weight: 800; }
.btn--accent { background: var(--store-accent); color: var(--charcoal); }
.btn--outline { border-color: var(--charcoal); color: var(--charcoal); }
.btn--outline:hover { background: var(--charcoal); color: #fff; }
.link-arrow { color: var(--store-primary-dark); }

.sec-head__title { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.sec-head__title::before { width: 10px; height: 30px; border-radius: 2px; background: var(--store-primary); transform: skewX(-12deg); }
.sec-head__kicker { display: block; font-size: 13px; font-weight: 800; color: var(--store-primary-dark); margin-bottom: 2px; }

.card { border-radius: var(--radius); }
.card:hover { box-shadow: var(--shadow); border-color: var(--charcoal); transform: translateY(-3px); }
.card__cat { font-size: 12px; font-weight: 800; color: var(--store-primary); }
.card__cart { background: var(--charcoal); color: #fff; border-radius: var(--radius-sm); }
.card__cart:hover { background: var(--store-primary); }
.price__now { font-weight: 800; }
.badge--new { background: var(--store-accent); color: var(--charcoal); }

/* أقسام داكنة بحوافّ مائلة */
.section--dark { background: var(--charcoal); color: var(--on-dark); position: relative; padding-block: calc(34px + var(--cut)) calc(34px + var(--cut)); clip-path: polygon(0 var(--cut), 100% 0, 100% calc(100% - var(--cut)), 0 100%); margin-block: -12px; }
.section--dark .sec-head__title { color: #fff; }
.section--dark .sec-head__kicker { color: var(--store-accent); }
.section--dark .link-arrow { color: var(--store-accent); }
.section--dark .tabs button { color: var(--on-dark-muted); }
.section--dark .tabs button:is(.is-active, [aria-selected="true"]) { background: transparent; color: var(--store-accent); border-color: var(--store-accent); }

/* الواجهة */
.hero-n { background: var(--charcoal); color: var(--on-dark); position: relative; overflow: hidden; isolation: isolate; }
.hero-n::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 34%; width: 70%; background: var(--store-primary); transform: skewX(-14deg); z-index: -1; }
.hero-n::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 30%; width: 3%; background: var(--store-accent); transform: skewX(-14deg); z-index: -1; }
.hero-n__grid { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px; min-height: 480px; padding-block: 40px; }
.hero-n__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--charcoal); background: var(--store-accent); padding: 5px 12px; border-radius: 4px; }
.hero-n__title { font-size: 60px; line-height: 1.08; font-weight: 800; margin-top: 16px; letter-spacing: -.02em; text-wrap: balance; }
.hero-n__title span { color: var(--store-accent); }
.hero-n__text { color: var(--on-dark-muted); font-size: 17px; margin-top: 14px; max-width: 42ch; }
.hero-n__statsbar { grid-row: 2; position: relative; z-index: 2; background: var(--charcoal); border-top: 1px solid rgba(255, 255, 255, .12); padding-block: 18px; }
.hero-n__statsbar:has(.hero-n__stats:empty) { display: none; }
.hero-n__stats { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.hero-n__stats:empty { display: none; }
.hero-n__stats b { display: block; font-size: 30px; font-weight: 800; color: #fff; line-height: 1.1; }
.hero-n__stats small { color: var(--on-dark-muted); font-size: 13px; }
.hero-n__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-n__actions .btn--outline { border-color: #fff; color: #fff; }
.hero-n__actions .btn--outline:hover { background: #fff; color: var(--charcoal); }
.hero-n__art { position: relative; min-height: 360px; display: flex; align-items: center; justify-content: center; }
.hero-n__art img { position: absolute; width: 40%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 30px 60px rgba(0, 0, 0, .45); }
.hero-n__art img:nth-child(1) { transform: translate(-42%, 18px) rotate(-8deg); }
.hero-n__art img:nth-child(2) { z-index: 2; width: 46%; transform: translate(14%, -14px) rotate(4deg); }
.hero-n__price { position: absolute; z-index: 3; bottom: 18px; inset-inline-end: 4%; background: #fff; color: var(--charcoal); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-lg); }
.hero-n__price small { display: block; font-size: 12px; color: var(--muted); }
.hero-n__price b { font-size: 22px; font-weight: 800; color: var(--store-primary); }

/* بطاقات التصنيف الصوريّة */
.ncat { position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; isolation: isolate; color: #fff; }
.ncat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .45s var(--ease); }
.ncat::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(16, 18, 22, .88), rgba(16, 18, 22, .05) 60%); }
.ncat:hover img { transform: scale(1.06); }
.ncat__body { padding: 16px; width: 100%; }
.ncat__name { font-size: 18px; font-weight: 800; display: block; }
.ncat__count { font-size: 13px; color: #e1e3e8; }
.ncat__go { position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--store-accent); color: var(--charcoal); transform: scale(.8); opacity: 0; transition: transform .25s, opacity .25s; }
.ncat:hover .ncat__go, .ncat:focus-visible .ncat__go { transform: none; opacity: 1; }
.ncat__go svg { width: 18px; height: 18px; }
@media (hover: none) { .ncat__go { opacity: 1; transform: none; } }


/* تسوّق حسب ما تحبّ */
.shopby { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.shopby a { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 12px; border-radius: var(--radius); border: 1px solid var(--line); text-align: center; font-weight: 800; transition: border-color .2s, transform .2s; }
.shopby a:hover { border-color: var(--charcoal); transform: translateY(-3px); }
.shopby i { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--t, var(--store-primary)) 12%, #fff); color: var(--t, var(--store-primary)); transform: rotate(-6deg); transition: transform .25s var(--ease); }
.shopby a:hover i { transform: none; }
.shopby i svg { width: 30px; height: 30px; }
.shopby small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* بطاقات المؤلّفين الكبيرة */
.nauthors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.nauthor { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--charcoal-2); color: #fff; }
.nauthor img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(.35); transition: filter .3s, transform .4s var(--ease); }
.nauthor:hover img { filter: none; transform: scale(1.04); }
.nauthor__body { display: block; padding: 12px 14px 14px; }
.nauthor__name { font-weight: 800; font-size: 16px; display: block; }
.nauthor__tag { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 800; background: var(--store-accent); color: var(--charcoal); padding: 2px 8px; border-radius: 4px; }
.nauthor__count { font-size: 12px; color: var(--on-dark-muted); margin-inline-start: 6px; }



.grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.section--tight { padding-block: 22px; }

/* شرائح الواجهة */
.hero-n { display: grid; }
.hero-n__slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility .6s; }
.hero-n__slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-n__ctrl { grid-area: 1 / 1; align-self: end; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; pointer-events: none; }
.hero-n__ctrl > * { pointer-events: auto; }
.hero-n__ctrl .slider__dots { position: static; }
.hero-n__ctrl .slider__dots button { background: rgba(255, 255, 255, .35); }
.hero-n__ctrl .slider__dots button.is-active { background: var(--store-accent); }
.hero-n__ctrl .arrows button { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero-n__ctrl .arrows button:hover { background: var(--store-accent); color: var(--charcoal); }
.hero-n__grid { padding-bottom: 72px; }

/* الأسئلة الشائعة */

.footer__hours { display: grid; gap: 4px; margin-top: 14px; font-size: 13px; }
.footer__hours div { display: flex; justify-content: space-between; gap: 12px; max-width: 260px; }
.footer__hours b { color: #fff; font-weight: 700; }
.footer .brand__name { color: #fff; }
.newsletter { background: var(--charcoal); }
.newsletter--primary { background: var(--store-primary); }
.newsletter--primary::after { background: rgba(0, 0, 0, .1); }
.newsletter--primary .btn--accent { background: var(--charcoal); color: #fff; }
.newsletter--primary .newsletter__text { color: #fff; }
.newsletter .btn--primary { background: var(--store-primary); }
.banner--dark .link-arrow { color: var(--store-accent); }
.banner--primary .banner__bg { background: radial-gradient(120% 140% at 0% 100%, var(--store-primary) 0%, var(--store-primary-dark) 75%); }
.trust__icon { background: color-mix(in srgb, var(--store-primary) 10%, #fff); }

/* ==========================================================================
   العروض المتجاوبة
   ========================================================================== */
@media (max-width: 1199px) {
  .header__main { gap: 18px; }
  .hact__text { display: none; }
  .allcats__btn { min-width: 210px; }
  .navbar__extra { display: none; }
  .grid-books { --cols: 4 !important; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .cmp-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slide { padding: 34px 36px; }
  .slide__title { font-size: 34px; }
  .slider__dots { inset-inline-start: 36px; }
  .grid-authors { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .split { grid-template-columns: 240px minmax(0, 1fr); }
  .split .grid-books { --cols: 3 !important; }
  .shop { grid-template-columns: 240px minmax(0, 1fr); }
  .shop .grid-books { --cols: 3 !important; }
  .product { gap: 28px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  body { padding-bottom: 64px; }
  .topbar__links .hide-md { display: none; }
  .header__main { grid-template-columns: auto 1fr auto; gap: 12px; padding-block: 12px; }
  .burger { display: inline-grid; }
  .header .search { display: none; }
  .mobile-search { display: block; padding-bottom: 12px; }
  .mobile-search .search__box { height: 46px; }
  .mobile-search .search__cat { display: none; }
  .mobile-search .search__btn span { display: none; }
  .header__actions .hact--hide-md { display: none; }
  .brand { justify-self: start; }
  .navbar { display: none; }
  .trust { grid-template-columns: 1fr 1fr; }
  .trust__item:nth-child(3) { border-inline-start: 0; }
  .trust__item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid-books { --cols: 3 !important; }
  .deal { grid-template-columns: 120px 1fr; }
  .newsletter { grid-template-columns: 1fr; }
  .cmp-grid-3 { grid-template-columns: 1fr 1fr; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__side { grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__side .banner__art { display: none; }
  .hero__side .banner__body { width: 100%; }
  .slider { min-height: 380px; }
  .grid-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-authors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .split > aside { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .side-promo { margin-top: 0; min-height: 0; }
  .side-promo .banner__art { display: none; }
  .shop { grid-template-columns: 1fr; }
  .filter-btn { display: inline-flex; }
  .filters {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(340px, 88vw); z-index: 100;
    border-radius: 0; border: 0; overflow-y: auto; display: flex; flex-direction: column;
    transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s;
  }
  .filters__body { flex: 1; }
  .filters__close { display: inline-grid; }
  .filters__foot { position: sticky; bottom: 0; background: #fff; }
  body.filters-open { overflow: hidden; }
  body.filters-open .filters { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  body.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
  .product { grid-template-columns: 1fr; }
  .gallery { position: static; grid-template-columns: 1fr; }
  .gallery__thumbs { flex-direction: row; order: 2; justify-content: center; }
  .gallery__thumbs button { width: 58px; }
  .gallery__main img { width: min(62%, 300px); }
  .rsum { grid-template-columns: 1fr; gap: 18px; }
  body.has-buybar .tabbar { display: none; }
  .buybar {
    display: flex; align-items: center; gap: 12px; position: fixed; bottom: 0; inset-inline: 0; z-index: 70;
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .buybar .price { flex-direction: column; align-items: flex-start; gap: 0; }
  .buybar .btn { flex: 1; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; inset-inline: 0; z-index: 70; height: 64px;
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .05);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .is-active { color: var(--store-primary); }
  .tabbar .hact__badge { top: 6px; inset-inline-start: calc(50% - 22px); }
  .preview-panel { bottom: 76px; }
}

@media (max-width: 575px) {
  :root { --gutter: 14px; }
  body { font-size: 14px; }
  .topbar__promo { font-size: 12px; }
  .topbar__links { display: none; }
  .topbar .container { justify-content: center; }
  .brand img { width: 38px; height: 38px; }
  .brand__name { font-size: 18px; }
  .brand__tag { display: none; }
  .header__actions { gap: 14px; }
  .header__actions .hact--hide-sm { display: none; }
  .sec-head__title { font-size: 19px; }
  .sec-head { flex-wrap: wrap; }
  .grid-books { --cols: 2 !important; gap: 10px; }
  .card { padding: 8px; }
  .card__title { font-size: 14px; }
  .price__now { font-size: 15px; }
  .card__cart { width: 40px; height: 40px; }
  .type-dot { width: 28px; height: 28px; }
  .type-dot svg { width: 14px; height: 14px; }
  .deal { grid-template-columns: 100px 1fr; gap: 12px; padding: 12px; }
  .countdown b { font-size: 16px; }
  .banner { min-height: 170px; padding: 20px; }
  .banner__title { font-size: 19px; }
  .trust__item { flex-direction: column; text-align: center; gap: 8px; padding: 14px 10px; }
  .trust__icon { width: 42px; height: 42px; }
  .trust__title { font-size: 14px; }
  .trust__text { font-size: 12px; }
  .newsletter { padding: 24px 20px; }
  .newsletter__title { font-size: 20px; }
  .newsletter__form { min-width: 0; }
  .newsletter__form .btn { padding-inline: 16px; }
  .footer__top { grid-template-columns: 1fr; gap: 26px; padding-block: 36px 26px; }
  .footer__bottom .container { justify-content: center; text-align: center; }
  .cmp-grid-2, .cmp-grid-3 { grid-template-columns: 1fr; }
  .cmp-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 14px; }
  .slider { min-height: 0; }
  .slide { grid-template-columns: 1fr; padding: 24px 20px 54px; gap: 8px; }
  .slide__art { order: -1; min-height: 190px; }
  .slide__art img { width: 30%; }
  .slide__art img:nth-child(2) { width: 34%; }
  .slide__title { font-size: 26px; }
  .slide__text { font-size: 14px; }
  .slider__dots { inset-inline-start: 20px; bottom: 20px; }
  .slider__arrows { display: none; }
  .hero__side { grid-template-columns: 1fr; gap: 10px; }
  .hero__side .banner { min-height: 0; padding: 14px 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-cats, .grid-authors { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; scrollbar-width: none; }
  .grid-cats > *, .grid-authors > * { flex: 0 0 132px; scroll-snap-align: start; }
  .cat__img { width: 80px; height: 80px; }
  .author__img { width: 92px; height: 92px; }
  .banner--wide { padding: 24px 20px; min-height: 200px; }
  .banner--wide .banner__title { font-size: 22px; }
  .split > aside { grid-template-columns: 1fr; }
  .split .grid-books { --cols: 2 !important; }
  .grid-deals { grid-template-columns: 1fr; }
  .page-head__title { font-size: 24px; }
  .page-head__img { width: 64px; height: 64px; }
  .subcats { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .subcats a { white-space: nowrap; }
  .toolbar__tools { width: 100%; }
  .toolbar .select { flex: 1; min-width: 0; }
  .shop .grid-books { --cols: 2 !important; }
  .product { padding-top: 18px; }
  .gallery__main { padding: 22px; }
  .pinfo__title { font-size: 24px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buybox .btn--primary, .buybox .btn--accent { flex: 1 1 100%; }
  .spec th { width: 45%; }
  .sec-head__tools { width: 100%; justify-content: space-between; min-width: 0; }
  .tabs { flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .tabs button { white-space: nowrap; }
  .link-arrow { white-space: nowrap; }
  .grid-books--row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; scrollbar-width: none; }
  .grid-books--row > .card { flex: 0 0 46%; scroll-snap-align: start; }
  .preview-panel { width: calc(100% - 28px); inset-inline-end: 14px; }
}


@media (max-width: 1199px) {
  .hero-n__title { font-size: 48px; }
  .shopby { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nauthors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nauthors > :nth-child(5) { display: none; }
}
@media (max-width: 991px) {
  .hero-n__grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-n::before { inset-inline-start: 0; width: 100%; top: 58%; transform: skewY(-6deg); }
  .hero-n::after { display: none; }
  .hero-n__art { min-height: 320px; }
  .nauthors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nauthors > :nth-child(n+4) { display: none; }
}
@media (max-width: 575px) {
  :root { --cut: 22px; }
  .hero-n__title { font-size: 36px; }
  .hero-n__text { font-size: 15px; }
  .hero-n__stats { gap: 18px; }
  .hero-n__stats b { font-size: 24px; }
  .hero-n__art { min-height: 260px; }
  .shopby { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nauthors { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .nauthors > * { flex: 0 0 62%; scroll-snap-align: start; display: block !important; }
  .sec-head__title { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   خيارات الإظهار (الملحق، البند 3)
   ========================================================================== */
body[data-show-trust-bar="false"] .trust-section,
body[data-show-reviews="false"] .reviews-section,
body[data-show-reviews="false"] [data-tab-panel="tab-reviews"] { display: none; }

/* البطاقة البسيطة داخل قسم داكن تبقى على خلفيّة بيضاء */
body[data-card-style="minimal"] .section--dark .card { background: #fff; padding: 12px; }

/* ---------- باقات الأسبوع (منطقة bundle_row): بطاقات داكنة كما في المرجع ---------- */
.plan { display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: var(--radius); background: var(--charcoal-2); color: var(--on-dark); border: 1px solid rgba(255, 255, 255, .08); position: relative; }
.plan--hot { background: var(--store-primary); border-color: transparent; color: #fff; }
.plan__name { font-size: 22px; font-weight: 800; color: #fff; }
.plan__covers { display: flex; gap: 8px; }
.plan__covers img { width: 76px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.plan__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.plan__price b { font-size: 32px; font-weight: 800; color: #fff; line-height: 1.1; }
.plan__price del { color: var(--on-dark-muted); }
.plan--hot .plan__price del { color: #fff; }
.plan__save { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.plan__save svg { width: 16px; height: 16px; color: var(--store-accent); flex: none; }
.plan--hot .plan__save svg { color: #fff; }
.plan .btn { margin-top: auto; }
.plan:not(.plan--hot) .btn--light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.plan:not(.plan--hot) .btn--light:hover { border-color: var(--store-accent); color: var(--store-accent); }

/* الخصم حسب الكمّيّة في صفحة الكتاب (book.qty_discount) */
.qty-deal { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--charcoal); background: var(--store-accent); padding: 4px 10px; border-radius: var(--radius-pill); }
.qty-deal .i { width: 15px; height: 15px; }

/* ---------- الأسئلة الشائعة (منطقة faq): مقدّمةٌ وقائمة details كما في المرجع ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 32px; align-items: start; }
.faq__intro p { color: var(--muted); margin-top: 10px; max-width: 40ch; line-height: 1.8; }
.faq__list { display: grid; gap: 10px; }
.faq__item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.faq__item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-weight: 800; font-size: 16px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; transition: transform .25s, background .2s; }
.faq__item summary i svg { width: 16px; height: 16px; }
.faq__item[open] summary i { transform: rotate(45deg); background: var(--store-accent); }
.faq__item p { padding: 0 18px 18px; color: var(--muted); line-height: 1.8; }

@media (max-width: 991px) {
  .faq { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .plan { padding: 22px; }
  .faq__item summary { padding: 14px 14px; font-size: 15px; }
  .faq__item p { padding: 0 14px 16px; }
}

/* تبويبات صفّ الكتب (القاعدة 16): يختفي الشريط إن لم يختر الناشر غير مصدرٍ واحد */
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* شريط الشحن المجّانيّ: يختفي موضعه بلا فراغ حين يُخفيه theme.js */
[data-slot="cart.free_shipping_left"][hidden] { display: none !important; }

/* ==========================================================================
   الإصدار الثاني: أقسامٌ جديدة في الرئيسيّة وصفحات المدوّنة
   ========================================================================== */

/* الواجهة: النصّ لا يتجاوز الشريط المائل */
.hero-n::before { inset-inline-start: 40%; }
.hero-n::after { inset-inline-start: 36.5%; }
.hero-n__grid > div:first-child { max-width: 470px; }

/* وصل حديثًا: دوّارٌ أفقيّ بسهمين، ويُمرَّر باللمس */
.carousel__track.grid-books { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px 6px; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > .card { flex: 0 0 calc((100% - (var(--cols) - 1) * 16px) / var(--cols)); scroll-snap-align: start; }
.sec-head__tools .arrows button[disabled] { opacity: .4; cursor: default; }
.section--surface .arrows button { background: #fff; }

/* الأكثر مبيعًا: عمودٌ فحميّ للتبويبات بجانب صفٍّ واحد */
.bs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.bs__side { display: flex; flex-direction: column; gap: 10px; padding: 18px 12px 12px; border-radius: var(--radius); background: var(--charcoal); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.bs__side::after { content: ""; position: absolute; inset-block-end: -30px; inset-inline-start: 40%; width: 70px; height: 220px; background: var(--store-primary); transform: skewX(-14deg); z-index: -1; opacity: .9; }
.bs__lead { font-size: 13px; font-weight: 800; color: var(--store-accent); padding-inline: 10px; }
.bs__tabs.tabs { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.bs__tabs.tabs button { width: 100%; text-align: start; padding: 11px 14px; border: 0; border-radius: var(--radius-sm); font-size: 15px; font-weight: 800; color: #fff; }
.bs__tabs.tabs button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.bs__tabs.tabs button[aria-selected="true"] { background: var(--store-accent); color: var(--charcoal); }
.bs__more { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(22, 24, 29, .9); border: 1px solid rgba(255, 255, 255, .22); font-weight: 800; font-size: 14px; color: #fff; }
.bs__more:hover { border-color: var(--store-accent); color: var(--store-accent); }
.bs__more svg { width: 16px; height: 16px; }
.bs__side:not(:has([data-repeat="tab"] ~ [role="tab"])) .bs__lead { display: none; }
.bs__grid.grid-books { --cols: 4 !important; }

/* كتاب الأسبوع بعدّادٍ واحد (offer.ends_at) */
.deal-x { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.7fr); gap: 32px; align-items: center; padding: 34px; border-radius: var(--radius); background: var(--store-primary); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.deal-x::before { content: ""; position: absolute; inset-block: 0; inset-inline-end: -6%; width: 46%; background: var(--charcoal); transform: skewX(-14deg); z-index: -1; }
.deal-x::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 39%; width: 14px; background: var(--store-accent); transform: skewX(-14deg); z-index: -1; }
.deal-x__kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--charcoal); background: var(--store-accent); padding: 4px 10px; border-radius: 4px; }
.deal-x__kicker svg { width: 16px; height: 16px; }
.deal-x__heading { font-size: 34px; font-weight: 800; line-height: 1.2; margin-top: 14px; letter-spacing: -.01em; text-wrap: balance; }
.countdown-x { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.countdown-x[hidden] { display: none; }
.countdown-x__label { width: 100%; font-size: 14px; font-weight: 700; }
.countdown-x__unit { min-width: 62px; padding: 8px 6px; border-radius: var(--radius-sm); background: var(--charcoal); text-align: center; line-height: 1.15; }
.countdown-x__unit b { display: block; font-size: 24px; font-weight: 800; color: var(--store-accent); font-variant-numeric: tabular-nums; }
.countdown-x__unit small { font-size: 12px; color: var(--on-dark-muted); }
.deal-x__book { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px 24px; align-items: end; padding: 20px; border-radius: var(--radius); background: #fff; color: var(--store-text); box-shadow: var(--shadow-lg); }
.deal-x__media { position: relative; }
.deal-x__cover { display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 2 / 3; background: var(--surface); }
.deal-x__cover img { width: 100%; height: 100%; object-fit: cover; }
.deal-x__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.deal-x__title { font-size: 26px; font-weight: 800; line-height: 1.25; }
.deal-x__title a:hover, .deal-x__author:hover { color: var(--store-primary); }
.deal-x__author { font-size: 14px; color: var(--muted); }
.deal-x__desc { color: var(--muted); font-size: 14px; line-height: 1.8; margin-top: 4px; }
.deal-x__desc p + p { margin-top: 6px; }
.deal-x__media { grid-row: span 2; }
.deal-x__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; align-self: start; }
.deal-x__buy .price { margin-inline-end: auto; }
.deal-x__wish { width: 52px; height: 52px; border-radius: var(--radius-sm); border: 2px solid var(--line); display: grid; place-items: center; }
.deal-x__wish:hover, .deal-x__wish.is-active { color: var(--danger); border-color: var(--danger); }
.deal-x__wish.is-active svg { fill: currentColor; }

/* آراء القرّاء في الرئيسيّة (reviews.items): بطاقاتٌ على القسم الداكن */
.rcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rcard { margin: 0; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--radius); background: var(--charcoal-2); border: 1px solid rgba(255, 255, 255, .08); }
.rcard .stars svg { width: 18px; height: 18px; }
.rcard blockquote { margin: 0; font-size: 16px; line-height: 1.85; color: var(--on-dark); }
.rcard__by { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.rcard__avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--store-accent); color: var(--charcoal); font-weight: 800; }
.rcard__name { display: block; font-weight: 800; color: #fff; }
.rcard__book { display: block; font-size: 13px; color: var(--store-accent); }

/* المقالات (latest_posts والمدوّنة) */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .25s var(--ease), border-color .25s, transform .25s var(--ease); }
.post-card:hover { box-shadow: var(--shadow); border-color: var(--charcoal); transform: translateY(-3px); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.post-card__date { font-size: 13px; font-weight: 700; color: var(--store-primary-dark); }
.post-card__title { font-size: 19px; font-weight: 800; line-height: 1.4; }
.post-card__title a:hover { color: var(--store-primary); }
.post-card__excerpt { color: var(--muted); font-size: 14px; line-height: 1.8; }
.post-card .link-arrow { margin-top: auto; padding-top: 4px; }

/* البانر العريض بصورةٍ مولَّدة واحدة */
.banner__art--img { inset-block: 0; width: 46%; padding: 0; justify-content: flex-end; }
.banner__art--img img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 70%; border-radius: 0; box-shadow: none; transform: none; }
.banner--wide .banner__art--img img { width: 100%; max-width: none; }
.banner--wide .banner__art--img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, var(--ink-dark), rgba(22, 24, 29, 0) 40%); }
.banner--wide .banner__body { width: 52%; }

@media (max-width: 1199px) {
  .bs { grid-template-columns: 220px minmax(0, 1fr); }
  .bs__grid.grid-books { --cols: 3 !important; }
  .bs__grid > :nth-child(n+4) { display: none; }
  .deal-x { grid-template-columns: 1fr; gap: 22px; }
  .deal-x::before { inset-block: 46% 0; inset-inline-end: -20%; width: 70%; }
  .deal-x::after { display: none; }
}
@media (max-width: 991px) {
  .sec-head__tools .arrows { display: none; }
  .bs { grid-template-columns: 1fr; gap: 14px; }
  .bs__side { flex-direction: row; align-items: center; padding: 8px; }
  .bs__side::after { display: none; }
  .bs__lead { display: none; }
  .bs__tabs.tabs { flex-direction: row; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .bs__tabs.tabs button { width: auto; white-space: nowrap; padding: 9px 14px; font-size: 14px; }
  .bs__more { margin-top: 0; flex: none; padding: 9px 12px; font-size: 13px; }
  .rcards, .posts { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; scrollbar-width: none; }
  .rcards > *, .posts > * { flex: 0 0 min(340px, 78%); scroll-snap-align: start; }
  .banner__art--img { width: 42%; }
}
@media (max-width: 575px) {
  /* شريط الثقة: صفٌّ واحد يُمرَّر بدل أربع خاناتٍ كبيرة */
  .trust-section { padding-block: 14px 4px; }
  .trust { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); }
  .trust__item { flex: 0 0 auto; flex-direction: row; text-align: start; gap: 10px; padding: 10px 14px; scroll-snap-align: start; }
  .trust__item + .trust__item, .trust__item:nth-child(n+3) { border-top: 0; border-inline-start: 1px solid var(--line); }
  .trust__icon { width: 36px; height: 36px; }
  .trust__icon svg { width: 18px; height: 18px; }
  .trust__title { font-size: 13px; white-space: nowrap; }
  .trust__text { font-size: 12px; white-space: nowrap; }
  /* التصنيفات و«تسوّق حسب ما تحبّ»: صفٌّ يُمرَّر */
  .grid-6, .shopby { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; scrollbar-width: none; }
  .grid-6 > * { flex: 0 0 36%; scroll-snap-align: start; }
  .ncat__body { padding: 12px; }
  .ncat__name { font-size: 15px; }
  .shopby > * { flex: 0 0 31%; scroll-snap-align: start; padding: 14px 8px; gap: 8px; }
  .shopby i { width: 48px; height: 48px; border-radius: 12px; }
  .shopby i svg { width: 24px; height: 24px; }
  .shopby span { font-size: 14px; }
  /* الواجهة أقصر في الهاتف */
  .hero-n__grid { gap: 10px; padding-block: 26px 58px; }
  .hero-n__title { font-size: 32px; margin-top: 12px; }
  .hero-n__actions { margin-top: 18px; }
  .hero-n__actions .btn--lg { min-height: 46px; padding-inline: 20px; font-size: 15px; }
  .hero-n__art { min-height: 200px; }
  .hero-n__art img { width: 34%; }
  .hero-n__art img:nth-child(2) { width: 39%; }
  .hero-n__price { bottom: 6px; padding: 8px 12px; }
  .hero-n__price b { font-size: 18px; }
  .carousel__track > .card { flex-basis: 46%; }
  .bs__grid.grid-books { --cols: 2 !important; }
  .bs__grid > :nth-child(4) { display: flex; }
  .bundles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; scrollbar-width: none; }
  .bundles > * { flex: 0 0 84%; scroll-snap-align: start; }
  .deal-x { padding: 20px 16px; }
  .deal-x__heading { font-size: 25px; margin-top: 10px; }
  .countdown-x { margin-top: 14px; gap: 6px; }
  .countdown-x__unit { min-width: 0; flex: 1; }
  .countdown-x__unit b { font-size: 20px; }
  .deal-x__book { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px; align-items: start; }
  .deal-x__title { font-size: 19px; }
  .deal-x__desc p + p { display: none; }
  .deal-x__media { grid-row: auto; }
  .deal-x__buy { grid-column: 1 / -1; gap: 10px; }
  .deal-x__buy .price { width: 100%; }
  .deal-x__buy .btn { flex: 1; }
  .rcard { padding: 20px; }
  .banner--wide { flex-direction: column; align-items: stretch; padding: 0; min-height: 0; }
  .banner--wide .banner__art--img { position: relative; width: 100%; height: 170px; z-index: 0; }
  .banner--wide .banner__art--img::after { background: linear-gradient(to top, var(--ink-dark), rgba(22, 24, 29, 0) 50%); }
  .banner--wide .banner__body { width: 100%; padding: 4px 20px 22px; }
  .newsletter--primary .newsletter__form { min-width: 0; }
}

/* اختيار الصيغة (book.formats): تُخفى القائمة إن لم يكن للعنوان غير صيغةٍ واحدة */
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ [data-preview-copy])) { display: none; }
a.format { color: inherit; }
.rsum__write { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.rsum__write p { font-size: 13px; color: var(--muted); }

/* صفحة التصنيف: العرض شبكةً أو قائمة */
.view-toggle { display: flex; gap: 6px; }
.view-toggle button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--muted); background: #fff; }
.view-toggle button[aria-pressed="true"] { border-color: var(--charcoal); color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }
.grid-books.is-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.grid-books.is-list .card { flex-direction: row; align-items: center; gap: 20px; }
.grid-books.is-list .card__media { width: 118px; flex: none; }
.grid-books.is-list .card__body { padding-top: 0; }
.grid-books.is-list .card__foot { justify-content: flex-start; gap: 24px; margin-top: 6px; }
.banner--wide:has(.banner__art--img) .banner__bg { background: var(--ink-dark); }
@media (max-width: 575px) { .view-toggle { display: none; } }
.cmp-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.section--dark .cmp-note, .section--dark.cmp-block > .container > h2 { color: var(--on-dark-muted); }
.section--dark.cmp-block > .container > h2 code { background: var(--charcoal-2); color: #fff; }

/* المدوّنة والمقال */
.blog-head { background: var(--charcoal); color: #fff; padding-block: 40px 44px; position: relative; overflow: hidden; isolation: isolate; }
.blog-head::before { content: ""; position: absolute; inset-block: 0; inset-inline-end: 8%; width: 140px; background: var(--store-primary); transform: skewX(-14deg); z-index: -1; }
.blog-head::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: calc(8% + 160px); width: 12px; background: var(--store-accent); transform: skewX(-14deg); z-index: -1; }
.blog-head__kicker { display: inline-block; font-size: 13px; font-weight: 800; color: var(--charcoal); background: var(--store-accent); padding: 3px 10px; border-radius: 4px; }
.blog-head__title { font-size: 40px; font-weight: 800; line-height: 1.2; margin-top: 12px; }
.blog-head__text { color: var(--on-dark-muted); margin-top: 8px; max-width: 60ch; }
.blog-pager { margin-top: 30px; }
.article__narrow { max-width: 820px; }
.article__head { padding-block: 34px 22px; }
.article__title { font-size: 38px; font-weight: 800; line-height: 1.25; margin-top: 8px; letter-spacing: -.01em; }
.article__lead { font-size: 18px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.article__media { margin: 0 0 26px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); }
.article__media img { width: 100%; height: 100%; object-fit: cover; }
.article__body { max-width: none; font-size: 17px; }
.article__body h2 { font-size: 24px; font-weight: 800; margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.article__body h2::before { content: ""; width: 8px; height: 22px; border-radius: 2px; background: var(--store-primary); transform: skewX(-12deg); flex: none; }
.article__body blockquote { margin: 4px 0; padding: 18px 22px; border-inline-start: 5px solid var(--store-accent); background: var(--charcoal); color: #fff; border-radius: var(--radius-sm); font-size: 19px; font-weight: 700; line-height: 1.9; }
.article__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-block: 30px 44px; padding-top: 22px; border-top: 1px solid var(--line); }
@media (min-width: 992px) { .posts--blog { row-gap: 24px; } }
@media (max-width: 991px) {
  .posts--blog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; }
}
@media (max-width: 575px) {
  .blog-head { padding-block: 26px 30px; }
  .blog-head__title { font-size: 28px; }
  .blog-head::before { width: 70px; inset-inline-end: -4%; }
  .blog-head::after { inset-inline-end: calc(-4% + 84px); }
  .posts--blog { grid-template-columns: minmax(0, 1fr); }
  .article__head { padding-block: 22px 16px; }
  .article__title { font-size: 27px; }
  .article__lead { font-size: 16px; }
  .article__body { font-size: 16px; }
  .article__body h2 { font-size: 20px; }
  .article__body blockquote { font-size: 17px; padding: 14px 16px; }
}

/* نصّ الرأي: أربعة أسطر على الأكثر، والنصّ الكامل في title (الملحق، البند 5) */
[data-slot="review.text"] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
