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

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

:root {
  /* ألوان المتجر (يختارها الناشر) */
  --store-primary: #F68A0A;
  --store-primary-dark: #A85A00;
  --store-accent: #0E121D;
  --store-bg: #FFFFFF;
  --store-text: #1F2430;

  /* محايدات ثابتة */
  --n-0: #FFFFFF;
  --n-50: #F7F7F6;
  --n-100: #EFEFED;
  --n-200: #E2E2DF;
  --n-300: #CFCFCB;
  --n-600: #5B616B;
  --on-dark: #FFFFFF;
  --on-dark-muted: #C9CCD3;
  --shadow-soft: 0 0 30px rgba(0, 0, 0, .08);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, .14);

  /* ألوان أنواع الكتب (ثابتة في كلّ المتاجر) */
  --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: 0px;
  --radius-sm: 0px;
  --books-per-row: 4;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* خيار الزوايا */
[data-corners="soft"] { --radius: 12px; --radius-sm: 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; --header-h: 84px; } }
@media (min-width: 1200px) { :root { --header-h: 92px; } }

/* --------------------------------------------------------------------------
   الأساس
   -------------------------------------------------------------------------- */
*, *::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; }
}
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;
}
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.3; font-weight: 800; 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: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--btn-h); padding: 0 1.5em;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 1rem; line-height: 1; white-space: nowrap;
  background: transparent; transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease), box-shadow .4s 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: 56px; padding: 0 2em; font-size: 1.0625rem; }
.btn--block { width: 100%; }

/* الأساسيّ: لون المتجر، والنصّ بلون التمييز الداكن ليبقى التباين عاليًا */
.btn--primary { background: var(--store-primary); color: var(--store-accent); }
.btn--primary:hover { background: var(--store-accent); color: var(--on-dark); }
/* الداكن */
.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(--store-primary-dark); color: var(--store-primary-dark); background: var(--n-0); }
.btn--outline:hover { background: var(--store-primary-dark); color: var(--on-dark); }
/* الفاتح (على الخلفيّات الداكنة) */
.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: .5em; }
.btn--ghost:hover { color: var(--store-primary-dark); }
/* معطّل */
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--n-100); color: var(--n-600); border-color: var(--n-100); cursor: not-allowed;
}

/* أزرار الأيقونات المربّعة */
.icon-btn {
  --s: 44px;
  position: relative; display: inline-grid; place-items: center;
  width: var(--s); height: var(--s); padding: 0; flex: none;
  border: 0; border-radius: var(--radius-sm); background: var(--n-100); color: var(--store-text);
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
.icon-btn:hover { background: var(--store-primary); color: var(--store-accent); }
.icon-btn--sm { --s: 36px; }
.icon-btn--lg { --s: 52px; }
.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--clear { background: transparent; }
.icon-btn[aria-pressed="true"] { background: var(--store-accent); color: var(--on-dark); }

/* --------------------------------------------------------------------------
   الرأس
   -------------------------------------------------------------------------- */
/* الشريط الرئيسيّ (الشعار والأيقونات) يبقى مثبّتًا أعلى الشاشة؛ الشريط العلويّ وبحث الهاتف يمرّان.
   الرأس نفسه display: contents ليكون مرجعُ التثبيت الصفحةَ كلّها. */
.site-header { display: contents; }

/* الشريط العلويّ */
.topbar { background: var(--store-accent); color: var(--on-dark-muted); font-size: .875rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.topbar__contact { display: flex; align-items: center; gap: 20px; }
.topbar__item { display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark-muted); transition: color .3s; }
.topbar__item .icon { color: var(--store-primary); width: 1.1em; height: 1.1em; }
a.topbar__item:hover { color: var(--on-dark); }
.topbar__note { display: none; }
@media (min-width: 768px) { .topbar__note { display: block; } }
@media (max-width: 389.98px) { .topbar__item--wa span { display: none; } }

/* الشريط الرئيسيّ */
.mainbar { position: sticky; top: 0; z-index: 50; background: var(--store-bg); border-bottom: 1px solid var(--n-200); }
/* امتداد الكتلة الداكنة من حافّة الشاشة حتّى الشعار */
.mainbar::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: max(0px, calc((100% - var(--container)) / 2 + var(--gutter)));
  background: var(--store-accent);
}
.mainbar__inner { position: relative; display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }

/* الشعار داخل الكتلة المائلة */
.brand {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  align-self: stretch; padding-inline-end: 34px; color: var(--on-dark); flex: none;
}
.brand::before {
  content: ""; position: absolute; z-index: -1; inset-block: 0;
  inset-inline-start: calc(-1 * var(--gutter) - 2px); inset-inline-end: 0;
  background: var(--store-accent); transform: skewX(-18deg); transform-origin: bottom;
}
.brand::after {
  content: ""; position: absolute; z-index: -1; inset-block: 0;
  inset-inline-end: -12px; width: 6px;
  background: var(--store-primary); transform: skewX(-18deg); transform-origin: bottom;
}
.brand__logo { width: 44px; height: 44px; object-fit: contain; }
.brand__name { font-size: 1.125rem; font-weight: 800; line-height: 1.2; white-space: nowrap; color: var(--on-dark); }
@media (min-width: 768px) {
  .brand { padding-inline-end: 48px; }
  .brand__logo { width: 52px; height: 52px; }
  .brand__name { font-size: 1.375rem; }
}

/* زرّ القائمة (الهاتف واللوح) */
.menu-btn { margin-inline-start: auto; }

/* القائمة الرئيسيّة (الحاسوب) */
.nav { display: none; }
@media (min-width: 1200px) {
  .menu-btn { display: none; }
  .nav {
    display: flex; align-items: center; flex: 1; min-width: 0; gap: 4px;
    margin-inline-start: 28px; padding: 6px; background: var(--n-50); border-radius: var(--radius);
  }
}
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px;
  font-weight: 700; color: var(--store-text); border-radius: var(--radius-sm);
  transition: color .3s, background-color .3s; white-space: nowrap;
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--store-primary-dark); }
.nav__link .icon { width: 1em; height: 1em; }

/* زرّ «كلّ التصنيفات» وقائمته المنسدلة */
.nav__cats { position: relative; }
.nav__cats-btn {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px;
  border: 0; border-radius: var(--radius-sm); 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% + 12px); inset-inline-start: 0; min-width: 260px;
  padding: 10px; background: var(--n-0); box-shadow: var(--shadow-hover); border-top: 3px solid var(--store-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  visibility: hidden; opacity: 0; transform: rotateX(-75deg); transform-origin: top;
  transition: transform .45s var(--ease), opacity .3s, visibility 0s .45s;
}
.nav__cats:hover .nav__menu, .nav__cats:focus-within .nav__menu {
  visibility: visible; opacity: 1; transform: none; transition: transform .45s var(--ease), opacity .3s;
}
.nav__menu a {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-weight: 500;
  border-radius: var(--radius-sm); transition: background-color .3s, color .3s;
}
.nav__menu a:hover { background: var(--store-primary); color: var(--store-accent); }

