/* ==========================================================================
   قالب «دبي» — تنسيق القالب
   الإصدار 1.0.0

   ألوان الهويّة الخمسة وحدها تأتي من المتجر، وقيمها هنا تجريبيّة (أخضر نعناعيّ).
   الخلفيّات الملوّنة الفاتحة تُشتقّ من --store-primary بالخلط مع الأبيض، فتتبع لون كلّ ناشر.
   كلّ لونٍ آخر محايدٌ ثابت، أو لونُ نوع الكتاب، أو ذهبيّ النجوم.
   ========================================================================== */

:root {
  /* ألوان المتجر (يختارها الناشر) */
  --store-primary: #3EB489;
  --store-primary-dark: #1F7A5A;
  --store-accent: #0F3D2E;
  --store-bg: #FFFFFF;
  --store-text: #1C2B26;

  /* درجات فاتحة مشتقّة من لون المتجر */
  --tint-1: color-mix(in srgb, var(--store-primary) 8%, #FFFFFF);
  --tint-2: color-mix(in srgb, var(--store-primary) 16%, #FFFFFF);
  --tint-3: color-mix(in srgb, var(--store-primary) 28%, #FFFFFF);

  /* محايدات ثابتة */
  --n-0: #FFFFFF;
  --n-50: #F7F7F6;
  --n-100: #EFEFED;
  --n-200: #E3E3E0;
  --n-300: #CFCFCB;
  --n-600: #5B616B;
  --on-dark: #FFFFFF;
  --on-dark-muted: #D3DAD7;
  --shadow-soft: 0 6px 24px rgba(16, 24, 20, .06);
  --shadow-hover: 0 16px 36px rgba(16, 24, 20, .12);

  /* ألوان أنواع الكتب (ثابتة في كلّ المتاجر) */
  --type-paper: #DB7056;
  --type-ebook: #5675A3;
  --type-audio: #986AB0;
  --type-edu: #3F8F6B;

  /* النجوم ذهبيّة دائمًا */
  --star: #F2B01E;
  --star-empty: #D9D9D6;

  /* القياسات */
  --font: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --container: 1320px;
  --gutter: 16px;
  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
  --books-per-row: 4;
  --toolbar-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* خيار الزوايا: «مستديرة» افتراضيًّا، و«خفيفة» تقلّل التدوير */
[data-corners="soft"] { --radius-lg: 10px; --radius: 8px; --radius-sm: 6px; --pill: 8px; }

/* خيار عدد الكتب في الصفّ */
[data-books-per-row="3"] { --books-per-row: 3; }
[data-books-per-row="4"] { --books-per-row: 4; }
[data-books-per-row="5"] { --books-per-row: 5; }
[data-books-per-row="6"] { --books-per-row: 6; }

@media (min-width: 768px) { :root { --gutter: 24px; } }

/* --------------------------------------------------------------------------
   الأساس
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7;
  color: var(--store-text); background: var(--store-bg); overflow-x: clip;
}
/* مساحة للشريط السفليّ في الهاتف */
@media (max-width: 1199.98px) { body.has-toolbar { padding-bottom: var(--toolbar-h); } }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; color: var(--store-text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--store-primary-dark); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }
.muted { color: var(--n-600); }

/* --------------------------------------------------------------------------
   الأزرار (كبسوليّة)
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--btn-h); padding: 0 1.6em;
  border: 1.5px solid transparent; border-radius: var(--pill);
  font-weight: 700; font-size: 1rem; line-height: 1; white-space: nowrap; background: transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn .icon { width: 1.15em; height: 1.15em; }
.btn--sm { --btn-h: 40px; padding: 0 1.1em; font-size: .9375rem; }
.btn--lg { --btn-h: 58px; padding: 0 2.1em; font-size: 1.0625rem; }
.btn--block { width: 100%; }
.btn:hover { transform: translateY(-2px); }
/* الأساسيّ: لون المتجر، والنصّ بلون التمييز الداكن ليبقى التباين عاليًا */
.btn--primary { background: var(--store-primary); color: var(--store-accent); }
.btn--primary:hover { background: var(--store-accent); color: var(--on-dark); box-shadow: var(--shadow-soft); }
.btn--dark { background: var(--store-accent); color: var(--on-dark); }
.btn--dark:hover { background: var(--store-primary); color: var(--store-accent); }
.btn--outline { border-color: var(--n-300); color: var(--store-text); background: var(--n-0); }
.btn--outline:hover { border-color: var(--store-primary-dark); color: var(--store-primary-dark); }
.btn--soft { background: var(--tint-2); color: var(--store-accent); }
.btn--soft:hover { background: var(--store-primary); }
.btn--light { background: var(--n-0); color: var(--store-accent); }
.btn--light:hover { background: var(--store-primary); color: var(--store-accent); }
.btn--ghost { color: var(--store-text); padding-inline: .4em; }
.btn--ghost:hover { color: var(--store-primary-dark); transform: none; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--n-100); color: var(--n-600); border-color: var(--n-100); cursor: not-allowed; transform: none; box-shadow: none;
}

/* أزرار الأيقونات الدائريّة */
.icon-btn {
  --s: 44px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); padding: 0; border: 0; border-radius: 50%;
  background: var(--n-100); color: var(--store-text);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
[data-corners="soft"] .icon-btn { border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--store-primary); color: var(--store-accent); }
.icon-btn--sm { --s: 36px; }
.icon-btn--lg { --s: 52px; }
.icon-btn--white { background: var(--n-0); box-shadow: var(--shadow-soft); }
.icon-btn--dark { background: var(--store-accent); color: var(--on-dark); }
.icon-btn--dark:hover { background: var(--store-primary); color: var(--store-accent); }
.icon-btn--outline { background: var(--n-0); border: 1.5px solid var(--n-200); }
.icon-btn[aria-pressed="true"] { background: var(--store-accent); color: var(--on-dark); }
.count {
  position: absolute; inset-block-start: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; font-size: .75rem; font-weight: 800; line-height: 1;
  background: var(--store-primary); color: var(--store-accent); border: 2px solid var(--n-0);
}

/* --------------------------------------------------------------------------
   الرأس
   -------------------------------------------------------------------------- */
/* الصفّ الرئيسيّ مثبّتٌ أعلى الشاشة، ومعه صفّ القائمة في الحاسوب؛ الإعلان والبحث في الهاتف يمرّان */
:root { --hdr-h: 73px; }
@media (min-width: 1200px) { :root { --hdr-h: 154px; } }
.site-header { display: contents; }
.headbar { position: sticky; top: 0; z-index: 51; background: var(--store-bg); }
[id] { scroll-margin-top: calc(var(--hdr-h) + 12px); }

/* شريط الإعلان */
.announce { position: relative; background: var(--store-primary); color: var(--store-accent); font-size: .9375rem; font-weight: 500; }
.announce__inner { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding-inline-end: 40px; text-align: center; }
.announce__close {
  position: absolute; inset-inline-end: var(--gutter); inset-block-start: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--store-accent);
}
.announce__close:hover { background: rgba(255, 255, 255, .35); }
.announce[hidden] { display: none; }

/* الصفّ الرئيسيّ: روابط — الشعار في الوسط — الأيقونات */
.headbar { border-bottom: 1px solid var(--n-100); }
.headbar__inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 72px;
}
@media (min-width: 1200px) { .headbar__inner { min-height: 88px; } }
/* الهاتف واللوحيّ: القائمة والشعار متجاوران يمينًا، والأيقونات عند الحافّة اليسرى */
@media (max-width: 1199.98px) { .headbar__inner { grid-template-columns: auto auto 1fr; } }
.headbar__start { display: flex; align-items: center; gap: 10px; }
.headbar__end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.util { display: none; }
@media (min-width: 1200px) {
  .util { display: flex; align-items: center; gap: 22px; font-size: .9375rem; font-weight: 500; }
  .util a { display: inline-flex; align-items: center; gap: 8px; color: var(--store-text); transition: color .3s; }
  .util a:hover { color: var(--store-primary-dark); }
  .util .icon { color: var(--store-primary-dark); }
  .headbar .menu-btn { display: none; }
}
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: center; }
.brand__logo { width: 42px; height: 42px; object-fit: contain; }
.brand__name { font-size: 1.25rem; font-weight: 800; color: var(--store-text); white-space: nowrap; }
@media (min-width: 768px) { .brand__logo { width: 50px; height: 50px; } .brand__name { font-size: 1.5rem; } }
@media (max-width: 389.98px) { .brand__name { font-size: 1.0625rem; } }
.headbar__end .icon-btn--wish { display: none; }
@media (min-width: 768px) { .headbar__end .icon-btn--wish { display: inline-grid; } }
.headbar__end .search-toggle { display: inline-grid; }
@media (min-width: 1200px) { .headbar__end .search-toggle { display: none; } }