/* بحث الرأس */
.search {
  display: flex; align-items: stretch; height: 44px; background: var(--n-0);
  border: 1px solid var(--n-200); border-radius: var(--radius-sm); overflow: hidden;
}
.search__input {
  flex: 1; min-width: 0; border: 0; padding: 0 14px; background: transparent; outline: none;
}
.search__input::placeholder { color: var(--n-600); }
.search:focus-within { border-color: var(--store-primary-dark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--store-primary) 25%, transparent); }
.search__btn { width: 44px; border: 0; background: var(--store-primary); color: var(--store-accent); display: grid; place-items: center; }
.search__btn:hover { background: var(--store-accent); color: var(--on-dark); }
.nav .search { margin-inline-start: auto; flex: 1; min-width: 180px; max-width: 280px; border-color: transparent; }

.header-actions { display: flex; align-items: center; gap: 8px; }
@media (min-width: 1200px) { .header-actions { margin-inline-start: 12px; } }
.mainbar .header-actions { margin-inline-start: auto; }
@media (min-width: 1200px) { .mainbar .header-actions { margin-inline-start: 12px; } }
.mainbar .search--tablet { display: none; }
@media (min-width: 768px) and (max-width: 1199.98px) {
  .mainbar .search--tablet { display: flex; flex: 1; max-width: 340px; margin-inline-start: auto; }
  .mainbar .header-actions { margin-inline-start: 0; }
}
.cart-count {
  position: absolute; inset-block-start: -6px; inset-inline-end: -6px; min-width: 22px; height: 22px; 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);
}
.header-actions .icon-btn--wish { display: none; }
@media (min-width: 768px) { .header-actions .icon-btn--wish { display: inline-grid; } }

/* شريط البحث تحت الرأس في الهاتف */
.mobile-search { padding: 10px var(--gutter); background: var(--n-50); border-bottom: 1px solid var(--n-200); }
@media (min-width: 768px) { .mobile-search { display: none; } }

/* الدرج الجانبيّ */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(14, 18, 29, .55);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s;
}
.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); box-shadow: var(--shadow-hover);
  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.is-open + .drawer-backdrop, .drawer-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity .35s; }
.drawer__head {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gutter); background: var(--store-accent); color: var(--on-dark);
}
.drawer__head::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 4px; background: var(--store-primary); }
.drawer__head .brand { padding: 0; align-self: auto; }
.drawer__head .brand::before, .drawer__head .brand::after { display: none; }
.drawer__head .icon-btn { background: rgba(255, 255, 255, .1); color: var(--on-dark); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px var(--gutter); display: grid; gap: 22px; align-content: start; }
.drawer__title { font-size: .875rem; font-weight: 700; color: var(--n-600); margin-block-end: 8px; }
.drawer__links a {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 4px;
  border-bottom: 1px solid var(--n-100); font-weight: 700;
}
.drawer__links a:hover { color: var(--store-primary-dark); }
.drawer__links .icon { width: 1em; height: 1em; color: var(--n-600); }
.drawer__contact { display: grid; gap: 10px; }
.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; }

/* --------------------------------------------------------------------------
   رؤوس الأقسام
   -------------------------------------------------------------------------- */
.section { padding-block: 48px; }
@media (min-width: 1200px) { .section { padding-block: 80px; } }
.section--tint { background: var(--n-50); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-block-end: 28px; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-block-end: 8px;
  font-size: .9375rem; font-weight: 700; color: var(--store-primary-dark);
}
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--store-primary); }
.section-title { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
.section-sub { margin-block-start: 6px; color: var(--n-600); max-width: 60ch; }
.section-sub:empty { display: none; }
.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: 36px;
  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, .18);
}
.type-dot .icon { width: 18px; height: 18px; 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: 16px;
  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.75rem; }
.price--lg .price__old { font-size: 1.125rem; }

/* --------------------------------------------------------------------------
   الشارات
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  font-size: .8125rem; font-weight: 800; line-height: 1; border-radius: var(--radius-sm); white-space: nowrap;
}
.badge--sale { background: var(--store-primary); color: var(--store-accent); }
.badge--new { background: var(--store-accent); color: var(--on-dark); }

/* --------------------------------------------------------------------------
   بطاقة الكتاب
   -------------------------------------------------------------------------- */
.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@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)); } }

.book-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%;
  background: var(--n-0); border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .45s var(--ease), transform .45s var(--ease);
}
.book-card__media {
  position: relative; padding: 18px 18px 0; background: var(--n-100); overflow: hidden;
}
.book-card__cover {
  position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.book-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.book-card__cover::after {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 0; height: 0;
  background: color-mix(in srgb, var(--store-primary) 28%, transparent); transition: width .5s var(--ease), height .5s var(--ease);
}
.book-card:hover .book-card__cover img { transform: scale(1.08); }
.book-card:hover .book-card__cover::after { width: 100%; height: 100%; }

/* دائرة النوع على ركن الغلاف */
.book-card__type { position: absolute; z-index: 2; inset-block-start: 10px; inset-inline-end: 10px; }
.book-card__badges { position: absolute; z-index: 2; inset-block-start: 10px; inset-inline-start: 10px; display: grid; gap: 6px; justify-items: start; }

/* المفضّلة والنظرة السريعة: تطفوان فوق الغلاف ولا تحجزان مكانًا؛ تنزلقان عند التحويم، وتظهران دائمًا في أجهزة اللمس */
.book-card__tools {
  position: absolute; z-index: 3; inset-block-end: 12px; inset-inline-start: 28px; display: flex; gap: 6px;
}
.book-card__tool {
  background: var(--n-0); color: var(--store-text); box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  transform: translateY(14px); opacity: 0; transition: transform .45s var(--ease), opacity .3s, background-color .3s, color .3s;
}
.book-card__tool + .book-card__tool { transition-delay: .06s; }
.book-card:hover .book-card__tool, .book-card:focus-within .book-card__tool, .book-card__tool[aria-pressed="true"] { transform: none; opacity: 1; }
@media (hover: none) { .book-card__tool { transform: none; opacity: 1; } }

/* شريط «نفدت الكمّيّة» */
.book-card__soldout {
  position: absolute; z-index: 2; inset-inline: 0; inset-block-end: 0; padding: 8px 12px;
  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: 0 0 16px; }
.book-card__head { position: relative; padding: 14px 16px 6px; isolation: isolate; }
.book-card__head::before {
  content: ""; position: absolute; z-index: -1; inset-block: 0; inset-inline-start: 0; width: 0;
  background: var(--store-primary); transition: width .5s var(--ease);
}
.book-card__title { font-size: 1.0625rem; font-weight: 800; line-height: 1.45; }
.book-card__title a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .4s;
}
.book-card__author { margin-block-start: 2px; font-size: .9375rem; color: var(--n-600); transition: color .4s; }
.book-card__author a:hover { text-decoration: underline; }
.book-card__meta, .book-card__buy { padding-inline: 16px; }
.book-card__meta { display: flex; align-items: center; }
.book-card__buy { margin-block-start: auto; 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; }
/* زرّ السلّة: زرّ القالب الأصليّ «أضف» بأيقونة السلّة، ظاهرٌ دائمًا (البند 7)، وفي الهاتف أيقونةٌ وحدها */
.book-card__add { --btn-h: 40px; flex: none; padding: 0 14px; }