/* صفّ القائمة */
.navbar { display: none; }
@media (min-width: 1200px) {
  .navbar { display: block; border-bottom: 1px solid var(--n-100); position: sticky; top: 89px; z-index: 50; background: var(--store-bg); }
  .navbar__inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
}
.nav__list { display: flex; align-items: center; gap: 4px; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--pill);
  font-weight: 500; color: var(--store-text); transition: background-color .3s, color .3s; white-space: nowrap;
}
.nav__link:hover { background: var(--tint-1); color: var(--store-primary-dark); }
.nav__link[aria-current="page"] { background: var(--tint-2); color: var(--store-accent); font-weight: 700; }
.nav__link .icon { width: 1em; height: 1em; }

/* «كلّ التصنيفات» */
.nav__cats { position: relative; }
.nav__cats-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; white-space: nowrap;
  border: 0; border-radius: var(--pill); background: var(--store-accent); color: var(--on-dark); font-weight: 700;
}
.nav__cats-btn .icon { width: 1.1em; height: 1.1em; }
.nav__menu {
  position: absolute; inset-block-start: calc(100% + 10px); inset-inline-start: 0; min-width: 280px; padding: 10px;
  display: grid; gap: 2px; background: var(--n-0); border-radius: var(--radius); box-shadow: var(--shadow-hover);
  visibility: hidden; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
}
.nav__cats:hover .nav__menu, .nav__cats:focus-within .nav__menu { visibility: visible; opacity: 1; transform: none; transition: opacity .25s, transform .3s var(--ease); }
.nav__menu a {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 500; transition: background-color .25s, color .25s;
}
.nav__menu a:hover { background: var(--tint-1); color: var(--store-primary-dark); }

/* مبدّل الأنواع الكبسوليّ */
.type-switch { display: inline-flex; align-items: center; gap: 4px; padding: 4px; margin-inline-start: auto; border-radius: var(--pill); background: var(--n-100); }
.type-switch a { padding: 7px 14px; border-radius: var(--pill); font-size: .9375rem; font-weight: 500; color: var(--store-text); white-space: nowrap; transition: background-color .25s, color .25s; }
.type-switch a:hover { color: var(--store-primary-dark); }
.type-switch a[aria-current="true"] { background: var(--store-accent); color: var(--on-dark); }
.type-switch--scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0; }
.type-switch--scroll::-webkit-scrollbar { display: none; }

/* البحث الكبسوليّ */
.search {
  display: flex; align-items: center; height: 46px; padding-inline: 6px 18px; gap: 6px;
  background: var(--n-100); border: 1.5px solid transparent; border-radius: var(--pill); transition: border-color .25s, background-color .25s;
}
.search:focus-within { background: var(--n-0); border-color: var(--store-primary); box-shadow: 0 0 0 4px var(--tint-2); }
.search__input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 0; order: 2; }
.search__input::placeholder { color: var(--n-600); }
.search__btn { order: 1; width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--store-primary); color: var(--store-accent); }
.search__btn:hover { background: var(--store-accent); color: var(--on-dark); }
.navbar .search { flex: 1; min-width: 170px; max-width: 260px; }
.mobile-search { padding: 10px var(--gutter) 12px; border-bottom: 1px solid var(--n-100); }
@media (min-width: 1200px) { .mobile-search { display: none; } }
.mobile-search__types { margin-block-start: 10px; }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 30, 24, .45); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.drawer {
  position: fixed; z-index: 100; inset-block: 0; inset-inline-start: 0; width: min(86vw, 360px);
  display: flex; flex-direction: column; background: var(--n-0);
  border-start-end-radius: var(--radius-lg); border-end-end-radius: var(--radius-lg);
  transform: translateX(100%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s;
}
[dir="ltr"] .drawer { transform: translateX(-100%); }
.drawer.is-open { transform: none; visibility: visible; transition: transform .4s var(--ease); }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity .3s; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gutter); border-bottom: 1px solid var(--n-100); }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px var(--gutter) 24px; display: grid; gap: 22px; align-content: start; }
.drawer__title { font-size: .875rem; font-weight: 700; color: var(--n-600); margin-block-end: 6px; }
.drawer__links a { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 500; }
.drawer__links a:hover { background: var(--tint-1); color: var(--store-primary-dark); }
.drawer__links .icon { width: 1em; height: 1em; color: var(--n-600); }
.drawer__contact { display: grid; gap: 8px; }
.drawer__contact a { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.drawer__contact .icon { color: var(--store-primary-dark); }
body.has-drawer { overflow: hidden; }

/* الشريط السفليّ في الهاتف */
.toolbar {
  position: fixed; z-index: 60; inset-inline: 0; inset-block-end: 0; height: var(--toolbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--n-0);
  border-top: 1px solid var(--n-100); box-shadow: 0 -6px 20px rgba(16, 24, 20, .06);
}
@media (min-width: 1200px) { .toolbar { display: none; } }
.toolbar a, .toolbar button {
  position: relative; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; background: transparent;
  font-size: .75rem; font-weight: 500; color: var(--n-600);
}
.toolbar .icon { width: 22px; height: 22px; }
.toolbar [aria-current="page"] { color: var(--store-accent); font-weight: 700; }
.toolbar [aria-current="page"] .icon { color: var(--store-primary-dark); }
.toolbar .count { inset-block-start: 6px; inset-inline-end: calc(50% - 22px); }

/* --------------------------------------------------------------------------
   رؤوس الأقسام
   -------------------------------------------------------------------------- */
.section { padding-block: 40px; }
@media (min-width: 768px) { .section { padding-block: 56px; } }
@media (min-width: 1200px) { .section { padding-block: 72px; } }
.section--flush { padding-block-start: 0; }
.section--tint { background: var(--n-50); }
.section-head { display: grid; justify-items: center; gap: 6px; margin-block-end: 28px; text-align: center; }
.section-title { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem); font-weight: 700; }
.section-sub { color: var(--n-600); max-width: 60ch; }
.section-head--split { grid-template-columns: minmax(0, 1fr) auto; justify-items: start; text-align: start; align-items: end; gap: 6px 16px; }
.section-head--split > div { display: grid; gap: 4px; }
.section-more { text-align: center; margin-block-start: 28px; }
.section-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--store-primary-dark); }
.section-link:hover { color: var(--store-text); }
.section-link .icon { width: 1em; height: 1em; }

/* --------------------------------------------------------------------------
   دائرة نوع الكتاب
   -------------------------------------------------------------------------- */
.type-dot {
  --size: 34px;
  display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex: none;
  border-radius: 50%; color: #FFFFFF; border: 2px solid #FFFFFF; box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}
.type-dot .icon { width: 17px; height: 17px; stroke-width: 2; }
.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); }
.type-dot--lg { --size: 48px; }
.type-dot--lg .icon { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   التقييم والسعر والشارات
   -------------------------------------------------------------------------- */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--n-600); }
.stars {
  --rating: 0; --star-size: 15px;
  display: inline-block; width: calc(var(--star-size) * 5); height: var(--star-size); flex: none;
  background: linear-gradient(to left, var(--star) calc(var(--rating) / 5 * 100%), var(--star-empty) 0);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6 6.6.8-4.9 4.6 1.3 6.5L12 17.3l-5.9 3.2 1.3-6.5L2.5 9.4l6.6-.8z'/%3E%3C/svg%3E") 0 0 / var(--star-size) var(--star-size) repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6 6.6.8-4.9 4.6 1.3 6.5L12 17.3l-5.9 3.2 1.3-6.5L2.5 9.4l6.6-.8z'/%3E%3C/svg%3E") 0 0 / var(--star-size) var(--star-size) repeat-x;
}
[dir="ltr"] .stars { background: linear-gradient(to right, var(--star) calc(var(--rating) / 5 * 100%), var(--star-empty) 0); }
.stars--lg { --star-size: 22px; }

.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price__now { font-weight: 800; font-size: 1.125rem; color: var(--store-text); white-space: nowrap; }
.price__old { font-size: .9375rem; color: var(--n-600); white-space: nowrap; }
.price--lg .price__now { font-size: 1.875rem; }
.price--lg .price__old { font-size: 1.125rem; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: var(--pill);
  font-size: .8125rem; font-weight: 700; line-height: 1; white-space: nowrap;
}
.badge--sale { background: var(--store-accent); color: var(--on-dark); }
.badge--new { background: var(--n-0); color: var(--store-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }

/* --------------------------------------------------------------------------
   بطاقة الكتاب
   -------------------------------------------------------------------------- */
.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 768px) { .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
@media (min-width: 1200px) { .book-grid { grid-template-columns: repeat(var(--books-per-row), minmax(0, 1fr)); gap: 28px; } }

.book-card { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; border-radius: var(--radius); transition: box-shadow .35s var(--ease), background-color .35s; }
.book-card__media {
  position: relative; padding: 26px 26px 22px; border-radius: var(--radius); background: var(--tint-1);
  overflow: hidden; transition: background-color .35s var(--ease);
}
.book-card:hover .book-card__media { background: var(--tint-2); }
.book-card__cover-wrap { position: relative; display: block; width: 78%; margin-inline: auto; }
.book-card__cover {
  position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px 8px 8px 4px;
  box-shadow: 0 14px 26px rgba(16, 24, 20, .22), 0 2px 4px rgba(16, 24, 20, .12);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
[data-corners="soft"] .book-card__cover { border-radius: 3px 5px 5px 3px; }
.book-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card__cover-wrap { transition: transform .45s var(--ease); }
.book-card:hover .book-card__cover-wrap { transform: translateY(-6px) rotate(-1.5deg); }
.book-card:hover .book-card__cover { box-shadow: 0 22px 34px rgba(16, 24, 20, .26), 0 2px 4px rgba(16, 24, 20, .12); }

/* دائرة النوع على ركن الغلاف */
.book-card__type { position: absolute; z-index: 2; inset-block-start: -12px; inset-inline-end: -12px; }

.book-card__badges { position: absolute; z-index: 2; inset-block-start: 12px; inset-inline-start: 12px; display: grid; gap: 6px; justify-items: start; }

/* المفضّلة والنظرة السريعة: تطفوان فوق الغلاف ولا تحجزان مكانًا؛ تظهران عند التحويم، ودائمًا في اللمس */
.book-card__tools {
  position: absolute; z-index: 2; inset-block-end: 12px; inset-inline-end: 12px; display: flex; flex-direction: column; gap: 6px;
}
.book-card__tools .icon-btn { transform: scale(.7); opacity: 0; transition: transform .3s var(--ease), opacity .25s, background-color .3s, color .3s; }
.book-card__tools .icon-btn:nth-child(2) { transition-delay: .04s; }
.book-card:hover .book-card__tools .icon-btn, .book-card__tools .icon-btn:focus-visible, .book-card__tools [aria-pressed="true"] { transform: none; opacity: 1; }
@media (hover: none) { .book-card__tools .icon-btn { transform: none; opacity: 1; } }

.book-card__soldout {
  position: absolute; z-index: 2; inset-inline: 12px; inset-block-end: 12px; padding: 7px 12px; border-radius: var(--pill);
  background: var(--store-accent); color: var(--on-dark); font-weight: 700; font-size: .875rem; text-align: center;
}

.book-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 4px 4px; }
.book-card__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.45; }
.book-card__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .25s; }
.book-card__title a:hover { color: var(--store-primary-dark); }
.book-card__author { font-size: .9375rem; color: var(--n-600); }
.book-card__author a:hover { color: var(--store-primary-dark); }
.book-card__buy { margin-block-start: auto; padding-block-start: 2px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-card__buy .price { gap: 0 8px; min-width: 0; }
.book-card__buy .price__old { font-size: .8125rem; }
.book-card__add { --s: 42px; background: var(--store-primary); color: var(--store-accent); }
.book-card__add:hover { background: var(--store-accent); color: var(--on-dark); }
.book-card__add:disabled { background: var(--n-100); color: var(--n-600); cursor: not-allowed; }

/* شكل البطاقة: «بإطار» */
[data-card-style="bordered"] .book-card { border: 1px solid var(--n-200); background: var(--n-0); padding: 10px; }
[data-card-style="bordered"] .book-card__media { border-radius: calc(var(--radius) - 6px); }
[data-card-style="bordered"] .book-card__body { padding: 12px 6px 6px; }
[data-card-style="bordered"] .book-card:hover { border-color: var(--store-primary); box-shadow: var(--shadow-soft); }

/* حالة نفاد الكمّيّة */
.book-card.is-out .book-card__cover img { filter: grayscale(.85); opacity: .75; }
.book-card.is-out:hover .book-card__cover-wrap { transform: none; }

@media (max-width: 767.98px) {
  .book-card__media { padding: 20px 16px 16px; }
  .book-card__cover-wrap { width: 84%; }
  .book-card__title { font-size: 1rem; }
  .book-card__add { --s: 40px; }
  .type-dot { --size: 30px; }
  .type-dot .icon { width: 15px; height: 15px; }
  .book-card__type { inset-block-start: -10px; inset-inline-end: -10px; }
  .badge { height: 22px; padding: 0 9px; font-size: .75rem; }
}

/* --------------------------------------------------------------------------
   ترقيم الصفحات
   -------------------------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--pill);
  font-weight: 700; background: var(--n-100); transition: background-color .25s, color .25s;
}
.pagination a:hover { background: var(--tint-2); color: var(--store-accent); }
.pagination [aria-current="page"] { background: var(--store-accent); color: var(--on-dark); }
.pagination .is-gap { background: transparent; min-width: 20px; padding: 0; }
.pagination .is-disabled { color: var(--n-600); opacity: .6; }
.pagination .icon { width: 1.1em; height: 1.1em; }

/* --------------------------------------------------------------------------
   رأي القارئ
   -------------------------------------------------------------------------- */
.review { padding: 24px; border-radius: var(--radius); background: var(--n-0); box-shadow: var(--shadow-soft); display: grid; gap: 14px; }
.review__head { display: flex; align-items: center; gap: 12px; }
.review__avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tint-2); color: var(--store-accent); font-weight: 800; }
.review__name { font-weight: 700; }
.review__text { color: var(--n-600); }
.review__quote { margin-inline-start: auto; color: var(--store-primary); }
.review__quote .icon { width: 30px; height: 30px; }

/* --------------------------------------------------------------------------
   التذييل
   -------------------------------------------------------------------------- */
.site-footer { background: var(--n-50); color: var(--n-600); padding-block-start: 48px; }
.footer-news {
  display: grid; gap: 18px; align-items: center; padding: 28px; border-radius: var(--radius-lg); background: var(--tint-2);
}
@media (min-width: 992px) { .footer-news { grid-template-columns: 1fr minmax(0, 480px); padding: 36px 44px; } }
.footer-news h2 { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); color: var(--store-text); }
.footer-news p { margin-block-start: 4px; color: var(--store-text); }
.subscribe { display: flex; align-items: center; gap: 6px; height: 56px; padding: 6px; padding-inline-start: 20px; background: var(--n-0); border-radius: var(--pill); }
.subscribe__input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--store-text); }
.subscribe__input::placeholder { color: var(--n-600); }
.subscribe .btn { --btn-h: 44px; }
.footer-main { display: grid; gap: 28px 20px; padding-block: 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand, .footer-col:last-child { grid-column: 1 / -1; }
@media (min-width: 768px) { .footer-brand, .footer-col:last-child { grid-column: auto; } }
@media (min-width: 768px) { .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .footer-main { grid-template-columns: 1.4fr 1fr 1fr 1.1fr; } }
.footer-brand .brand { justify-self: start; }
.footer-brand p { margin-block-start: 14px; max-width: 36ch; }
.footer-col h3 { color: var(--store-text); font-size: 1.125rem; margin-block-end: 14px; }
.footer-links { display: grid; gap: 2px; }
.footer-links a { display: inline-block; line-height: 2.1; color: var(--n-600); transition: color .25s; }
.footer-links a:hover { color: var(--store-primary-dark); }
.footer-contact { display: grid; gap: 12px; }
.footer-contact a { display: inline-flex; align-items: center; gap: 12px; color: var(--store-text); font-weight: 500; }
.footer-contact a:hover { color: var(--store-primary-dark); }
.footer-contact .icon-box { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--n-0); color: var(--store-primary-dark); box-shadow: var(--shadow-soft); }
[data-corners="soft"] .footer-contact .icon-box { border-radius: var(--radius-sm); }
.footer-bottom { border-top: 1px solid var(--n-200); }
.footer-bottom__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-block: 18px; font-size: .875rem; }
.footer-bottom strong { color: var(--store-text); }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-methods span { display: inline-grid; place-items: center; height: 28px; padding: 0 12px; font-size: .75rem; font-weight: 700; background: var(--n-0); color: var(--store-text); border: 1px solid var(--n-200); border-radius: var(--pill); }