/* النمط الكلاسيكيّ (الافتراضيّ): يمتلئ شريط العنوان بلون المتجر */
.book-card:hover { box-shadow: var(--shadow-hover); }
.book-card:hover .book-card__head::before { width: 100%; }
.book-card:hover .book-card__title a, .book-card:hover .book-card__author { color: var(--store-accent); }

/* النمط المؤطَّر */
[data-card-style="framed"] .book-card { border: 1px solid var(--n-200); }
[data-card-style="framed"] .book-card__media { background: var(--n-0); border-bottom: 1px solid var(--n-200); padding: 16px 16px 16px; }
[data-card-style="framed"] .book-card__cover { border-radius: var(--radius-sm); }
[data-card-style="framed"] .book-card:hover { border-color: var(--store-primary); }

/* النمط البسيط: بلا خلفيّة ولا امتلاء */
[data-card-style="minimal"] .book-card { background: transparent; }
[data-card-style="minimal"] .book-card__media { background: transparent; padding: 0; }
[data-card-style="minimal"] .book-card__cover { border-radius: var(--radius-sm); }
[data-card-style="minimal"] .book-card__head { padding-inline: 0; }
[data-card-style="minimal"] .book-card__meta, [data-card-style="minimal"] .book-card__buy { padding-inline: 0; }
[data-card-style="minimal"] .book-card:hover { box-shadow: none; }
[data-card-style="minimal"] .book-card:hover .book-card__head::before { width: 0; }
[data-card-style="minimal"] .book-card:hover .book-card__title a { color: var(--store-primary-dark); }
[data-card-style="minimal"] .book-card:hover .book-card__author { color: var(--n-600); }

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

@media (max-width: 767.98px) {
  .book-card__media { padding: 12px 12px 0; }
  .book-card__head { padding: 12px 12px 4px; }
  .book-card__meta, .book-card__buy { padding-inline: 12px; }
  .book-card__title { font-size: 1rem; }
  .book-card__add .label { display: none; }
  .book-card__add { width: 40px; padding: 0; }
  .book-card__tools { inset-inline-start: 20px; }
  .book-card__buy .price__now { font-size: 1rem; }
  .type-dot { --size: 32px; }
  .type-dot .icon { width: 16px; height: 16px; }
}

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

/* --------------------------------------------------------------------------
   رأي القارئ
   -------------------------------------------------------------------------- */
.review {
  position: relative; padding: 26px 22px 22px; margin-block-start: 22px;
  border: 1px solid var(--n-200); border-top: 0; background: var(--n-0); border-radius: 0 0 var(--radius) var(--radius);
}
.review::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; height: 3px; background: var(--store-primary); }
.review__quote {
  position: absolute; inset-block-start: -22px; inset-inline-end: 22px; width: 44px; height: 44px;
  display: grid; place-items: center; background: var(--store-primary); color: var(--store-accent); border-radius: var(--radius-sm);
}
.review__head { display: flex; align-items: center; gap: 12px; margin-block-end: 12px; }
.review__avatar {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--n-100); color: var(--n-600); font-weight: 800;
}
.review__name { font-weight: 800; }
.review__text { color: var(--n-600); }

/* --------------------------------------------------------------------------
   التذييل
   -------------------------------------------------------------------------- */
.site-footer { position: relative; background: var(--store-accent); color: var(--on-dark-muted); overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; inset-block-start: -80px; inset-inline-end: -20px; width: 90px; height: 320px;
  background: var(--store-primary); transform: rotate(45deg); opacity: .9;
}
@media (max-width: 991.98px) { .site-footer::before { width: 36px; height: 160px; inset-block-start: -70px; inset-inline-end: 0; } }
.footer-subscribe { position: relative; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-subscribe__inner { display: grid; gap: 18px; padding-block: 36px; align-items: center; }
@media (min-width: 992px) { .footer-subscribe__inner { grid-template-columns: 1fr minmax(0, 520px); } }
.footer-subscribe h2 { color: var(--on-dark); font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); }
.footer-subscribe p { margin-block-start: 6px; }
.subscribe { display: flex; gap: 0; min-height: 52px; background: var(--n-0); border-radius: var(--radius-sm); overflow: hidden; }
.subscribe__input { flex: 1; min-width: 0; border: 0; padding: 0 16px; outline: none; color: var(--store-text); background: transparent; }
.subscribe__input::placeholder { color: var(--n-600); }
.subscribe .btn { border-radius: 0; min-height: 52px; }

.footer-main { position: relative; display: grid; gap: 32px; padding-block: 44px; }
@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 { padding: 0; align-self: auto; }
.footer-brand .brand::before, .footer-brand .brand::after { display: none; }
.footer-brand p { margin-block-start: 14px; max-width: 34ch; }
.footer-col h3 { position: relative; color: var(--on-dark); font-size: 1.125rem; padding-block-end: 12px; margin-block-end: 14px; }
.footer-col h3::after { content: ""; position: absolute; inset-inline-start: 0; inset-block-end: 0; width: 34px; height: 3px; background: var(--store-primary); }
.footer-links { display: grid; gap: 4px; }
.footer-links a { display: inline-block; line-height: 2; color: var(--on-dark-muted); transition: color .3s, letter-spacing .3s, padding .3s; }
.footer-links a:hover { color: var(--store-primary); padding-inline-start: 6px; }
.footer-contact { display: grid; gap: 12px; }
.footer-contact a { display: inline-flex; align-items: center; gap: 10px; color: var(--on-dark-muted); }
.footer-contact a:hover { color: var(--on-dark); }
.footer-contact .icon-box {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .08); color: var(--store-primary); border-radius: var(--radius-sm);
}
.footer-bottom { position: relative; border-top: 1px solid rgba(255, 255, 255, .1); }
.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(--on-dark); font-weight: 700; }
.pay-methods { display: flex; gap: 6px; }
.pay-methods span {
  display: inline-grid; place-items: center; height: 28px; padding: 0 10px; font-size: .75rem; font-weight: 700;
  background: rgba(255, 255, 255, .1); color: var(--on-dark); border-radius: var(--radius-sm);
}

/* زرّ العودة إلى الأعلى */
.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; background: var(--store-primary); color: var(--store-accent);
  border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); transition: background-color .3s, color .3s;
}
.back-to-top:hover { background: var(--store-accent); color: var(--on-dark); }

/* --------------------------------------------------------------------------
   أقسامٌ تُخفى بخيارات الناشر (body_attributes، الملحق البند 3)
   -------------------------------------------------------------------------- */
[data-region][hidden] { display: none !important; }
body[data-show-trust-bar="false"] .trust-section,
body[data-show-reviews="false"] .reviews-section { display: none; }

/* --------------------------------------------------------------------------
   السلايدر الرئيسيّ
   -------------------------------------------------------------------------- */
.hero { position: relative; background: var(--store-accent); color: var(--on-dark); overflow: hidden; }
.hero__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.hero__track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: 560px; display: flex; align-items: center; overflow: hidden; }
@media (min-width: 1200px) { .slide { min-height: 600px; } }
.slide__media { position: absolute; inset-block: 0; inset-inline-end: 0; width: 100%; }
.slide__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 991.98px) {
  .slide { flex-direction: column; align-items: stretch; min-height: 0; }
  .slide__media { position: relative; height: clamp(190px, 46vw, 340px); clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%); }
  .slide__body { padding-block: 18px 64px; }
  .hero__nav { display: none; }
  .hero .slider-dots { inset-block-end: 22px; }
}
@media (min-width: 992px) {
  .slide__media { width: 58%; clip-path: polygon(0 0, 63% 0, 100% 100%, 0 100%); }
  .slide__media img { opacity: 1; }
}
/* الشكلان المنحرفان كما في المرجع، معكوسين لليمين إلى اليسار */
.slide__shape { display: none; }
@media (min-width: 992px) {
  .slide__shape { display: block; position: absolute; z-index: 1; width: 150px; transform: skewX(26deg); }
  .slide__shape--a { inset-block-start: -6%; inset-inline-end: 38%; height: 34%; background: var(--store-primary); }
  .slide__shape--a::before { content: ""; position: absolute; inset-block-start: 0; inset-inline-end: 0; width: 50%; height: 80%; background: var(--on-dark); opacity: .08; }
  .slide__shape--b { inset-block-end: -6%; inset-inline-end: 56%; height: 30%; background: var(--store-primary); opacity: .9; width: 60px; }
}
.slide__body { position: relative; z-index: 2; width: 100%; padding-block: 64px 96px; }
.slide__text { max-width: 560px; }
.slide__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--store-primary); margin-block-end: 14px; }
.slide__eyebrow::before { content: ""; width: 34px; height: 3px; background: var(--store-primary); }
.slide__title { color: var(--on-dark); font-size: clamp(1.75rem, 1.2rem + 3vw, 3.5rem); line-height: 1.25; }
.slide__desc { margin-block-start: 16px; color: var(--on-dark-muted); font-size: 1.0625rem; max-width: 48ch; }
.slide__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 28px; }
.slide__books { display: none; }
@media (min-width: 992px) {
  .slide__books { display: flex; position: absolute; z-index: 2; inset-block-end: 110px; inset-inline-end: 7%; align-items: flex-end; }
  .slide__books img { width: 150px; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
  .slide__books img + img { margin-inline-end: -40px; width: 180px; position: relative; z-index: 1; }
}
.hero__nav { position: absolute; z-index: 3; inset-block-end: 0; inset-inline-end: 0; display: flex; }
@media (min-width: 1200px) { .hero__nav { inset-block-end: 48px; } .hero .slider-dots { inset-block-end: 72px; } .slide__body { padding-block-end: 140px; } }
.hero__nav button {
  width: 60px; height: 60px; border: 0; display: grid; place-items: center; background: var(--n-0); color: var(--store-accent);
  transition: background-color .3s, color .3s;
}
.hero__nav button:hover { background: var(--store-primary); }
.hero__nav button + button { border-inline-start: 1px solid var(--n-200); }
.slider-dots { position: absolute; z-index: 3; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(50%); display: flex; gap: 8px; }
[dir="ltr"] .slider-dots { transform: translateX(-50%); }
.slider-dot { width: 12px; height: 12px; padding: 0; border: 2px solid var(--on-dark); background: transparent; border-radius: var(--radius-sm); }
.slider-dot[aria-current="true"] { background: var(--store-primary); border-color: var(--store-primary); }

/* --------------------------------------------------------------------------
   شريط الثقة
   -------------------------------------------------------------------------- */
.trust { position: relative; z-index: 4; }
.trust__grid { display: grid; gap: 1px; background: var(--n-200); box-shadow: var(--shadow-soft); }
@media (min-width: 768px) { .trust__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .trust { margin-block-start: -48px; } }
.trust__item { display: flex; align-items: center; gap: 16px; padding: 22px 24px; background: var(--n-0); }
.trust__icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; background: var(--store-primary); color: var(--store-accent); border-radius: var(--radius-sm); }
.trust__icon .icon { width: 28px; height: 28px; }
.trust__item h3 { font-size: 1.0625rem; }
.trust__item p { color: var(--n-600); font-size: .9375rem; }
@media (max-width: 767.98px) {
  .trust { padding-block: 14px 0; }
  .trust__grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: none; box-shadow: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .trust__grid::-webkit-scrollbar { display: none; }
  .trust__item { flex: 0 0 78%; scroll-snap-align: start; gap: 12px; padding: 12px 14px; border: 1px solid var(--n-200); }
  .trust__icon { width: 40px; height: 40px; }
  .trust__icon .icon { width: 22px; height: 22px; }
  .trust__item h3 { font-size: .9375rem; }
  .trust__item p { font-size: .8125rem; line-height: 1.5; }
}

/* --------------------------------------------------------------------------
   تبويبات صفوف الكتب
   -------------------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 767.98px) {
  .section-head > .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); width: calc(100% + 2 * var(--gutter)); }
  .section-head > .tabs::-webkit-scrollbar { display: none; }
  .tabs [role="tab"] { flex: none; }
}
.tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid var(--n-200);
  background: var(--n-0); font-weight: 700; border-radius: var(--radius-sm); transition: background-color .3s, color .3s, border-color .3s;
}
.tabs [role="tab"]:hover { border-color: var(--store-primary); }
.tabs [role="tab"][aria-selected="true"] { background: var(--store-accent); border-color: var(--store-accent); color: var(--on-dark); }

/* --------------------------------------------------------------------------
   التصنيفات
   -------------------------------------------------------------------------- */
.cat-grid { display: grid; gap: 12px; grid-auto-flow: column; grid-auto-columns: 44%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.cat-grid::-webkit-scrollbar { display: none; }
.cat-grid > * { scroll-snap-align: start; }
@media (max-width: 767.98px) {
  .cat-card__label { inset-inline: 8px; inset-block-end: 8px; padding: 8px 10px; flex-direction: column; align-items: flex-start; gap: 0; }
  .cat-card__name { font-size: .9375rem; }
}
@media (min-width: 768px) { .cat-grid { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; overflow: visible; margin-inline: 0; padding-inline: 0; } }
.cat-card { position: relative; display: block; overflow: hidden; background: var(--store-accent); border-radius: var(--radius); }
.cat-card img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .6s var(--ease), opacity .4s; }
.cat-card:hover img { transform: scale(1.08); opacity: .6; }
.cat-card__label {
  position: absolute; inset-inline: 12px; inset-block-end: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; background: var(--n-0); color: var(--store-text); border-radius: var(--radius-sm);
  transition: background-color .4s;
}
.cat-card__label::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--store-primary); }
.cat-card:hover .cat-card__label { background: var(--store-primary); color: var(--store-accent); }
.cat-card__name { font-weight: 800; }
.cat-card__count { font-size: .8125rem; color: inherit; opacity: .85; white-space: nowrap; }

/* --------------------------------------------------------------------------
   البانر
   -------------------------------------------------------------------------- */