.back-to-top {
  position: fixed; z-index: 40; inset-block-end: 20px; inset-inline-end: 20px; width: 48px; height: 48px;
  display: grid; place-items: center; border-radius: 50%; background: var(--store-accent); color: var(--on-dark);
  box-shadow: var(--shadow-hover); transition: background-color .25s, color .25s;
}
.back-to-top:hover { background: var(--store-primary); color: var(--store-accent); }
@media (max-width: 1199.98px) { .back-to-top { inset-block-end: calc(var(--toolbar-h) + 14px); } }
[data-corners="soft"] .back-to-top { border-radius: var(--radius-sm); }

/* --------------------------------------------------------------------------
   أقسامٌ تُخفى بخيارات الناشر (تقرأ المنصّة data-option)
   -------------------------------------------------------------------------- */
[data-option][hidden], [data-region][hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   السلايدر: بطاقاتٌ مستديرة متجاورة
   -------------------------------------------------------------------------- */
.hero { padding-block: 20px 8px; }
@media (min-width: 1200px) { .hero { padding-block: 28px 8px; } }
.hero__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 88%; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-block-end: 4px;
}
.hero__track::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .hero__track { grid-auto-columns: calc((100% - 14px) / 2); } }
@media (min-width: 1200px) { .hero__track { grid-auto-columns: calc((100% - 48px) / 3); gap: 24px; } }
.slide {
  position: relative; scroll-snap-align: start; min-height: 440px; display: flex; flex-direction: column;
  padding: 26px 24px 24px; border-radius: var(--radius-lg); overflow: hidden; background: var(--tint-2); isolation: isolate;
}
@media (min-width: 1200px) { .slide { min-height: 500px; } }
.slide--b { background: color-mix(in srgb, var(--store-primary) 22%, #FFF6E5); }
.slide--c { background: color-mix(in srgb, var(--store-primary) 18%, #EEF0FA); }
/* الركن المقصوص وزرّ السهم */
.slide__corner {
  position: absolute; z-index: 2; inset-block-start: 0; inset-inline-end: 0; width: 76px; height: 76px;
  background: var(--store-bg); border-end-start-radius: var(--radius-lg);
}
.slide__corner::before, .slide__corner::after {
  content: ""; position: absolute; width: var(--radius-lg); height: var(--radius-lg);
  background: radial-gradient(circle at 0 100%, transparent calc(var(--radius-lg) - .5px), var(--store-bg) var(--radius-lg));
}
.slide__corner::before { inset-block-start: 0; inset-inline-start: calc(-1 * var(--radius-lg)); }
.slide__corner::after { inset-block-end: calc(-1 * var(--radius-lg)); inset-inline-end: 0; }
[dir="rtl"] .slide__corner::before, [dir="rtl"] .slide__corner::after { background: radial-gradient(circle at 100% 100%, transparent calc(var(--radius-lg) - .5px), var(--store-bg) var(--radius-lg)); }
.slide__arrow {
  position: absolute; inset: 10px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--store-primary-dark); color: var(--store-primary-dark); transition: background-color .3s, color .3s;
}
.slide__arrow:hover { background: var(--store-accent); border-color: var(--store-accent); color: var(--on-dark); }
[dir="ltr"] .slide__arrow .icon { transform: scaleX(-1); }
.slide__books { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding-block: 20px 18px; }
.slide__books img { width: 42%; max-width: 170px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: 0 18px 34px rgba(16, 24, 20, .25); }
.slide__books img:first-child { transform: rotate(6deg) translateX(-18%); }
.slide__books img:last-child { transform: rotate(-5deg) translateX(18%); position: relative; z-index: 1; }
[dir="rtl"] .slide__books img:first-child { transform: rotate(-6deg) translateX(18%); }
[dir="rtl"] .slide__books img:last-child { transform: rotate(5deg) translateX(-18%); }
.slide__card {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .78); backdrop-filter: blur(6px);
}
.slide__eyebrow { font-size: .8125rem; font-weight: 700; color: var(--store-accent); }
.slide__title { font-size: 1.375rem; font-weight: 700; color: var(--store-text); }
.slide__title b { font-weight: 800; }
.slide__card .btn { margin-block-start: 6px; }
.hero__dots { display: flex; justify-content: center; gap: 8px; margin-block-start: 16px; }
.slider-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--n-300); transition: width .3s, background-color .3s; }
.slider-dot[aria-current="true"] { width: 28px; border-radius: 999px; background: var(--store-accent); }
@media (max-width: 767.98px) {
  .slide { min-height: 0; padding: 18px 16px 16px; }
  .slide__books { padding-block: 14px 12px; }
  .slide__books img { max-width: 96px; }
  .slide__card { padding: 12px; gap: 4px; }
  .slide__title { font-size: 1.25rem; }
  .hero__dots { margin-block-start: 12px; }
}

/* --------------------------------------------------------------------------
   شريط الثقة
   -------------------------------------------------------------------------- */
.trust { padding-block: 20px; }
.trust__grid { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: 80%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.trust__grid::-webkit-scrollbar { display: none; }
.trust__grid > * { scroll-snap-align: start; }
@media (min-width: 768px) { .trust__grid { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); gap: 12px; overflow: visible; } }
.trust__item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--n-50); }
.trust__icon { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--n-0); color: var(--store-primary-dark); box-shadow: var(--shadow-soft); }
[data-corners="soft"] .trust__icon { border-radius: var(--radius-sm); }
.trust__icon .icon { width: 24px; height: 24px; }
.trust__item h3 { font-size: 1rem; }
.trust__item p { font-size: .875rem; color: var(--n-600); }
@media (max-width: 767.98px) {
  .trust { padding-block: 14px 16px; }
  .trust__grid { grid-auto-columns: 88%; }
  .trust__item { padding: 10px 14px; gap: 12px; line-height: 1.5; }
  .trust__item p { font-size: .8125rem; }
  .trust__icon { width: 40px; height: 40px; }
  .trust__icon .icon { width: 20px; height: 20px; }
}

/* --------------------------------------------------------------------------
   الشريط المتحرّك
   -------------------------------------------------------------------------- */
.marquee { overflow: hidden; padding-block: 14px; background: var(--n-50); border-block: 1px solid var(--n-100); }
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 22px; padding-inline-end: 22px; }
.marquee a { display: inline-flex; align-items: center; gap: 22px; font-weight: 700; font-size: 1.0625rem; white-space: nowrap; color: var(--store-text); }
.marquee a:hover { color: var(--store-primary-dark); }
.marquee__star { color: var(--store-primary-dark); font-size: 1.25rem; line-height: 1; }
@keyframes marquee { to { transform: translateX(50%); } }
[dir="ltr"] .marquee__track { animation-name: marquee-ltr; }
@keyframes marquee-ltr { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* --------------------------------------------------------------------------
   التصنيفات
   -------------------------------------------------------------------------- */
.cat-grid { display: grid; gap: 12px; grid-auto-flow: column; grid-auto-columns: 36%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cat-grid::-webkit-scrollbar { display: none; }
.cat-grid > * { scroll-snap-align: start; }
@media (min-width: 768px) { .cat-grid { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; overflow: visible; } }
.cat-card { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 14px 14px 18px; border-radius: var(--radius-lg); background: var(--n-0); transition: background-color .3s, box-shadow .3s; }
.cat-card:hover { background: var(--tint-1); box-shadow: var(--shadow-soft); }
.cat-card__img { width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; }
.cat-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.cat-card:hover .cat-card__img img { transform: scale(1.06); }
.cat-card__name { font-weight: 700; font-size: 1.0625rem; }
.cat-card__count { font-size: .875rem; color: var(--n-600); }
@media (min-width: 1200px) { .cat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; } .cat-card { padding: 10px 10px 14px; } .cat-card__name { font-size: 1rem; } }
@media (max-width: 767.98px) { .cat-section .section-sub { display: none; } .cat-section .section-head { margin-block-end: 18px; } .cat-grid { grid-auto-columns: 30%; } .cat-card { padding: 6px 6px 10px; gap: 6px; } .cat-card__name { font-size: .9375rem; } .cat-card__count { font-size: .8125rem; } }

/* --------------------------------------------------------------------------
   تبويبات كبسوليّة
   -------------------------------------------------------------------------- */
.tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--n-100); }
.tabs [role="tab"] { border: 0; background: transparent; padding: 8px 18px; border-radius: var(--pill); font-weight: 500; color: var(--store-text); display: inline-flex; align-items: center; gap: 8px; transition: background-color .25s, color .25s; }
.tabs [role="tab"]:hover { color: var(--store-primary-dark); }
.tabs [role="tab"][aria-selected="true"] { background: var(--store-accent); color: var(--on-dark); }
.section-head .tabs { margin-block-start: 8px; }
@media (max-width: 767.98px) {
  .tabs { flex-wrap: nowrap; justify-content: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs [role="tab"] { flex: none; white-space: nowrap; min-height: 40px; }
}

/* --------------------------------------------------------------------------
   البانران (banner_group): الصورة في خانتها بجانب النصّ، لا خلفه
   -------------------------------------------------------------------------- */
.promo-grid { display: grid; gap: 16px; }
@media (min-width: 992px) { .promo-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.promo { display: grid; overflow: hidden; border-radius: var(--radius-lg); background: var(--tint-2); color: var(--store-text); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.promo:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.promo__media { display: block; overflow: hidden; }
.promo__media img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s var(--ease); }
.promo:hover .promo__media img { transform: scale(1.04); }
.promo__body { display: grid; gap: 8px; align-content: center; justify-items: start; padding: 20px 22px 24px; }
.promo__title { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); font-weight: 800; line-height: 1.3; }
.promo__text { color: var(--store-text); max-width: 34ch; }
.promo .btn { margin-block-start: 6px; }
.promo--dark { background: var(--store-accent); }
.promo--dark .promo__title { color: var(--on-dark); }
.promo--dark .promo__text { color: var(--on-dark-muted); }
@media (min-width: 768px) {
  .promo { grid-template-columns: minmax(0, 1fr) 44%; min-height: 260px; }
  .promo__media { order: 2; }
  .promo__media img { aspect-ratio: auto; }
  .promo__body { padding: 28px 30px; }
}

/* --------------------------------------------------------------------------
   كتاب الأسبوع
   -------------------------------------------------------------------------- */
.featured { display: grid; gap: 24px; align-items: center; padding: 20px; border-radius: var(--radius-lg); background: var(--tint-1); }
@media (min-width: 992px) { .featured { grid-template-columns: 5fr 7fr; gap: 48px; padding: 36px; } }
.featured__media { position: relative; display: grid; place-items: center; padding: 36px 24px; border-radius: var(--radius); background: var(--tint-2); }
.featured__media img { width: 62%; max-width: 280px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px 10px 10px 4px; box-shadow: 0 24px 44px rgba(16, 24, 20, .28); }
.featured__media .type-dot { position: absolute; inset-block-start: 18px; inset-inline-end: 18px; }
@media (max-width: 767.98px) { .featured__media { padding: 24px; } .featured__media img { width: 48%; } }
.featured__kicker { display: inline-flex; padding: 4px 14px; border-radius: var(--pill); background: var(--tint-2); color: var(--store-accent); font-weight: 700; font-size: .875rem; }
.featured h3 { margin-block: 10px 6px; font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); }
.featured__author { color: var(--n-600); }
.featured__author a { color: var(--store-text); font-weight: 700; }
.featured__desc { margin-block: 14px; color: var(--n-600); max-width: 60ch; }
.featured__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-block: 4px 0; }

/* --------------------------------------------------------------------------
   المؤلّفون
   -------------------------------------------------------------------------- */
.author-grid { display: grid; gap: 8px; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.author-grid::-webkit-scrollbar { display: none; }
.author-grid > * { scroll-snap-align: start; }
@media (min-width: 768px) { .author-grid { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; overflow: visible; } }
@media (min-width: 1200px) { .author-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.author-card { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 18px 10px; border-radius: var(--radius-lg); transition: background-color .3s; }
.author-card:hover { background: var(--tint-1); }
.author-card img { width: 124px; height: 124px; border-radius: 50%; object-fit: cover; margin-block-end: 8px; outline: 4px solid var(--n-0); box-shadow: 0 0 0 6px var(--tint-2); transition: box-shadow .3s; }
[data-corners="soft"] .author-card img { border-radius: var(--radius); }
.author-card:hover img { box-shadow: 0 0 0 6px var(--store-primary); }
.author-card__name { font-weight: 700; }
.author-card__meta { font-size: .875rem; color: var(--n-600); }
@media (max-width: 767.98px) { .author-card img { width: 104px; height: 104px; } }

/* --------------------------------------------------------------------------
   رأس الصفحات الداخليّة
   -------------------------------------------------------------------------- */
.page-head { padding-block: 20px 8px; }
.page-head__box { position: relative; overflow: hidden; padding: 30px 28px; border-radius: var(--radius-lg); background: var(--tint-2); isolation: isolate; }
@media (min-width: 1200px) { .page-head__box { padding: 44px 48px; } }
.page-head__box::after { content: ""; position: absolute; z-index: -1; inset-block-start: -60px; inset-inline-start: -40px; width: 220px; height: 220px; border-radius: 50%; background: var(--tint-3); }
.page-head h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); }
.page-head p { margin-block-start: 6px; color: var(--store-text); max-width: 60ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .875rem; margin-block-end: 10px; color: var(--n-600); }
.crumbs a:hover { color: var(--store-primary-dark); }
.crumbs .icon { width: .9em; height: .9em; }
.crumbs [aria-current] { color: var(--store-text); font-weight: 700; }

/* --------------------------------------------------------------------------
   صفحة التصنيف
   -------------------------------------------------------------------------- */
.listing { display: grid; gap: 24px; padding-block: 24px 64px; }
@media (min-width: 1200px) { .listing { grid-template-columns: 290px minmax(0, 1fr); gap: 32px; padding-block: 32px 88px; } }
.filters { display: none; }
.filters.is-open { display: block; }
@media (min-width: 1200px) { .filters { display: block; position: sticky; top: calc(var(--hdr-h) + 16px); align-self: start; } .filters-toggle { display: none !important; } }
.filter-card { padding: 20px; border-radius: var(--radius-lg); background: var(--n-50); display: grid; gap: 22px; }
.filter-group h2 { font-size: 1rem; margin-block-end: 10px; }
.filter-group__body { display: grid; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9375rem; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--store-primary-dark); flex: none; }
.check .type-dot { --size: 24px; border-width: 1px; box-shadow: none; }
.check .type-dot .icon { width: 12px; height: 12px; }
.check__count { margin-inline-start: auto; min-width: 30px; padding: 0 8px; text-align: center; font-size: .75rem; color: var(--n-600); background: var(--n-0); border-radius: var(--pill); }
.range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.field { width: 100%; height: 46px; padding: 0 16px; border: 1.5px solid var(--n-200); border-radius: var(--pill); background: var(--n-0); }
.field:focus { outline: none; border-color: var(--store-primary); box-shadow: 0 0 0 4px var(--tint-2); }
select.field { padding-inline-end: 40px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B616B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: left 16px center; }
[dir="ltr"] select.field { background-position: right 16px center; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 16px; }
.toolbar-row__count { color: var(--n-600); }
.toolbar-row__count b { color: var(--store-text); }
.toolbar-row__end { display: flex; align-items: center; gap: 10px; }
.toolbar-row select.field { width: auto; min-width: 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--pill); background: var(--tint-2); color: var(--store-accent); font-size: .875rem; font-weight: 700; }
.chip .icon { width: 14px; height: 14px; }
.chip--ghost { background: transparent; color: var(--n-600); text-decoration: underline; }
@media (min-width: 1200px) { .listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.subcats { display: grid; gap: 2px; }
.subcats a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: .9375rem; font-weight: 500; transition: background-color .25s, color .25s; }
.subcats a:hover { background: var(--n-0); color: var(--store-primary-dark); }
.subcats a[aria-current="true"] { background: var(--n-0); color: var(--store-accent); font-weight: 700; }
.subcats .check__count { margin-inline-start: 0; }
.view-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--pill); background: var(--n-100); }
.view-switch button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--n-600); }
.view-switch button[aria-pressed="true"] { background: var(--store-accent); color: var(--on-dark); }
/* عرض القائمة */
.book-grid.is-list { grid-template-columns: 1fr !important; gap: 14px; }
.book-grid.is-list .book-card { flex-direction: row; align-items: stretch; gap: 18px; padding: 10px; border-radius: var(--radius-lg); background: var(--n-0); border: 1px solid var(--n-100); }
.book-grid.is-list .book-card__media { flex: none; width: 150px; padding: 16px 18px 14px; }
.book-grid.is-list .book-card__cover-wrap { width: 100%; }
.book-grid.is-list .book-card__body { padding: 8px 4px; justify-content: center; }
.book-grid.is-list .book-card__buy { margin-block-start: 6px; justify-content: flex-start; gap: 20px; }
@media (max-width: 767.98px) { .book-grid.is-list .book-card__media { width: 112px; padding: 12px; } .view-switch button { width: 36px; height: 36px; } }
.listing .pagination { margin-block-start: 40px; }