.banner { position: relative; overflow: hidden; isolation: isolate; color: var(--on-dark); background: var(--store-accent); }
.banner__media { position: relative; height: clamp(180px, 44vw, 300px); clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%); }
.banner__img { width: 100%; height: 100%; object-fit: cover; }
.banner::before {
  content: ""; position: absolute; z-index: -1; width: 90px; height: 460px; background: var(--store-primary); transform: rotate(45deg);
  inset-block-end: -260px; inset-inline-end: -10px;
}
.banner__inner { position: relative; padding-block: 28px 44px; }
.banner__text { display: grid; gap: 16px; justify-items: start; max-width: 560px; }
.banner h2 { color: var(--on-dark); font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); }
@media (min-width: 992px) {
  .banner { min-height: 420px; display: flex; align-items: center; }
  .banner__media { position: absolute; inset-block: 0; inset-inline-end: 0; width: 56%; height: auto; clip-path: polygon(0 0, 100% 0, 100% 100%, 18% 100%); }
  [dir="rtl"] .banner__media { clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); }
  .banner__inner { padding-block: 64px; }
  .banner__text { max-width: 44%; gap: 20px; }
  .banner::before { inset-block-start: -130px; inset-block-end: auto; inset-inline-end: calc(56% - 72px); width: 44px; height: 680px; transform: rotate(-17deg); }
  [dir="rtl"] .banner::before { transform: rotate(17deg); }
}
.banner .eyebrow, .page-hero .eyebrow { color: var(--store-primary); }
.banner p { color: var(--on-dark-muted); max-width: 52ch; }

/* --------------------------------------------------------------------------
   المؤلّفون
   -------------------------------------------------------------------------- */
.author-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .author-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.author-card { position: relative; display: block; background: var(--n-0); border-radius: var(--radius); overflow: hidden; transition: box-shadow .4s; }
.author-card:hover { box-shadow: var(--shadow-hover); }
.author-card__photo { position: relative; overflow: hidden; }
.author-card__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .6s var(--ease); }
.author-card__photo::after { content: ""; position: absolute; inset: 0 0 auto; height: 0; background: color-mix(in srgb, var(--store-primary) 25%, transparent); transition: height .5s var(--ease); }
.author-card:hover .author-card__photo img { transform: scale(1.08); }
.author-card:hover .author-card__photo::after { height: 100%; }
.author-card__body { padding: 16px; text-align: center; border-bottom: 3px solid var(--store-primary); }
.author-card__name { font-size: 1.0625rem; font-weight: 800; }
.author-card__meta { font-size: .875rem; color: var(--n-600); }

/* آراء القرّاء في الرئيسيّة */
.reviews-grid { display: grid; gap: 28px; }
@media (min-width: 992px) { .reviews-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --------------------------------------------------------------------------
   رأس الصفحات الداخليّة ومسار التنقّل
   -------------------------------------------------------------------------- */
.page-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--store-accent); color: var(--on-dark); }
.page-hero__img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: .3; }
.page-hero__inner { padding-block: 44px; }
@media (min-width: 1200px) { .page-hero__inner { padding-block: 64px; } }
.page-hero h1 { color: var(--on-dark); font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); }
.page-hero p { margin-block-start: 8px; color: var(--on-dark-muted); max-width: 60ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .875rem; margin-block-end: 10px; }
.crumbs a { color: var(--on-dark-muted); }
.crumbs a:hover { color: var(--store-primary); }
.crumbs .sep { color: var(--store-primary); }
.crumbs [aria-current] { color: var(--on-dark); font-weight: 700; }
.crumbs--light a { color: var(--n-600); }
.crumbs--light a:hover { color: var(--store-primary-dark); }
.crumbs--light [aria-current] { color: var(--store-text); }
.crumbs--light .sep { color: var(--store-primary-dark); }
.crumbs-bar { background: var(--n-50); border-bottom: 1px solid var(--n-200); }
.crumbs-bar .crumbs { margin: 0; padding-block: 14px; }

/* --------------------------------------------------------------------------
   صفحة التصنيف: التصفية والفرز
   -------------------------------------------------------------------------- */
.listing { display: grid; gap: 28px; padding-block: 36px 64px; }
@media (min-width: 1200px) { .listing { grid-template-columns: 280px minmax(0, 1fr); gap: 32px; padding-block: 48px 80px; } }
.filters { display: none; }
.filters.is-open { display: block; }
@media (min-width: 1200px) { .filters { display: block; } .filters-toggle { display: none !important; } }
.filter-box { background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius); margin-block-end: 18px; }
.filter-box__title { position: relative; padding: 14px 18px; font-size: 1rem; font-weight: 800; border-bottom: 1px solid var(--n-200); }
.filter-box__title::after { content: ""; position: absolute; inset-inline-start: 0; inset-block-end: -1px; width: 40px; height: 3px; background: var(--store-primary); }
.filter-box__body { padding: 14px 18px; 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; font-size: .8125rem; color: var(--n-600); }
.range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.field {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--n-200); border-radius: var(--radius-sm); background: var(--n-0);
}
.field:focus { outline: none; border-color: var(--store-primary-dark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--store-primary) 25%, transparent); }
select.field { padding-inline-end: 34px; 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 12px center; }
[dir="ltr"] select.field { background-position: right 12px center; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-block-end: 18px; background: var(--n-50); border: 1px solid var(--n-200); border-radius: var(--radius); }
.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: 190px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: var(--n-100); border: 0; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 700; }
.chip .icon { width: 14px; height: 14px; }
.chip:hover { background: var(--store-primary); color: var(--store-accent); }
.listing .book-grid { }
@media (min-width: 1200px) { .listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.listing .pagination { margin-block-start: 40px; }

/* --------------------------------------------------------------------------
   صفحة الكتاب
   -------------------------------------------------------------------------- */
.product { display: grid; gap: 32px; padding-block: 36px 56px; }
@media (min-width: 992px) { .product { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; padding-block: 56px 72px; } }
.product__media { position: relative; padding: 40px; background: var(--n-100); align-self: start; overflow: hidden; }
@media (min-width: 992px) { .product__media { padding: 56px; position: sticky; top: calc(var(--header-h) + 20px); } }
.product__media::before {
  content: ""; position: absolute; inset-block-start: -60px; inset-inline-start: -30px; width: 70px; height: 300px;
  background: var(--store-primary); transform: rotate(35deg);
}
.product__media::after {
  content: ""; position: absolute; inset-block-start: -40px; inset-inline-start: 40px; width: 14px; height: 300px;
  background: var(--store-accent); transform: rotate(35deg);
}
.product__cover { position: relative; z-index: 1; max-width: 340px; margin-inline: auto; }
.product__cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 24px 48px rgba(0, 0, 0, .28); }
.product__cover .type-dot { position: absolute; inset-block-start: -16px; inset-inline-end: -16px; }
.product__cover .badge { position: absolute; inset-block-start: 12px; inset-inline-start: 12px; }
.product__type { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 700; color: var(--store-primary-dark); }
.product__type::before { content: ""; width: 28px; height: 3px; background: var(--store-primary); }
.product__title { margin-block: 10px 6px; font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); }
.product__author { font-size: 1.0625rem; color: var(--n-600); }
.product__author a { color: var(--store-text); font-weight: 700; border-bottom: 2px solid var(--store-primary); }
.product__author a:hover { color: var(--store-primary-dark); }
.product__rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 14px 18px; }
.product__rating a { font-size: .875rem; color: var(--n-600); text-decoration: underline; }
.product__price { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-block: 18px; border-block: 1px solid var(--n-200); }
.product__summary { margin-block: 18px; color: var(--n-600); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--n-200); border: 1px solid var(--n-200); margin-block: 20px; }
@media (min-width: 768px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fact { display: grid; gap: 2px; padding: 12px 14px; background: var(--n-0); }
.fact__label { font-size: .8125rem; color: var(--n-600); display: inline-flex; align-items: center; gap: 6px; }
.fact__label .icon { width: 1em; height: 1em; color: var(--store-primary-dark); }
.fact__value { font-weight: 700; }
.fact--hl { background: var(--n-50); }
.fact--hl .fact__value { font-size: 1.125rem; color: var(--store-text); }
.buy { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-block: 22px 12px; }
.buy .btn { flex: 1 1 180px; }
.qty { display: inline-flex; align-items: stretch; height: 48px; border: 1px solid var(--n-200); border-radius: var(--radius-sm); overflow: hidden; flex: none; }
.qty button { width: 44px; border: 0; background: var(--n-100); font-size: 1.25rem; font-weight: 700; }
.qty button:hover { background: var(--store-primary); color: var(--store-accent); }
.qty input { width: 52px; border: 0; text-align: center; font-weight: 800; background: var(--n-0); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sample { display: flex; flex-wrap: wrap; gap: 10px; }
.perks { display: grid; gap: 8px; margin-block-start: 18px; padding: 16px 18px; background: var(--n-50); border-inline-start: 3px solid var(--store-primary); font-size: .9375rem; }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks .icon { color: var(--store-primary-dark); width: 1.1em; height: 1.1em; }

/* مشغّل العيّنة الصوتيّة (شكل فقط) */
.player { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-block: 18px; background: var(--store-accent); color: var(--on-dark); border-radius: var(--radius); }
.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: 4px; background: rgba(255, 255, 255, .2); }
.player__bar span { position: absolute; inset-block: 0; inset-inline-start: 0; width: 28%; background: var(--store-primary); }
.player__time { display: flex; justify-content: space-between; font-size: .75rem; color: var(--on-dark-muted); }

/* تفاصيل الكتاب (أكورديون بعناصر details) */
.details-wrap { padding-block-end: 56px; }
.acc { border: 1px solid var(--n-200); border-top: 0; background: var(--n-0); }
.acc:first-child { border-top: 1px solid var(--n-200); }
.acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; cursor: pointer;
  font-size: 1.125rem; font-weight: 800; list-style: none; background: var(--n-50); transition: background-color .3s, color .3s;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .icon { transition: transform .3s; }
.acc[open] summary { background: var(--store-primary); color: var(--store-accent); }
.acc[open] summary .icon { transform: rotate(180deg); }
.acc__body { padding: 22px 20px; color: var(--n-600); display: grid; gap: 14px; }
.acc__body p { max-width: 75ch; }
.spec { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.spec th, .spec td { padding: 12px 14px; border-bottom: 1px solid var(--n-200); text-align: start; }
.spec th { width: 36%; color: var(--n-600); font-weight: 500; background: var(--n-50); }
.spec td { color: var(--store-text); font-weight: 700; }
.rating-sum { display: grid; gap: 18px; align-items: center; padding: 18px; background: var(--n-50); }
@media (min-width: 768px) { .rating-sum { grid-template-columns: auto 1fr; gap: 32px; } }
.rating-sum__big { text-align: center; }
.rating-sum__big b { display: block; font-size: 3rem; line-height: 1; color: var(--store-text); }
.bars { display: grid; gap: 6px; font-size: .8125rem; }
.bars div { display: grid; grid-template-columns: 52px 1fr 36px; align-items: center; gap: 10px; }
.bars span { height: 6px; background: var(--n-200); position: relative; }
.bars span i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--star); }
.review-list { display: grid; gap: 16px; }
.review-list .review { margin: 0; border-top: 1px solid var(--n-200); border-radius: var(--radius); }
.review-list .review::before { display: none; }
.review__date { margin-inline-start: auto; font-size: .8125rem; color: var(--n-600); }

/* --------------------------------------------------------------------------
   صفحة المؤلّف
   -------------------------------------------------------------------------- */
.author-hero { display: grid; gap: 28px; align-items: center; padding-block: 40px; }
@media (min-width: 992px) { .author-hero { grid-template-columns: 340px minmax(0, 1fr); gap: 56px; padding-block: 64px; } }
.author-hero__photo { position: relative; max-width: 340px; }
.author-hero__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; position: relative; z-index: 1; }
.author-hero__photo::before { content: ""; position: absolute; inset-block-start: 18px; inset-inline-start: 18px; width: 100%; height: 100%; border: 3px solid var(--store-primary); }
.author-hero h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.75rem); margin-block: 8px 14px; }
.author-hero__bio { color: var(--n-600); display: grid; gap: 12px; max-width: 70ch; }
.stats { display: flex; flex-wrap: wrap; gap: 1px; margin-block-start: 22px; background: var(--n-200); border: 1px solid var(--n-200); width: fit-content; }
.stat { padding: 14px 22px; background: var(--n-0); text-align: center; }
.stat b { display: block; font-size: 1.5rem; color: var(--store-text); }
.stat span { font-size: .8125rem; color: var(--n-600); }

/* --------------------------------------------------------------------------
   السلّة
   -------------------------------------------------------------------------- */
.cart { display: grid; gap: 28px; padding-block: 40px 72px; }
@media (min-width: 1200px) { .cart { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 32px; } }
.cart-table { width: 100%; border-collapse: collapse; background: var(--n-0); border: 1px solid var(--n-200); }
.cart-table thead th { padding: 14px 16px; background: var(--store-accent); color: var(--on-dark); font-size: .9375rem; text-align: start; font-weight: 700; }
.cart-table td { padding: 16px; border-bottom: 1px solid var(--n-200); vertical-align: middle; }
.cart-item { display: flex; align-items: center; gap: 14px; }
.cart-item__cover { position: relative; width: 70px; flex: none; }
.cart-item__cover img { width: 70px; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 6px 14px rgba(0, 0, 0, .15); }
.cart-item__cover .type-dot { position: absolute; inset-block-start: -8px; inset-inline-end: -8px; --size: 24px; border-width: 1px; }
.cart-item__cover .type-dot .icon { width: 12px; height: 12px; }
.cart-item__title { font-weight: 800; }
.cart-item__title a:hover { color: var(--store-primary-dark); }
.cart-item__author { font-size: .875rem; color: var(--n-600); }
.cart-table .qty { height: 42px; }
.cart-table .qty button { width: 38px; }
.cart-table .qty input { width: 44px; }
.line-total { font-weight: 800; white-space: nowrap; }
.cart-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-block-start: 18px; }
.coupon { display: flex; gap: 0; flex: 1 1 320px; max-width: 460px; }
.coupon .field { border-start-end-radius: 0; border-end-end-radius: 0; }
.coupon .btn { border-radius: 0; }
.cart-actions__end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.coupon-applied { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--n-50); border: 1px dashed var(--n-300); font-size: .875rem; color: var(--n-600); }
.coupon-applied > span { display: inline-flex; align-items: center; gap: 6px; }
.coupon-applied .icon { width: 1em; height: 1em; color: var(--store-primary-dark); }
.coupon-applied b { color: var(--store-text); direction: ltr; unicode-bidi: isolate; }
.coupon-applied__remove { width: 30px; height: 30px; border: 0; display: grid; place-items: center; background: transparent; color: var(--n-600); border-radius: var(--radius-sm); }
.coupon-applied__remove:hover { background: var(--n-100); color: var(--store-text); }
@media (max-width: 767.98px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr { position: relative; padding: 14px; border-bottom: 1px solid var(--n-200); }
  .cart-table td { padding: 6px 0; border: 0; }
  .cart-table td[data-label] { display: flex; align-items: center; justify-content: space-between; }
  .cart-table td[data-label]::before { content: attr(data-label); color: var(--n-600); font-size: .875rem; }
  .cart-table td.cart-remove { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; width: auto; }
}
.summary { border: 1px solid var(--n-200); background: var(--n-0); }
@media (min-width: 1200px) { .summary { position: sticky; top: calc(var(--header-h) + 20px); } }
.summary__head { padding: 16px 20px; background: var(--store-accent); color: var(--on-dark); font-weight: 800; font-size: 1.125rem; border-bottom: 4px solid var(--store-primary); }
.summary__body { padding: 20px; display: grid; gap: 12px; }
.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 solid var(--n-200); font-size: 1.125rem; color: var(--store-text); font-weight: 800; }
.summary__row--total b { font-size: 1.375rem; }
.summary__note { font-size: .8125rem; color: var(--n-600); display: flex; gap: 8px; align-items: flex-start; }
.summary__note .icon { color: var(--store-primary-dark); margin-block-start: 3px; }