/* --------------------------------------------------------------------------
   صفحة الكتاب
   -------------------------------------------------------------------------- */
.product { display: grid; gap: 28px; padding-block: 20px 48px; }
@media (min-width: 992px) { .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding-block: 28px 64px; } }
.product__gallery { display: grid; gap: 12px; align-self: start; }
@media (min-width: 992px) { .product__gallery { position: sticky; top: calc(var(--hdr-h) + 20px); } }
.product__media { position: relative; display: grid; place-items: center; padding: 36px 28px; border-radius: var(--radius-lg); background: var(--tint-2); overflow: hidden; isolation: isolate; }
@media (min-width: 992px) { .product__media { padding: 56px 40px; } }
.product__thumbs { display: flex; justify-content: center; gap: 10px; }
.product__thumbs button { width: 64px; padding: 6px; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--n-50); transition: border-color .25s; }
.product__thumbs button[aria-current="true"] { border-color: var(--store-primary-dark); background: var(--tint-1); }
.product__thumbs img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.product__media::before { content: ""; position: absolute; z-index: -1; inset-block-end: -80px; inset-inline-start: -60px; width: 280px; height: 280px; border-radius: 50%; background: var(--tint-3); }
.product__cover { position: relative; width: 62%; max-width: 300px; }
@media (max-width: 767.98px) { .product__cover { width: 52%; } }
.product__cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px 12px 12px 4px; box-shadow: 0 28px 50px rgba(16, 24, 20, .3); }
.product__cover .type-dot { position: absolute; inset-block-start: -18px; inset-inline-end: -18px; }
.product__media .badge { position: absolute; inset-block-start: 18px; inset-inline-start: 18px; }
.product__type { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: var(--pill); background: var(--n-100); font-size: .875rem; font-weight: 700; }
[dir="rtl"] .product__type { padding: 4px 4px 4px 14px; }
.product__type .type-dot { --size: 26px; border-width: 1px; box-shadow: none; }
.product__type .type-dot .icon { width: 13px; height: 13px; }
.product__title { margin-block: 14px 6px; font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); font-weight: 800; }
.product__author { color: var(--n-600); font-size: 1.0625rem; }
.product__author a { color: var(--store-primary-dark); font-weight: 700; }
.product__author a:hover { text-decoration: underline; }
.product__rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 12px 18px; }
.product__rating a { font-size: .875rem; color: var(--n-600); text-decoration: underline; }
.product__price { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.product__summary { margin-block: 16px; color: var(--n-600); }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 18px; }
.facts .fact { flex: 1 1 auto; }
.fact { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--radius); background: var(--n-50); }
.fact__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--n-0); color: var(--store-primary-dark); }
.fact__icon .icon { width: 18px; height: 18px; }
.fact__label { display: block; font-size: .75rem; color: var(--n-600); }
.fact__value { display: block; font-weight: 700; }
.fact--hl { background: var(--tint-2); }
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 20px 16px; }
.buy .btn { min-width: 0; padding-inline: 1.2em; }
.buy [data-action="add-to-cart"] { flex: 1 1 150px; }
.buy [data-action="buy-now"] { flex: 1 1 100%; }
.buy--sample [data-action="add-to-cart"] { flex: 1 1 calc(100% - 72px); }
.buy--sample [data-action="buy-now"], .buy--sample [data-action="read-sample"] { flex: 1 1 150px; }
.buy .qty { height: 58px; }
.buy .qty button { width: 48px; height: 48px; }
@media (max-width: 767.98px) {
  .buy [data-action="add-to-cart"] { flex-basis: 120px; }
  .buy .btn--lg { --btn-h: 54px; font-size: 1rem; }
  .buy .qty { height: 54px; }
  .buy .qty button { width: 40px; height: 40px; }
  .buy .qty input { width: 34px; }
  .format { flex: 1 1 auto; }
}

/* اختيار الصيغة (book.formats) */
.formats { display: grid; gap: 8px; margin-block: 16px 4px; }
.formats__label { font-size: .875rem; font-weight: 700; color: var(--n-600); }
.formats__list { display: flex; flex-wrap: wrap; gap: 8px; }
.format { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1.5px solid var(--n-200); border-radius: var(--pill); background: var(--n-0); transition: border-color .25s, background-color .25s; }
[dir="rtl"] .format { padding: 8px 8px 8px 14px; }
.format:hover { border-color: var(--store-primary-dark); }
.format.is-current { border-color: var(--store-accent); background: var(--tint-1); }
.format .type-dot { --size: 28px; border-width: 1px; box-shadow: none; }
.format .type-dot .icon { width: 14px; height: 14px; }
.format__name { font-weight: 700; }
.format__price { font-size: .875rem; color: var(--n-600); white-space: nowrap; }

/* صندوق التوصيل والدفع */
.ship-box { display: grid; gap: 0; padding: 4px 16px; border-radius: var(--radius); background: var(--n-50); }
.ship-box li { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.ship-box li + li { border-top: 1px solid var(--n-200); }
.ship-box__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--n-0); color: var(--store-primary-dark); }
.ship-box__icon .icon { width: 18px; height: 18px; }
.ship-box b { display: block; font-size: .9375rem; }
.ship-box small { display: block; font-size: .8125rem; color: var(--n-600); }
.qty { display: inline-flex; align-items: center; gap: 4px; height: 50px; padding: 4px; border-radius: var(--pill); background: var(--n-100); flex: none; }
.qty button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--n-0); font-size: 1.2rem; font-weight: 700; box-shadow: var(--shadow-soft); }
.qty button:hover { background: var(--store-primary); color: var(--store-accent); }
.qty input { width: 44px; border: 0; text-align: center; font-weight: 800; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.player { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; margin-block: 18px; border-radius: var(--pill); background: var(--store-accent); color: var(--on-dark); }
.player__btn { width: 48px; height: 48px; flex: none; border: 0; display: grid; place-items: center; background: var(--store-primary); color: var(--store-accent); border-radius: 50%; }
.player__btn:hover { background: var(--n-0); }
.player__btn .icon { width: 20px; height: 20px; }
.player__main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.player__title { font-weight: 700; font-size: .9375rem; }
.player__bar { position: relative; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.player__bar span { position: absolute; inset-block: 0; inset-inline-start: 0; width: 28%; background: var(--store-primary); border-radius: 999px; }
.player__time { display: flex; justify-content: space-between; font-size: .75rem; color: var(--on-dark-muted); }

/* تبويبات التفاصيل */
.details { padding-block-end: 56px; }
.details__tabs { display: flex; justify-content: center; margin-block-end: 22px; }
.details__panel { padding: 24px; border-radius: var(--radius-lg); background: var(--n-50); }
@media (min-width: 992px) { .details__panel { padding: 36px; } }
.details__panel > * + * { margin-block-start: 14px; }
.details__panel p { color: var(--n-600); max-width: 80ch; }
.spec { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: .9375rem; }
.spec th, .spec td { padding: 12px 16px; text-align: start; background: var(--n-0); }
.spec th { width: 34%; color: var(--n-600); font-weight: 500; border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); }
.spec td { font-weight: 700; border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.rating-sum { display: grid; gap: 18px; align-items: center; padding: 20px; border-radius: var(--radius); background: var(--n-0); }
@media (min-width: 768px) { .rating-sum { grid-template-columns: auto 1fr; gap: 36px; } }
.rating-sum__big { text-align: center; display: grid; justify-items: center; gap: 4px; }
.rating-sum__big b { font-size: 3rem; line-height: 1; }
.bars { display: grid; gap: 6px; font-size: .8125rem; }
.bars div { display: grid; grid-template-columns: 56px 1fr 38px; align-items: center; gap: 10px; }
.bars span:nth-child(2) { height: 8px; border-radius: 999px; background: var(--n-100); position: relative; overflow: hidden; }
.bars i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--star); border-radius: 999px; }
.review-list { display: grid; gap: 14px; }
@media (min-width: 992px) { .review-list { grid-template-columns: 1fr 1fr; } }
.review__date { font-size: .8125rem; color: var(--n-600); }

/* --------------------------------------------------------------------------
   صفحة المؤلّف
   -------------------------------------------------------------------------- */
.author-hero { padding-block: 20px 8px; }
.author-hero__box { display: grid; gap: 24px; align-items: center; justify-items: center; text-align: center; padding: 32px 24px; border-radius: var(--radius-lg); background: var(--tint-2); }
@media (min-width: 992px) { .author-hero__box { grid-template-columns: auto 1fr; justify-items: start; text-align: start; gap: 44px; padding: 44px 48px; } }
.author-hero__photo { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; outline: 8px solid var(--n-0); }
[data-corners="soft"] .author-hero__photo { border-radius: var(--radius); }
.author-hero h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin-block: 8px; }
.author-hero__bio { display: grid; gap: 10px; max-width: 72ch; color: var(--store-text); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 18px; justify-content: center; }
@media (min-width: 992px) { .stats { justify-content: flex-start; } }
.stat { padding: 10px 18px; border-radius: var(--radius); background: var(--n-0); text-align: center; }
.stat b { display: block; font-size: 1.375rem; }
.stat span { font-size: .8125rem; color: var(--n-600); }

/* --------------------------------------------------------------------------
   السلّة
   -------------------------------------------------------------------------- */
.cart { display: grid; gap: 24px; padding-block: 24px 72px; }
@media (min-width: 1200px) { .cart { grid-template-columns: minmax(0, 1fr) 390px; align-items: start; gap: 32px; } }
.cart-list { display: grid; gap: 12px; }
.cart-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px 18px; align-items: center; padding: 14px; border-radius: var(--radius-lg); background: var(--n-50); }
@media (min-width: 768px) { .cart-row { grid-template-columns: 96px minmax(0, 1fr) auto auto auto; padding: 16px 20px; } }
.cart-row__cover { position: relative; padding: 10px; border-radius: var(--radius); background: var(--tint-2); grid-row: span 2; }
@media (min-width: 768px) { .cart-row__cover { grid-row: auto; } }
.cart-row__cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 2px 5px 5px 2px; box-shadow: 0 6px 14px rgba(16, 24, 20, .2); }
.cart-row__cover .type-dot { position: absolute; inset-block-start: -6px; inset-inline-end: -6px; --size: 24px; border-width: 1px; }
.cart-row__cover .type-dot .icon { width: 12px; height: 12px; }
.cart-row__title { font-weight: 700; }
.cart-row__title a:hover { color: var(--store-primary-dark); }
.cart-row__author { font-size: .875rem; color: var(--n-600); }
.cart-row__info .price { margin-block-start: 4px; }
.cart-row__controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (min-width: 768px) { .cart-row__controls { display: contents; } }
.cart-row .qty { height: 44px; }
.cart-row .qty button { width: 36px; height: 36px; }
.line-total { font-weight: 800; white-space: nowrap; }
.cart-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 16px; }
.cart-actions__end { display: flex; flex-wrap: wrap; gap: 8px; }
.coupon { display: flex; align-items: center; gap: 6px; height: 54px; padding: 5px; padding-inline-start: 18px; border-radius: var(--pill); background: var(--n-100); flex: 1 1 320px; max-width: 460px; }
.coupon input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; }
.coupon .btn { --btn-h: 44px; }
.summary { padding: 22px; border-radius: var(--radius-lg); background: var(--n-0); box-shadow: var(--shadow-soft); display: grid; gap: 12px; }
@media (min-width: 1200px) { .summary { position: sticky; top: calc(var(--hdr-h) + 20px); } }
.summary h2 { font-size: 1.25rem; margin-block-end: 4px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; color: var(--n-600); }
.summary__row b { color: var(--store-text); white-space: nowrap; }
.summary__row--total { padding-block-start: 14px; border-top: 1px dashed var(--n-300); color: var(--store-text); font-weight: 800; font-size: 1.125rem; }
.summary__row--total b { font-size: 1.5rem; }
.coupon-applied { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 14px; border-radius: var(--pill); background: var(--tint-2); color: var(--store-accent); font-size: .875rem; }
[dir="rtl"] .coupon-applied { padding: 6px 14px 6px 6px; }
.coupon-applied > span { display: inline-flex; align-items: center; gap: 6px; }
.coupon-applied .icon { width: 1em; height: 1em; }
.coupon-applied b { direction: ltr; unicode-bidi: isolate; }
.coupon-applied__remove { width: 30px; height: 30px; border: 0; display: grid; place-items: center; border-radius: 50%; background: var(--n-0); color: var(--store-accent); }
.coupon-applied__remove:hover { background: var(--store-accent); color: var(--on-dark); }
.summary__note { display: flex; gap: 8px; font-size: .8125rem; color: var(--n-600); }
.summary__note .icon { color: var(--store-primary-dark); flex: none; margin-block-start: 3px; }

/* --------------------------------------------------------------------------
   صفحة 404
   -------------------------------------------------------------------------- */
.notfound { padding-block: 40px 56px; }
.notfound__box { position: relative; overflow: hidden; isolation: isolate; display: grid; justify-items: center; gap: 12px; text-align: center; padding: 48px 24px; border-radius: var(--radius-lg); background: var(--tint-1); }
.notfound__box::before { content: ""; position: absolute; z-index: -1; inset-block-start: -90px; inset-inline-end: -60px; width: 300px; height: 300px; border-radius: 50%; background: var(--tint-2); }
.notfound__code { display: flex; align-items: center; gap: 8px; font-size: clamp(5rem, 3rem + 9vw, 9rem); font-weight: 800; line-height: 1; color: var(--store-accent); }
.notfound__code span { display: grid; place-items: center; width: .9em; height: .9em; border-radius: 50%; background: var(--store-primary); color: var(--store-accent); }
.notfound h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem); }
.notfound p { color: var(--n-600); max-width: 52ch; }
.notfound .search { width: 100%; max-width: 520px; height: 54px; margin-block: 10px 6px; background: var(--n-0); }
.notfound__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* --------------------------------------------------------------------------
   صفحة المكوّنات (للمراجعة فقط)
   -------------------------------------------------------------------------- */