/* --------------------------------------------------------------------------
   صفحة 404
   -------------------------------------------------------------------------- */
.notfound { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding-block: 72px 64px; }
.notfound::before, .notfound::after { content: ""; position: absolute; z-index: -1; width: 90px; height: 520px; transform: rotate(45deg); }
.notfound::before { inset-block-start: -200px; inset-inline-end: 6%; background: var(--store-primary); }
.notfound::after { inset-block-start: -190px; inset-inline-end: calc(6% + 110px); width: 20px; background: var(--store-accent); }
.notfound__code { font-size: clamp(6rem, 3rem + 12vw, 11rem); font-weight: 800; line-height: 1; color: var(--store-accent); letter-spacing: -2px; }
.notfound__code span { color: var(--store-primary-dark); }
.notfound h1 { margin-block: 12px 10px; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem); }
.notfound p { color: var(--n-600); max-width: 52ch; margin-inline: auto; }
.notfound .search { max-width: 520px; margin: 26px auto 18px; height: 52px; }
.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 h1 { 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: 28px; padding: 24px var(--gutter); background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius); }
@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-frame { border: 1px dashed var(--n-300); border-radius: var(--radius-sm); overflow: hidden; }
.cmp-label { display: block; margin-block: 18px 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-sm); }
.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-sm); 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: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .cmp-states { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.cmp-state-label { display: block; margin-block-end: 8px; 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)); } }

/* روابط داخل الصفحة: لا يختفي الهدف تحت الرأس المثبّت */
#reviews { scroll-margin-top: calc(var(--header-h) + 16px); }

/* الأسئلة الشائعة (منطقة home_faq) */
.faq__grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 992px) { .faq__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; } }
.faq__lead { margin-block-start: 12px; color: var(--n-600); max-width: 42ch; }
.faq__list .acc summary { font-size: 1rem; }
.faq__list .acc__body p { margin: 0; }

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

/* اسم الكتاب تحت نصّ الرأي */
.review__book { margin-block-start: 10px; font-size: .8125rem; color: var(--n-600); }

/* --------------------------------------------------------------------------
   الدوّار الأفقيّ لصفّ الكتب (الأكثر مبيعًا): سهمان في الحاسوب، واللمس في الهاتف
   -------------------------------------------------------------------------- */
.book-row {
  --per: 2.2;
  display: grid; grid-auto-flow: column; gap: 16px;
  grid-auto-columns: calc((100% - (var(--per) - 1) * 16px) / var(--per));
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.book-row::-webkit-scrollbar { display: none; }
.book-row > * { scroll-snap-align: start; }
@media (min-width: 768px) { .book-row { --per: 3; gap: 24px; grid-auto-columns: calc((100% - (var(--per) - 1) * 24px) / var(--per)); } }
@media (min-width: 1200px) { .book-row { --per: var(--books-per-row); } }
.row-nav { display: flex; align-items: center; gap: 8px; }
.row-nav .section-link { margin-inline-end: 10px; }
.row-nav__btn { display: none; }
@media (min-width: 768px) { .row-nav__btn { display: inline-grid; } }
.row-nav__btn:disabled { opacity: .4; cursor: default; }

/* --------------------------------------------------------------------------
   عروض الأسبوع: كتلةٌ داكنة بأشرطةٍ مائلة، وعدّادٌ واحد للقسم (offer.ends_at)
   -------------------------------------------------------------------------- */
.deals { position: relative; overflow: hidden; isolation: isolate; background: var(--store-accent); color: var(--on-dark); }
.deals::before, .deals::after { content: ""; position: absolute; z-index: -1; background: var(--store-primary); transform: rotate(45deg); }
.deals::before { width: 70px; height: 300px; inset-block-end: -210px; inset-inline-end: 30px; }
.deals::after { width: 14px; height: 300px; inset-block-end: -200px; inset-inline-end: 130px; background: var(--on-dark); opacity: .14; }
.deals .section-title { color: var(--on-dark); }
.deals .eyebrow { color: var(--store-primary); }
.deals .section-sub { color: var(--on-dark-muted); }
.deals__head { align-items: center; }
.countdown { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.countdown[hidden] { display: none; }
.countdown__label { display: inline-flex; align-items: center; gap: 8px; padding-inline-end: 6px; font-weight: 700; color: var(--on-dark-muted); font-size: .9375rem; }
.countdown__label .icon { color: var(--store-primary); }
.countdown__unit {
  display: grid; justify-items: center; align-content: center; min-width: 62px; padding: 8px 6px;
  background: var(--store-primary); color: var(--store-accent); border-radius: var(--radius-sm);
}
.countdown__unit b { font-size: 1.5rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown__unit small { font-size: .75rem; font-weight: 700; }
@media (max-width: 767.98px) {
  .countdown { width: 100%; }
  .countdown__label { width: 100%; }
  .countdown__unit { flex: 1; min-width: 0; }
}

/* --------------------------------------------------------------------------
   كتاب الأسبوع: غلافٌ كبير على خلفيّةٍ رماديّة بأشرطةٍ مائلة كصفحة الكتاب
   -------------------------------------------------------------------------- */
.feature { display: grid; gap: 28px; align-items: center; }
@media (min-width: 992px) { .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; } }
.feature__media { position: relative; padding: 36px; background: var(--n-100); overflow: hidden; isolation: isolate; }
.feature__media::before {
  content: ""; position: absolute; z-index: -1; inset-block-start: -60px; inset-inline-end: -20px; width: 80px; height: 340px;
  background: var(--store-primary); transform: rotate(-35deg);
}
.feature__media::after {
  content: ""; position: absolute; z-index: -1; inset-block-start: -40px; inset-inline-end: 90px; width: 14px; height: 340px;
  background: var(--store-accent); transform: rotate(-35deg);
}
.feature__cover { display: block; max-width: 280px; margin-inline: auto; }
.feature__cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 24px 48px rgba(0, 0, 0, .28); }
.feature__media .type-dot { position: absolute; inset-block-start: 20px; inset-inline-start: 20px; }
.feature__title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); }
.feature__title a:hover { color: var(--store-primary-dark); }
.feature__author { margin-block-start: 6px; color: var(--n-600); }
.feature__author a { color: var(--store-text); font-weight: 700; border-bottom: 2px solid var(--store-primary); }
.feature__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-block: 8px 16px; padding-block-end: 14px; border-block-end: 1px solid var(--n-200); }
.feature__desc { display: grid; gap: 10px; color: var(--n-600); max-width: 62ch; }
.feature__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-block-start: 22px; }