.cmp-page { background: var(--n-50); }
.cmp-intro { padding-block: 40px 8px; }
.cmp-intro .kicker { display: inline-flex; padding: 4px 14px; border-radius: var(--pill); background: var(--tint-2); color: var(--store-accent); font-weight: 700; font-size: .875rem; }
.cmp-intro h1 { margin-block-start: 10px; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
.cmp-intro p { margin-block-start: 8px; color: var(--n-600); max-width: 70ch; }
.cmp-block { margin-block: 24px; padding: 24px var(--gutter); background: var(--n-0); border-radius: var(--radius-lg); }
@media (min-width: 768px) { .cmp-block { padding: 32px; } }
.cmp-block > h2 { font-size: 1.375rem; margin-block-end: 4px; }
.cmp-block > p { color: var(--n-600); margin-block-end: 22px; }
.cmp-label { display: block; margin-block: 20px 10px; font-size: .875rem; font-weight: 700; color: var(--n-600); }
.cmp-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cmp-dark { padding: 20px; background: var(--store-accent); border-radius: var(--radius); }
.cmp-swatches { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.cmp-swatch { border: 1px solid var(--n-200); border-radius: var(--radius); overflow: hidden; background: var(--n-0); }
.cmp-swatch__chip { height: 64px; }
.cmp-swatch__info { padding: 8px 12px; font-size: .8125rem; }
.cmp-swatch__info b { display: block; font-size: .875rem; }
.cmp-swatch__info code { font-size: .75rem; white-space: nowrap; direction: ltr; unicode-bidi: isolate; color: var(--n-600); }
.cmp-types { display: flex; flex-wrap: wrap; gap: 20px; }
.cmp-types > div { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.cmp-states { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .cmp-states { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; } }
.cmp-states > div { display: flex; flex-direction: column; }
.cmp-states .book-card, .cmp-variant .book-card { height: auto; flex: 1; }
.cmp-state-label { display: block; margin-block-end: 18px; font-size: .8125rem; font-weight: 700; color: var(--n-600); }
.cmp-variant { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.cmp-reviews { display: grid; gap: 24px; }
@media (min-width: 768px) { .cmp-reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cmp-reviews .review { background: var(--n-50); box-shadow: none; }

/* خيارات الإظهار (الملحق، البند 3) */
body[data-show-announcement="false"] .announce,
body[data-show-trust-bar="false"] .trust,
body[data-show-mobile-toolbar="false"] .toolbar,
body[data-show-reviews="false"] .reviews-home { display: none; }
@media (max-width: 1199.98px) { body.has-toolbar[data-show-mobile-toolbar="false"] { padding-bottom: 0; } }
@media (max-width: 1199.98px) { body[data-show-mobile-toolbar="false"] .back-to-top { inset-block-end: 20px; } }

/* ================= ميزات المنصّة المعتمدة (SPEC، الملحق 8) ================= */

/* الأسئلة الشائعة */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; align-items: start; }
.faq__head { display: grid; gap: 8px; }
.faq__list { display: grid; gap: 12px; }
.faq-item { background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.faq-item[open] { border-color: var(--tint-3); box-shadow: var(--shadow-soft); }
.faq-item summary { position: relative; list-style: none; cursor: pointer; padding: 18px 22px; padding-inline-end: 60px; font-weight: 700; font-size: 1.05rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; inset-inline-end: 20px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
  background: var(--tint-2) linear-gradient(var(--store-accent), var(--store-accent)) center / 12px 2px no-repeat;
}
.faq-item:not([open]) summary::after {
  background-image: linear-gradient(var(--store-accent), var(--store-accent)), linear-gradient(var(--store-accent), var(--store-accent));
  background-size: 12px 2px, 2px 12px; background-position: center; background-repeat: no-repeat;
}
.faq-item__answer { padding: 0 22px 20px; color: var(--n-600); }
@media (max-width: 900px) { .faq { grid-template-columns: 1fr; gap: 24px; } }

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

/* ================= أقسام الرئيسيّة الإضافيّة ================= */

/* عروض الأسبوع: إطارٌ بلون المتجر الفاتح، وعدّادٌ واحد، ودوّارٌ أفقيّ */
.deals__frame { padding: 22px 16px 24px; border-radius: var(--radius-lg); background: var(--tint-2); }
@media (min-width: 768px) { .deals__frame { padding: 32px; } }
.deals__head { display: grid; gap: 14px; margin-block-end: 22px; }
@media (min-width: 992px) { .deals__head { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 24px; } }
.deals__head > div:first-child { display: grid; gap: 4px; justify-items: start; }
.deals__kicker { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--pill); background: var(--n-0); color: var(--store-accent); font-size: .8125rem; font-weight: 800; }
.deals__kicker .icon { width: 1.05em; height: 1.05em; }
.deals .section-sub { color: var(--store-text); }
.deals__nav, .section-head--split > .deals__nav { display: none; gap: 8px; }
@media (min-width: 992px) { .deals__nav, .section-head--split > .deals__nav { display: flex; } }
.countdown { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.countdown[hidden] { display: none; }
.countdown__label { font-weight: 700; color: var(--store-accent); margin-inline-end: 4px; }
.countdown__unit { display: grid; justify-items: center; min-width: 54px; padding: 6px 6px 5px; border-radius: var(--radius-sm); background: var(--store-accent); color: var(--on-dark); line-height: 1.15; }
.countdown__unit b { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown__unit small { font-size: .6875rem; color: var(--on-dark-muted); }
.book-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.book-rail::-webkit-scrollbar { display: none; }
.book-rail > * { scroll-snap-align: start; }
@media (min-width: 768px) { .book-rail { grid-auto-columns: calc((100% - 40px) / 3); gap: 20px; } }
@media (min-width: 1200px) { .book-rail { grid-auto-columns: calc((100% - 72px) / 4); gap: 24px; } }
.deals .book-card__media { background: var(--n-0); }
.deals .book-card:hover .book-card__media { background: var(--tint-1); }
[data-card-style="bordered"] .deals .book-card { border-color: transparent; }

/* الأكثر مبيعًا: قائمةٌ مرقّمة مدمجة */
.mini-list { display: grid; gap: 12px; }
.mini-list--ranked { counter-reset: rank; }
@media (min-width: 768px) { .mini-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1200px) { .mini-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.mini-book { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; border-radius: var(--radius-lg); background: var(--n-0); transition: box-shadow .3s var(--ease); }
.mini-list--ranked .mini-book { counter-increment: rank; }
.mini-book:hover { box-shadow: var(--shadow-soft); }
.mini-list--ranked .mini-book::before { content: counter(rank); position: absolute; inset-block-start: 10px; inset-inline-end: 16px; font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--tint-3); }
.mini-book__cover { position: relative; display: block; padding: 10px 12px; border-radius: var(--radius); background: var(--tint-1); }
.mini-book__cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 5px 5px 2px; box-shadow: 0 8px 16px rgba(16, 24, 20, .2); transition: transform .4s var(--ease); }
.mini-book:hover .mini-book__cover img { transform: translateY(-3px) rotate(-1.5deg); }
.mini-book__cover .type-dot { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; --size: 24px; border-width: 1px; }
.mini-book__cover .type-dot .icon { width: 12px; height: 12px; }
.mini-book__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini-book__title { font-size: 1rem; font-weight: 700; line-height: 1.45; }
.mini-list--ranked .mini-book__title { padding-inline-end: 30px; }
.mini-book__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-book__title a:hover { color: var(--store-primary-dark); }
.mini-book__author { font-size: .875rem; color: var(--n-600); }
.mini-book__author a:hover { color: var(--store-primary-dark); }
.mini-book__buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-start: 4px; }
.mini-book__buy .price { gap: 0 8px; }
.mini-book__buy .price__old { font-size: .8125rem; }
.mini-book .book-card__add { --s: 40px; }
@media (min-width: 1200px) { .mini-list--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .mini-list--4 { grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .mini-list--4::-webkit-scrollbar { display: none; }
  .mini-list--4 > * { scroll-snap-align: start; }
}
.section-title--sm { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.625rem); }
@media (max-width: 767.98px) { .mini-book { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 10px; } .mini-book__cover { padding: 8px; } }

/* آراء القرّاء في الرئيسيّة (خيار show_reviews) */
.store-score { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--pill); background: var(--tint-2); }
.store-score b { font-size: 1.25rem; color: var(--store-accent); }
@media (max-width: 767.98px) { .reviews-home .section-head--split { grid-template-columns: 1fr; } }
.review-row { display: grid; gap: 14px; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.review-row::-webkit-scrollbar { display: none; }
.review-row > * { scroll-snap-align: start; }
@media (min-width: 768px) { .review-row { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; overflow: visible; } }
.reviews-home .review { background: var(--tint-1); box-shadow: none; align-content: start; }
.reviews-home .review__text { color: var(--store-text); font-size: 1.0625rem; }
.reviews-home .review__avatar { width: 44px; height: 44px; background: var(--n-0); }
.review__book { font-size: .8125rem; color: var(--n-600); }

/* من المدوّنة */
.post-grid { display: grid; gap: 14px; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.post-grid::-webkit-scrollbar { display: none; }
.post-grid > * { scroll-snap-align: start; }
@media (min-width: 768px) { .post-grid { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; overflow: visible; } }
.post-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: var(--n-0); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.post-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.post-card__media { display: block; overflow: hidden; }
.post-card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { display: grid; gap: 6px; padding: 16px 20px 22px; }
.post-card__date { font-size: .8125rem; font-weight: 700; color: var(--store-primary-dark); }
.post-card__title { font-size: 1.125rem; line-height: 1.5; }
.post-card__title a:hover { color: var(--store-primary-dark); }
.post-card__excerpt { color: var(--n-600); font-size: .9375rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* المدوّنة والمقال */
.blog { padding-block: 24px 64px; }
.post-grid--page { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; overflow: visible; gap: 20px; margin-block-end: 40px; }
@media (min-width: 768px) { .post-grid--page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .post-grid--page { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }
.blog .post-card { background: var(--n-50); }
.post { max-width: 820px; padding-block: 20px 56px; }
.post__head { display: grid; gap: 8px; margin-block-end: 22px; }
.post__title { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); font-weight: 800; line-height: 1.3; }
.post__lead { font-size: 1.125rem; color: var(--n-600); }
.post__cover { margin: 0 0 28px; border-radius: var(--radius-lg); overflow: hidden; }
.post__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post__body { font-size: 1.0625rem; line-height: 1.95; }
.post__body > * + * { margin-block-start: 16px; }
.post__body h2 { font-size: 1.375rem; margin-block-start: 30px; }
.post__body ol { list-style: decimal; padding-inline-start: 1.4em; display: grid; gap: 8px; }
.post__body a { color: var(--store-primary-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.post__body blockquote { margin-inline: 0; padding: 18px 22px; border-inline-start: 4px solid var(--store-primary); border-radius: var(--radius-sm); background: var(--tint-1); font-weight: 700; }
.post__back { margin-block-start: 32px; }

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