/* --------------------------------------------------------------------------
   المدوّنة: بطاقات المقالات، وصفحتا blog وpost
   -------------------------------------------------------------------------- */
.post-grid { display: grid; gap: 24px; }
@media (min-width: 768px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post-card { display: flex; flex-direction: column; background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--radius); overflow: hidden; transition: box-shadow .4s var(--ease); }
.post-card:hover { box-shadow: var(--shadow-hover); }
.post-card__media { position: relative; 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.06); }
.post-card__media::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 4px; background: var(--store-primary); }
.post-card__body { display: grid; gap: 8px; padding: 18px 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; }
@media (min-width: 992px) {
  .post-card--lead { flex-direction: row; grid-column: 1 / -1; }
  .post-card--lead .post-card__media { flex: 0 0 56%; }
  .post-card--lead .post-card__media img { height: 100%; }
  .post-card--lead .post-card__body { align-content: center; padding: 32px 36px; }
  .post-card--lead .post-card__title { font-size: 1.6rem; }
}
.blog-list { padding-block: 40px 72px; }
.blog-list .pagination { margin-block-start: 40px; }
.article { max-width: 780px; margin-inline: auto; padding-block: 40px 56px; }
.article__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--n-600); font-size: .9375rem; }
.article__meta time { color: var(--store-primary-dark); font-weight: 700; }
.article h1 { margin-block: 10px 18px; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); }
.article__img { position: relative; margin-block-end: 28px; }
.article__img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__img::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -6px; height: 6px; background: var(--store-primary); }
.article__body { display: grid; gap: 16px; font-size: 1.0625rem; line-height: 1.95; }
.article__body h2 { font-size: 1.375rem; margin-block-start: 10px; }
.article__body blockquote { margin: 0; padding: 14px 20px; background: var(--n-50); border-inline-start: 4px solid var(--store-primary); font-weight: 700; }
.article__books { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 26px; padding-block-start: 20px; border-top: 1px solid var(--n-200); }
.article__books span { color: var(--n-600); font-size: .9375rem; align-self: center; }

/* --------------------------------------------------------------------------
   صفحة الكتاب: المعرض، والنسخ المتاحة
   -------------------------------------------------------------------------- */
.gallery-thumbs { position: relative; z-index: 1; display: flex; justify-content: center; gap: 10px; margin-block-start: 22px; }
.gallery-thumbs button { width: 58px; padding: 0; border: 2px solid transparent; background: var(--n-0); opacity: .7; transition: opacity .3s, border-color .3s; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--store-primary); opacity: 1; }
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.formats { margin-block: 18px 4px; }
.formats__label { display: block; margin-block-end: 8px; 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; min-height: 52px; padding: 6px 14px 6px 12px;
  border: 1px solid var(--n-200); border-radius: var(--radius-sm); background: var(--n-0); transition: border-color .3s, background-color .3s;
}
.format:hover { border-color: var(--store-primary); }
.format.is-current { border-color: var(--store-accent); box-shadow: inset 0 -3px 0 var(--store-primary); }
.format .type-dot { --size: 28px; border-width: 1px; box-shadow: none; }
.format .type-dot .icon { width: 14px; height: 14px; }
.format__text { display: grid; line-height: 1.3; }
.format__name { font-weight: 700; font-size: .9375rem; }
.format__price { font-size: .8125rem; color: var(--n-600); }
/* تُخفى القائمة إن لم يكن للعنوان غير صيغةٍ واحدة */
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ [data-preview-copy])) { display: none; }
.perks__title { font-weight: 800; font-size: .9375rem; color: var(--store-text); margin-block-end: 2px; }
.product .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .product .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --------------------------------------------------------------------------
   صفحة التصنيف: التصنيفات الفرعيّة، والتبديل بين الشبكة والقائمة
   -------------------------------------------------------------------------- */
.subcats a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: .9375rem; transition: color .3s; }
.subcats a:hover { color: var(--store-primary-dark); }
.subcats a::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--store-primary); transform: skewX(-18deg); }
.subcats a > span:first-child { flex: 1; }
.subcats .check__count { margin: 0; }
.view-toggle { display: inline-flex; border: 1px solid var(--n-200); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { width: 42px; height: 42px; border: 0; display: grid; place-items: center; background: var(--n-0); color: var(--n-600); }
.view-toggle button + button { border-inline-start: 1px solid var(--n-200); }
.view-toggle button[aria-pressed="true"] { background: var(--store-accent); color: var(--on-dark); }
.view-toggle .icon { width: 18px; height: 18px; }
@media (max-width: 767.98px) { .view-toggle { display: none; } }
@media (min-width: 768px) {
  .book-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .book-grid.is-list .book-card { flex-direction: row; height: auto; border: 1px solid var(--n-200); }
  .book-grid.is-list .book-card__media { flex: 0 0 168px; padding: 14px; }
  .book-grid.is-list .book-card__body { padding: 8px 4px 16px; }
  .book-grid.is-list .book-card__buy { margin-block-start: 8px; justify-content: flex-start; gap: 24px; }
}

/* شاهدتَه مؤخّرًا: تملؤه المنصّة، ويُخفى إن كان فارغًا */
[data-slot="recent.items"]:empty, [data-region="product_recent"]:not(:has([data-slot="recent.items"] > *)) { display: none; }


/* --------------------------------------------------------------------------
   الهاتف: السلايدر والأقسام الطويلة صفوفٌ تُمرَّر أفقيًّا
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .hero .hero__nav { display: none; }
  .hero .slide { min-height: 0; }
  .hero .slide__body { padding-block: 16px 56px; }
}
@media (max-width: 767.98px) {
  .feature__media { padding: 24px; }
  .feature__cover { max-width: 190px; }
  .banner::before { width: 34px; height: 220px; inset-block-end: -150px; inset-inline-end: 14px; }
  .author-grid, .reviews-grid, .post-grid {
    display: grid; grid-auto-flow: column; grid-template-columns: none; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
  }
  .author-grid { grid-auto-columns: 44%; }
  .reviews-grid { grid-auto-columns: 84%; }
  .post-grid { grid-auto-columns: 84%; }
  .author-grid::-webkit-scrollbar, .reviews-grid::-webkit-scrollbar, .post-grid::-webkit-scrollbar { display: none; }
  .author-grid > *, .reviews-grid > *, .post-grid > * { scroll-snap-align: start; }
  .author-card__body { padding: 12px 8px; }
  .author-card__name { font-size: .9375rem; }
}

@media (max-width: 767.98px) {
  .blog-list .post-grid { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; margin-inline: 0; padding-inline: 0; }
}
.acc__body [data-slot="book.description"] { display: grid; gap: 12px; }
@media (max-width: 767.98px) {
  .product__media { padding: 28px 24px; }
  .product__cover { max-width: 220px; }
}

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