/* ==========================================================
   قالب «سراج» — منصّة ناشر
   كلّ تنسيق القالب هنا. ألوان الهويّة متغيّرات يختارها الناشر،
   وما سواها ألوان محايدة ثابتة.
   ========================================================== */

:root {
  /* ألوان الهويّة — قيم تجريبيّة يستبدلها الناشر */
  --store-primary: #FED700;
  --store-primary-dark: #E6C200;
  --store-accent: #333E48;
  --store-bg: #FFFFFF;
  --store-text: #333E48;

  /* ألوان محايدة ثابتة */
  --gray-50: #F7F7F7;
  --gray-100: #F2F2F2;
  --gray-200: #E6E6E6;
  --gray-300: #D9D9D9;
  --gray-500: #6B6F75;   /* أدنى رماديّ للنصوص: تباينه 5.1 على الأبيض */
  --white: #FFFFFF;
  --sale: #C62828;       /* سعر الخصم وشارته: دلالة لا هويّة */
  --star: #F2A900;       /* النجوم ذهبيّة دائمًا */

  /* ألوان أنواع الكتب — ثابتة بنصّ الوثيقة */
  --type-paper: #DB7056;
  --type-ebook: #5675A3;
  --type-audio: #986AB0;
  --type-edu: #3f8f6b;

  --font: "Tajawal", system-ui, sans-serif;
  --container: 1320px;
  --gutter: 16px;
  --radius: 10px;
  --radius-sm: 6px;
  --btn-radius: 999px;
  --shadow: 0 6px 22px rgba(20, 24, 30, .10);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* خيار الزوايا */
body[data-corners="sharp"] { --radius: 0; --radius-sm: 0; --btn-radius: 2px; }

/* ---------- أساسيّات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 176px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  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 { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, p { margin: 0; }
.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; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--store-accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* ==========================================================
   الأزرار
   ========================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 1.6em;
  border-radius: var(--btn-radius);
  font-weight: 700; font-size: 15px; line-height: 1;
  border: 2px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--store-primary); color: var(--store-accent); }
.btn--primary:hover { background: var(--store-primary-dark); }
.btn--dark { background: var(--store-accent); color: var(--white); }
.btn--dark:hover { background: var(--store-text); filter: brightness(1.15); }
.btn--outline { border-color: var(--store-accent); color: var(--store-accent); background: transparent; }
.btn--outline:hover { background: var(--store-accent); color: var(--white); }
.btn--light { background: var(--gray-100); color: var(--store-text); }
.btn--light:hover { background: var(--gray-200); }
.btn--sm { min-height: 36px; padding: 0 1.1em; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 2em; font-size: 16px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--gray-100); color: var(--gray-500); border-color: transparent; cursor: not-allowed; }

/* زرّ السلّة الدائريّ */
.btn-round {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--gray-200); color: var(--store-accent);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn-round .icon { width: 18px; height: 18px; }
.btn-round:hover { background: var(--store-primary); }
.btn-round[disabled] { opacity: .55; cursor: not-allowed; background: var(--gray-200); }
/* مساحة لمسٍ 40px على الأقلّ حول الدائرة الصغيرة دون تغيير حجمها الظاهر */
.btn-round { position: relative; }
.btn-round::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; }

/* ==========================================================
   الشريط العلويّ
   ========================================================== */
.topbar { border-bottom: 1px solid var(--gray-200); font-size: 13px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 16px; }
.topbar__links { display: flex; align-items: center; }
.topbar__links > li + li { border-inline-start: 1px solid var(--gray-200); }
.topbar__links a { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; color: var(--store-text); }
.topbar__links a:hover { text-decoration: underline; }
.topbar__links .icon { width: 15px; height: 15px; color: var(--gray-500); }
.topbar__welcome { color: var(--gray-500); }

/* ==========================================================
   الرأس
   ========================================================== */
/* الرأس مثبّت أعلى الشاشة؛ يمرّ الشريط العلويّ (41px) ويبقى الشعار والبحث وشريط التنقّل */
.header { position: sticky; top: -41px; z-index: 45; background: var(--store-bg); }
.header.is-scrolled { box-shadow: 0 4px 16px rgba(0, 0, 0, .06); }
.header__main { display: flex; align-items: center; gap: 32px; padding-block: 26px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.brand__logo { width: 52px; height: 52px; object-fit: contain; }
.brand__name { font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: var(--store-accent); }

.search { flex: 1; display: flex; height: 48px; border: 2px solid var(--store-primary); border-radius: var(--btn-radius); overflow: hidden; background: var(--white); }
.search__input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 22px; background: transparent; font-size: 15px; }
.search__input::placeholder { color: var(--gray-500); }
.search__select { border: 0; border-inline-start: 1px solid var(--gray-200); background: transparent; padding: 0 14px; font-size: 14px; color: var(--store-text); max-width: 160px; outline: 0; cursor: pointer; }
.search__btn { flex: none; width: 64px; background: var(--store-primary); color: var(--store-accent); display: grid; place-items: center; }
.search__btn:hover { background: var(--store-primary-dark); }
.search__btn .icon { width: 22px; height: 22px; stroke-width: 2.2; }

.header-icons { display: flex; align-items: center; gap: 6px; flex: none; }
.header-icon { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--store-accent); }
.header-icon:hover { background: var(--gray-100); }
.header-icon .icon { width: 24px; height: 24px; }
.header-icon__count {
  position: absolute; top: 2px; inset-inline-end: 0;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--store-primary); color: var(--store-accent);
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
  border: 2px solid var(--store-bg);
}
.header-cart { display: inline-flex; align-items: center; gap: 10px; padding-inline-start: 4px; }
.header-cart__total { font-weight: 800; font-size: 15px; white-space: nowrap; }
.menu-toggle { display: none; }

/* شريط التنقّل */
.navbar { background: var(--store-bg); border-bottom: 1px solid var(--gray-200); }
.navbar__inner { display: flex; align-items: stretch; gap: 28px; min-height: 52px; }
.departments { position: relative; width: 270px; flex: none; }
.departments__btn {
  width: 100%; height: 100%; min-height: 52px;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--store-primary); color: var(--store-accent);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 800; font-size: 15px;
}
.departments__btn .icon { width: 20px; height: 20px; }
.departments__btn .chev { margin-inline-start: auto; width: 16px; height: 16px; transition: transform .2s var(--ease); }
.departments__menu {
  position: absolute; inset-inline: 0; top: 100%; z-index: 40;
  background: var(--white); border: 2px solid var(--store-primary); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 0;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.departments.is-open .departments__menu,
.departments--static .departments__menu { opacity: 1; visibility: visible; transform: none; }
.departments.is-open .chev { transform: rotate(180deg); }
.departments--static .departments__menu { position: static; }
.departments--static .departments__btn { height: auto; }
.departments__menu a { display: flex; align-items: center; justify-content: space-between; padding: 9px 22px; font-size: 14.5px; }
.departments__menu a:hover { background: var(--gray-50); font-weight: 700; }
.departments__menu a .count { color: var(--gray-500); font-size: 12.5px; }
.departments__menu .is-strong { font-weight: 800; }
.departments__menu hr { border: 0; border-top: 1px solid var(--gray-200); margin: 6px 22px; }

.navlinks { display: flex; align-items: center; gap: 4px; flex: 1; }
.navlinks a { display: block; padding: 0 12px; line-height: 52px; font-weight: 700; font-size: 15px; position: relative; }
.navlinks a::after { content: ""; position: absolute; inset-inline: 12px; bottom: 4px; height: 2px; background: var(--store-primary); transform: scaleX(0); transition: transform .2s var(--ease); }
.navlinks a:hover::after, .navlinks a.is-active::after { transform: scaleX(1); }
.navbar__note { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.navbar__note .icon { width: 20px; height: 20px; }

/* ==========================================================
   الدرج الجانبيّ في الهاتف
   ========================================================== */
.drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; overflow: hidden; }
.drawer__overlay { position: absolute; inset: 0; background: rgba(20, 24, 30, .5); opacity: 0; transition: opacity .25s var(--ease); }
.drawer__panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0;
  width: min(330px, 86vw); background: var(--white);
  transform: translateX(100%); transition: transform .28s var(--ease);
  display: flex; flex-direction: column; overflow-y: auto;
}
[dir="ltr"] .drawer__panel { transform: translateX(-100%); }
.drawer.is-open { visibility: visible; }
.drawer.is-open .drawer__overlay { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--gray-200); }
.drawer__head .brand__name { font-size: 20px; }
.drawer__head .brand__logo { width: 40px; height: 40px; }
.drawer__close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.drawer__close:hover { background: var(--gray-100); }
.drawer__title { padding: 16px 16px 6px; font-size: 13px; font-weight: 800; color: var(--gray-500); }
.drawer__list a { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-weight: 500; }
.drawer__list a:hover { background: var(--gray-50); }
.drawer__list .icon { width: 16px; height: 16px; color: var(--gray-500); }
.drawer__foot { margin-top: auto; padding: 16px; background: var(--gray-50); display: grid; gap: 10px; font-size: 14px; }
.drawer__foot a { display: flex; align-items: center; gap: 8px; }
body.is-locked { overflow: hidden; }

/* ==========================================================
   عنوان القسم والتبويبات
   ========================================================== */
.section { padding-block: 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--gray-200); margin-bottom: 22px; }
.section-title { position: relative; font-size: 22px; font-weight: 800; padding-bottom: 12px; }
.section-title::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -1px; width: 100%; height: 2px; background: var(--store-primary); }
.section-link { display: inline-flex; align-items: center; gap: 4px; padding-bottom: 12px; font-size: 14px; font-weight: 700; }
.section-link:hover { text-decoration: underline; }
.section-link .icon { width: 16px; height: 16px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 6px 16px; border-radius: var(--btn-radius);
  border: 1px solid transparent; font-size: 14.5px; font-weight: 500; color: var(--store-text);
}
.tab:hover { border-color: var(--gray-300); }
.tab:is(.is-active, [aria-selected="true"]) { border-color: var(--store-primary); font-weight: 800; }
.tab-panel[hidden] { display: none; }

/* عناوين الأقسام ذات التبويبات في الوسط */
.section-head--center { justify-content: center; }
.section-head--center .tabs { padding-bottom: 14px; }
.section-head--center .tab:is(.is-active, [aria-selected="true"]) { position: relative; border-color: transparent; }
.section-head--center .tab:is(.is-active, [aria-selected="true"])::after { content: ""; position: absolute; inset-inline: 16px; bottom: -15px; height: 2px; background: var(--store-primary); }

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

.book-card {
  position: relative; display: flex; flex-direction: column;
  padding: 18px 18px 16px; background: var(--white);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.book-card__author { font-size: 13px; color: var(--gray-500); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card__author:hover { text-decoration: underline; }
.book-card__title { font-size: 15px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.book-card__title a:hover { text-decoration: underline; }

.cover { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--gray-100); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.book-card:hover .cover img { transform: scale(1.03); }
.book-card__media { position: relative; width: 78%; margin: 0 auto 14px; }
.book-card .cover { box-shadow: 0 6px 14px rgba(20, 24, 30, .14); }

/* المفضّلة والنظرة السريعة: تطفوان فوق أسفل الغلاف ولا تحجزان مكانًا؛ عند التحويم في الحاسوب، ودائمًا في اللمس */
.card-tools { position: absolute; inset-inline: 0; bottom: 10px; z-index: 3; display: flex; justify-content: center; gap: 8px; opacity: 0; transform: translateY(6px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
.card-tool { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--store-accent); box-shadow: 0 3px 10px rgba(20, 24, 30, .18); transition: background .2s var(--ease); }
.card-tool:hover { background: var(--store-primary); }
.card-tool .icon { width: 18px; height: 18px; }
.book-card:hover .card-tools, .book-card:focus-within .card-tools { opacity: 1; transform: none; }
@media (hover: none) { .card-tools { opacity: 1; transform: none; inset-inline: auto 8px; bottom: 8px; flex-direction: column; gap: 6px; } .card-tool { width: 34px; height: 34px; } }
.book-card__rating { margin-bottom: 8px; }

/* دائرة نوع الكتاب على ركن الغلاف */
.type-dot {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.type-dot .icon { width: 16px; height: 16px; 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); }

/* الشارات */
.badge {
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2;
  padding: 3px 9px; border-radius: var(--btn-radius);
  font-size: 12px; font-weight: 800; line-height: 1.5;
}
.badge--sale { background: var(--sale); color: var(--white); }
.badge--new { background: var(--store-accent); color: var(--white); }

/* نفدت الكمّيّة */
.cover__soldout {
  position: absolute; inset-inline: 0; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(255, 255, 255, .92); color: var(--store-text);
  text-align: center; font-weight: 800; font-size: 14px; padding: 8px 0;
}
.is-soldout .cover img { filter: grayscale(.85) opacity(.7); }

.book-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { display: flex; flex-direction: column; line-height: 1.25; }
.price__now { font-size: 18px; font-weight: 800; white-space: nowrap; }
.price__old { font-size: 13px; color: var(--gray-500); text-decoration: line-through; white-space: nowrap; }
.price--sale .price__now { color: var(--sale); }

[data-action="wishlist"][aria-pressed="true"] { color: var(--sale); }
[data-action="wishlist"][aria-pressed="true"] .icon { fill: currentColor; }

/* نمط البطاقة: كلاسيكيّة (الافتراضيّ) — فواصل بين البطاقات وإطار عند التحويم */
body:not([data-card-style]) .book-grid,
body[data-card-style="classic"] .book-grid { gap: 0; }
body:not([data-card-style]) .book-grid .book-card,
body[data-card-style="classic"] .book-grid .book-card { border: 1px solid transparent; }
body:not([data-card-style]) .book-grid .book-card::after,
body[data-card-style="classic"] .book-grid .book-card::after {
  content: ""; position: absolute; inset-inline-end: 0; top: 18%; bottom: 18%; width: 1px; background: var(--gray-200);
}
body:not([data-card-style]) .book-card:hover,
body[data-card-style="classic"] .book-card:hover { border-color: var(--gray-200); box-shadow: var(--shadow); border-radius: var(--radius); z-index: 3; }
body:not([data-card-style]) .book-card:hover::after,
body[data-card-style="classic"] .book-card:hover::after { display: none; }

/* مؤطَّرة */
body[data-card-style="framed"] .book-grid { gap: 16px; }
body[data-card-style="framed"] .book-card { border: 1px solid var(--gray-200); border-radius: var(--radius); }
body[data-card-style="framed"] .book-card:hover { border-color: var(--store-primary); box-shadow: var(--shadow); }

/* بسيطة */
body[data-card-style="minimal"] .book-grid { gap: 20px; }
body[data-card-style="minimal"] .book-card { padding: 0 0 8px; }
body[data-card-style="minimal"] .book-card__media { width: 100%; }

/* البطاقة الأفقيّة الصغيرة */
.book-row { display: flex; gap: 14px; padding: 14px; border-radius: var(--radius); transition: box-shadow .2s var(--ease); background: var(--white); }
.book-row:hover { box-shadow: var(--shadow); }
.book-row .cover { width: 72px; flex: none; }
.book-row .type-dot { width: 22px; height: 22px; top: 5px; inset-inline-end: 5px; }
.book-row .type-dot .icon { width: 12px; height: 12px; }
.book-row__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.book-row .book-card__title { min-height: 0; margin-bottom: 4px; font-size: 14.5px; }
.book-row__rating { margin-bottom: 8px; }
.book-row__rating .stars .icon { width: 13px; height: 13px; }
.book-row__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-row .btn-round { width: 34px; height: 34px; }
.book-row .price__now { font-size: 16px; }

/* ==========================================================
   التقييم والآراء
   ========================================================== */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-500); }
.stars { display: inline-flex; gap: 1px; color: var(--gray-300); }
.stars .icon { width: 15px; height: 15px; }
.stars .is-on { color: var(--star); }
.stars--lg .icon { width: 20px; height: 20px; }

.review { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 20px; background: var(--white); }
.review__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review__avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--gray-100); display: grid; place-items: center; font-weight: 800; color: var(--store-accent); flex: none; }
.review__name { font-weight: 800; font-size: 15px; }
.review__date { font-size: 12.5px; color: var(--gray-500); }
.review__head .stars { margin-inline-start: auto; }
.review__text { font-size: 14.5px; color: var(--store-text); }

.rating-summary { display: flex; align-items: center; gap: 22px; }
.rating-summary__score { font-size: 46px; font-weight: 800; line-height: 1; }
.rating-bars { flex: 1; display: grid; gap: 6px; font-size: 13px; }
.rating-bars__row { display: grid; grid-template-columns: 48px 1fr 32px; gap: 10px; align-items: center; }
.rating-bars__track { height: 7px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.rating-bars__fill { height: 100%; background: var(--star); border-radius: 4px; }

/* ==========================================================
   ترقيم الصفحات
   ========================================================== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: var(--btn-radius); font-weight: 700; font-size: 14.5px;
}
.pagination a:hover { background: var(--gray-100); }
.pagination .is-current { background: var(--store-primary); color: var(--store-accent); }
.pagination .is-gap { color: var(--gray-500); }
.pagination .icon { width: 18px; height: 18px; }
.pagination .is-disabled { color: var(--gray-300); pointer-events: none; }

/* ==========================================================
   شريط الثقة
   ========================================================== */
.trust { border: 1px solid var(--gray-200); border-radius: var(--radius); display: grid; grid-template-columns: repeat(4, 1fr); }
.trust__item { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.trust__item + .trust__item { border-inline-start: 1px solid var(--gray-200); }
.trust__icon { width: 46px; height: 46px; border-radius: 50%; background: var(--gray-100); display: grid; place-items: center; color: var(--store-accent); flex: none; }
.trust__icon .icon { width: 24px; height: 24px; }
.trust__title { font-weight: 800; font-size: 15px; }
.trust__text { font-size: 13px; color: var(--gray-500); }

/* ==========================================================
   عرض اليوم والعدّاد
   ========================================================== */
.deal { border: 2px solid var(--store-primary); border-radius: calc(var(--radius) * 2); padding: 22px; background: var(--white); display: flex; flex-direction: column; }
.deal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.deal__title { font-size: 20px; font-weight: 800; }
.deal__save { width: 70px; height: 70px; border-radius: 50%; background: var(--store-primary); color: var(--store-accent); display: grid; place-items: center; text-align: center; line-height: 1.1; font-size: 12px; font-weight: 700; }
.deal__save strong { display: block; font-size: 17px; font-weight: 800; }
.deal__main { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.deal__stage { flex: 1; display: grid; place-items: center; padding: 22px; border-radius: var(--radius); background: var(--gray-50); }
.deal .cover { width: 76%; box-shadow: 0 10px 22px rgba(20, 24, 30, .18); }
.deal__info { display: flex; flex-direction: column; align-items: center; text-align: center; }
.deal__name { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.deal__rating { margin-bottom: 6px; }
.deal__name a:hover { text-decoration: underline; }
.deal .price { flex-direction: row; justify-content: center; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.deal .deal-timer { width: 100%; }
.deal .price__now { font-size: 24px; }
.stock-bar { height: 10px; border-radius: 6px; background: var(--gray-200); overflow: hidden; margin-bottom: 16px; }
.stock-bar__fill { height: 100%; background: var(--store-primary); border-radius: 6px; }

/* ==========================================================
   الحقول
   ========================================================== */
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.input, .select {
  height: 46px; border: 1px solid var(--gray-300); border-radius: var(--btn-radius);
  padding: 0 18px; background: var(--white); outline: 0; width: 100%;
  transition: border-color .2s var(--ease);
}
.input:focus, .select:focus { border-color: var(--store-accent); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--gray-300); border-radius: var(--btn-radius); height: 46px; }
.qty button { width: 42px; height: 100%; display: grid; place-items: center; }
.qty button:hover { color: var(--store-accent); background: var(--gray-50); border-radius: var(--btn-radius); }
.qty button .icon { width: 16px; height: 16px; }
.qty input { width: 40px; border: 0; text-align: center; outline: 0; 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; }

/* ==========================================================
   التذييل
   ========================================================== */
.newsletter { background: var(--store-primary); color: var(--store-accent); }
.newsletter__inner { display: flex; align-items: center; gap: 28px; min-height: 92px; padding-block: 18px; }
.newsletter__lead { display: flex; align-items: center; gap: 14px; flex: none; }
.newsletter__lead .icon { width: 34px; height: 34px; stroke-width: 1.6; }
.newsletter__title { font-size: 19px; font-weight: 800; }
.newsletter__text { font-size: 14.5px; flex: 1; }
.newsletter__text strong { font-weight: 800; }
.newsletter__form { display: flex; flex: 0 1 460px; height: 48px; background: var(--white); border-radius: var(--btn-radius); overflow: hidden; }
.newsletter__form input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 22px; background: transparent; }
.newsletter__form input::placeholder { color: var(--gray-500); }
.newsletter__form .btn { border-radius: var(--btn-radius); min-height: 48px; }

.footer { background: var(--white); }
.footer__main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-block: 52px 40px; }
.footer__about .brand { margin-bottom: 22px; }
.footer__call { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.footer__call .icon { width: 44px; height: 44px; stroke-width: 1.3; color: var(--store-accent); }
.footer__call small { display: block; font-size: 13px; color: var(--gray-500); }
.footer__call strong { font-size: 20px; font-weight: 800; direction: ltr; display: inline-block; }
.footer__address { font-size: 14px; margin-bottom: 18px; }
.footer__address strong { display: block; font-weight: 800; }
.socials { display: flex; gap: 8px; }
.socials a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--store-accent); background: var(--gray-100); }
.socials a:hover { background: var(--store-primary); }
.socials .icon { width: 18px; height: 18px; }
.footer__col h4 { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.footer__col li + li { margin-top: 9px; }
.footer__col a { font-size: 14.5px; }
.footer__col a:hover { text-decoration: underline; }
.footer__bottom { background: var(--gray-100); font-size: 13.5px; }
.footer__bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding-block: 12px; flex-wrap: wrap; }
.pay-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12.5px; font-weight: 700; }
.pay-chip .icon { width: 16px; height: 16px; }

/* ==========================================================
   صفحة المكوّنات (للمراجعة فقط)
   ========================================================== */
.kit-hero { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding-block: 34px; }
.kit-hero h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.kit-hero p { color: var(--gray-500); max-width: 720px; }
.kit-block { padding-block: 34px; border-bottom: 1px dashed var(--gray-300); }
.kit-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--gray-500); margin-bottom: 18px; }
.kit-label::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--store-primary); }
.kit-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.kit-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kit-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; font-size: 12.5px; }
.swatch__color { height: 64px; }
.swatch__meta { padding: 8px 10px; }
.swatch__meta code { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--gray-500); direction: ltr; display: block; text-align: right; }
.kit-options { position: relative; z-index: 50; background: var(--store-accent); color: var(--white); font-size: 13.5px; }
.kit-options__inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 50px; padding-block: 8px; }
.kit-options__group { display: flex; align-items: center; gap: 6px; }
.kit-options button { padding: 4px 12px; border-radius: var(--btn-radius); border: 1px solid rgba(255, 255, 255, .35); color: var(--white); font-size: 13px; }
.kit-options button[aria-pressed="true"] { background: var(--store-primary); color: var(--store-accent); border-color: var(--store-primary); font-weight: 800; }
.kit-frame { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.kit-mobile { max-width: 390px; border: 1px solid var(--gray-200); border-radius: 22px; overflow: hidden; }

/* ==========================================================
   العروض: 1440 ← 768 ← 390
   ========================================================== */
@media (max-width: 1199px) {
  .header__main { gap: 20px; }
  .departments { width: 230px; }
  .navbar__note { display: none; }
  .footer__main { grid-template-columns: 1fr 1fr; }
  .newsletter__text { display: none; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .trust__item:nth-child(3) { border-inline-start: 0; }
  .trust__item:nth-child(n+3) { border-top: 1px solid var(--gray-200); }
}

@media (max-width: 991px) {
  .topbar__welcome { display: none; }
  .topbar__inner { justify-content: flex-end; }
  .header__main { flex-wrap: wrap; padding-block: 14px; gap: 12px 10px; }
  .menu-toggle { display: grid; order: 0; }
  .brand { order: 1; }
  .brand__logo { width: 42px; height: 42px; }
  .brand__name { font-size: 21px; }
  .header-icons { order: 2; margin-inline-start: auto; }
  .search { order: 3; flex-basis: 100%; height: 44px; }
  .search__select { display: none; }
  .header-cart__total { display: none; }
  .navbar { display: none; }
  .book-grid { --per-row: 3 !important; }
  .kit-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .book-grid { --per-row: 2 !important; }
  body:not([data-card-style]) .book-grid .book-card:nth-child(2n)::after,
  body[data-card-style="classic"] .book-grid .book-card:nth-child(2n)::after { display: none; }
  .book-card { padding: 14px 10px 12px; }
  .book-card__media { width: 88%; }
  .book-card__rating .stars .icon { width: 13px; height: 13px; }
  .book-card__title { font-size: 14px; }
  .price__now { font-size: 16px; }
  .btn-round { width: 36px; height: 36px; }
  .section-head:has(.tabs) { flex-direction: column; align-items: stretch; gap: 0; }
  .section-head .tabs { margin-top: 4px; }
  .section-title { font-size: 19px; align-self: flex-start; }
  .section-head--center .section-title { align-self: center; }
  .trust { grid-template-columns: 1fr 1fr; }
  .trust__item { flex-direction: column; text-align: center; gap: 8px; padding: 16px 10px; }
  .trust__text { display: none; }
  .newsletter__inner { flex-direction: column; align-items: stretch; gap: 14px; padding-block: 22px; }
  .newsletter__lead { justify-content: center; }
  .newsletter__form { flex-basis: auto; }
  .newsletter__form .btn { padding: 0 1.1em; }
  .footer__main { grid-template-columns: 1fr 1fr; gap: 28px 18px; padding-block: 36px 28px; }
  .footer__about { grid-column: 1 / -1; }
  .footer__bottom-inner { justify-content: center; text-align: center; }
  .kit-cols { grid-template-columns: 1fr; }
  .rating-summary { flex-direction: column; align-items: stretch; text-align: center; }
  .review__head { flex-wrap: wrap; }
  .topbar__links a { padding: 0 10px; }
  .topbar__links .hide-sm { display: none; }
  .header-icon { width: 40px; height: 40px; }
  .header-icons .hide-sm { display: none; }
  .header__main { gap: 10px 4px; }
  .brand { gap: 8px; }
}

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

/* ==========================================================
   الرئيسيّة
   ========================================================== */

/* قائمة التصنيفات مثبَّتة مفتوحة بجانب السلايدر في الحاسوب */
@media (min-width: 1200px) {
  .departments--pinned .departments__menu { opacity: 1; visibility: visible; transform: none; height: 460px; overflow-y: auto; }
  .departments--pinned .departments__btn .chev { display: none; }
  .departments--pinned .departments__btn { cursor: default; }
  /* بعد النزول تُطوى القائمة المثبَّتة وتعود منسدلةً عاديّة حتّى لا تغطّي المحتوى */
  .header.is-scrolled .departments--pinned:not(.is-open) .departments__menu { opacity: 0; visibility: hidden; transform: translateY(6px); }
  .header.is-scrolled .departments--pinned .departments__btn { cursor: pointer; }
  .header.is-scrolled .departments--pinned .departments__btn .chev { display: block; }
  .hero__inner { padding-inline-start: 298px; }
}

.hero { padding-top: 22px; }
.slider { position: relative; height: 460px; border-radius: calc(var(--radius) * 1.6); overflow: hidden; background: var(--gray-100); }
.slide {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px;
  padding: 40px 64px;
  opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility .6s;
}
.slide.is-active { opacity: 1; visibility: visible; }
.slide__kicker { font-size: 15px; font-weight: 700; color: var(--gray-500); margin-bottom: 8px; }
.slide__title { font-size: 44px; font-weight: 800; line-height: 1.15; margin-bottom: 12px; }
.slide__title mark { background: none; color: inherit; box-shadow: inset 0 -.32em 0 var(--store-primary); }
.slide__text { font-size: 17px; color: var(--gray-500); margin-bottom: 22px; max-width: 420px; }
.slide__price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 24px; }
.slide__price small { font-size: 14px; font-weight: 700; color: var(--gray-500); }
.slide__price strong { font-size: 34px; font-weight: 800; }
.slide__media { position: relative; display: grid; place-items: center; height: 100%; }
.slide__media::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: var(--store-primary); }
.slide__media img { position: relative; height: 340px; width: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); box-shadow: 0 18px 36px rgba(20, 24, 30, .28); transform: rotate(-4deg); }
.slide.is-active .slide__media img { animation: slideIn .7s var(--ease) both; }
@keyframes slideIn { from { transform: translateY(18px) rotate(-4deg); opacity: 0; } to { transform: rotate(-4deg); opacity: 1; } }
.slider__dots { position: absolute; bottom: 18px; inset-inline: 0; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.slider__dot { width: 10px; height: 10px; border-radius: 5px; background: var(--gray-300); transition: width .25s var(--ease), background .25s; }
.slider__dot.is-active { width: 28px; background: var(--store-accent); }
.slider__arrow { position: absolute; top: 50%; z-index: 3; width: 42px; height: 42px; margin-top: -21px; border-radius: 50%; background: var(--white); display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; }
.slider:hover .slider__arrow, .slider__arrow:focus-visible { opacity: 1; }
.slider__arrow--prev { inset-inline-start: 14px; }
.slider__arrow--next { inset-inline-end: 14px; }
.slider__arrow .icon { width: 20px; height: 20px; }

/* البانرات الصغيرة */
.promos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 24px; }
.promo { display: block; border-radius: var(--radius); overflow: hidden; background: var(--gray-100); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.promo:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.promo { position: relative; }
.promo img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.promo__body { position: absolute; inset-block: 0; inset-inline-start: 0; width: 58%; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px 16px; color: var(--store-text); }
.promo__title { font-size: 18px; white-space: nowrap; font-weight: 800; line-height: 1.3; }
.promo__text { font-size: 13.5px; }
.promo__cta { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 8px; padding-bottom: 2px; border-bottom: 2px solid currentColor; font-size: 13.5px; font-weight: 800; }
.promo__cta .icon { width: 14px; height: 14px; }

/* عرض اليوم بجانب التبويبات */
.deal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 28px; align-items: stretch; }
.book-grid--3 { --per-row: 3 !important; }
.book-grid--4 { --per-row: 4 !important; }

/* مختارات حسب التصنيف: كتاب مميّز في الوسط */
/* قائمة كتب واحدة حول الكتاب المميّز: أربع بطاقات على كلّ جانب */
.featured-layout { display: grid; grid-template-columns: repeat(2, minmax(0, .5fr)) minmax(0, 1.15fr) repeat(2, minmax(0, .5fr)); align-items: stretch; }
.featured-layout > .book-grid { display: contents; }
.featured-layout > .book-grid > :nth-child(n+9) { display: none; }
.featured-layout > .book-feature { grid-column: 3; grid-row: 1 / span 2; }
body[data-card-style="framed"] .featured-layout { gap: 16px; }
body[data-card-style="minimal"] .featured-layout { gap: 20px; }
.book-feature { display: flex; flex-direction: column; justify-content: center; padding: 22px 26px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white); text-align: center; }
.book-feature .book-card__author { margin-bottom: 4px; }
.book-feature .book-card__title { font-size: 19px; min-height: 0; margin-bottom: 8px; }
.book-feature .cover { width: 62%; margin: 0 auto 16px; box-shadow: 0 12px 26px rgba(20, 24, 30, .2); }
.book-feature .rating { justify-content: center; margin-bottom: 12px; }
.book-feature .price { flex-direction: row; justify-content: center; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.book-feature .price__now { font-size: 24px; }
.book-feature__desc { font-size: 14px; color: var(--gray-500); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-feature .btn { align-self: center; padding-inline: 2.4em; }

/* التصنيفات */
.cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 12px 18px; border-radius: var(--radius); background: var(--gray-50); border: 1px solid transparent; transition: border-color .2s var(--ease), background .2s; }
.cat-tile:hover { border-color: var(--store-primary); background: var(--white); }
.cat-tile img { width: 72%; aspect-ratio: 1; object-fit: contain; margin-bottom: 8px; transition: transform .3s var(--ease); }
.cat-tile:hover img { transform: translateY(-4px); }
.cat-tile__name { font-weight: 800; font-size: 15px; }
.cat-tile__count { font-size: 13px; color: var(--gray-500); }

/* الأكثر مبيعًا: بطاقات أفقيّة */
.rows-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }

/* البانر العريض */
.banner-wide { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #2E3842; color: var(--white); }
.banner-wide img { width: 100%; height: auto; min-height: 200px; object-fit: cover; object-position: left center; }
.banner-wide__body { position: absolute; inset-block: 0; inset-inline-start: 0; width: 50%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 20px 48px; }
.banner-wide__title { font-size: 30px; font-weight: 800; line-height: 1.25; }
.banner-wide__text { font-size: 16px; color: #E3E7EB; margin-bottom: 8px; }

/* الدوّارات الأفقيّة */
.scroller { position: relative; }
.scroller__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% / var(--per-row, 5)); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.scroller__track::-webkit-scrollbar { display: none; }
.scroller__track > * { scroll-snap-align: start; }
.scroller__track.book-grid { grid-template-columns: none; }
.scroller-nav { display: flex; gap: 6px; padding-bottom: 10px; }
.scroller-nav button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-100); }
.scroller-nav button:hover { background: var(--store-primary); }
.scroller-nav button:disabled { opacity: .4; cursor: default; background: var(--gray-100); }
.scroller-nav .icon { width: 18px; height: 18px; }

/* المؤلّفون */
.scroller--authors .scroller__track { grid-auto-columns: calc(100% / 6); }
.author-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 8px; }
.author-card img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; border: 4px solid var(--white); box-shadow: 0 0 0 2px var(--gray-200); transition: box-shadow .2s var(--ease); }
.author-card:hover img { box-shadow: 0 0 0 3px var(--store-primary); }
.author-card__name { font-weight: 800; font-size: 15px; }
.author-card__count { font-size: 13px; color: var(--gray-500); }

@media (max-width: 1199px) {
  .slider { height: 400px; }
  .slide { padding: 32px 40px; }
  .slide__title { font-size: 36px; }
  .slide__media img { height: 290px; }
  .slide__media::before { width: 250px; height: 250px; }
  .deal-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .deal-layout .book-grid--4 { --per-row: 3 !important; }
  .rows-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scroller--authors .scroller__track { grid-auto-columns: calc(100% / 5); }
}

@media (max-width: 991px) {
  .promos { grid-template-columns: repeat(2, 1fr); }
  .deal-layout { grid-template-columns: 1fr; }
  .deal-layout .book-grid--4 { --per-row: 3 !important; }
  .deal-layout .deal { max-width: 460px; width: 100%; margin-inline: auto; }
  .deal-layout .book-grid > :nth-child(n+7) { display: none; }
  .deal .cover { width: 42%; }
  .featured-layout { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 0; }
  .featured-layout > .book-feature { grid-column: 1 / -1; grid-row: auto; }
  .book-feature { grid-column: 1 / -1; order: -1; display: grid; grid-template-columns: 200px 1fr; text-align: start; gap: 0 26px; align-items: center; }
  .book-feature .cover { grid-row: 1 / span 7; width: 100%; margin: 0; }
  .book-feature .rating, .book-feature .price { justify-content: flex-start; }
  .book-feature .btn { margin-top: 0; justify-self: start; align-self: start; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rows-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scroller__track { --per-row: 3 !important; }
  .scroller--authors .scroller__track { grid-auto-columns: calc(100% / 4); }
}

@media (max-width: 767px) {
  .hero { padding-top: 12px; }
  .slider { height: 560px; }
  .slide { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 26px 22px 58px; text-align: center; gap: 8px; }
  .slide__media { order: -1; height: 230px; }
  .slide__media::before { width: 190px; height: 190px; }
  .slide__media img { height: 210px; }
  .slide__title { font-size: 27px; }
  .slide__text { font-size: 15px; margin: 0 auto 14px; }
  .slide__price { justify-content: center; margin-bottom: 16px; }
  .slide__price strong { font-size: 26px; }
  .slider__arrow { display: none; }
  .promos { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
  .promos::-webkit-scrollbar { display: none; }
  .promo { scroll-snap-align: start; }
  .deal-layout .book-grid--4 { --per-row: 2 !important; }
  .deal-layout .book-grid > :nth-child(n+5) { display: none; }
  .featured-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-layout > .book-grid > :nth-child(n+5) { display: none; }
  .book-feature { grid-template-columns: 120px 1fr; gap: 0 16px; padding: 16px; }
  .book-feature .book-card__title { font-size: 16px; }
  .book-feature .btn { min-height: 40px; font-size: 14px; padding: 0 1.1em; }
  .cat-grid { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 38%; overflow-x: auto; scrollbar-width: none; gap: 10px; }
  .cat-grid::-webkit-scrollbar { display: none; }
  .rows-grid { grid-template-columns: 1fr; }
  .rows-grid > :nth-child(n+5) { display: none; }
  .scroller__track { --per-row: 2 !important; }
  .scroller--authors .scroller__track { grid-auto-columns: calc(100% / 3); }
  .author-card img { width: 92px; height: 92px; }
}

/* ==========================================================
   صفحة التصنيف والبحث والعروض
   ========================================================== */
.breadcrumb { padding-block: 18px; font-size: 13.5px; color: var(--gray-500); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "/"; color: var(--gray-300); }
.breadcrumb a:hover { color: var(--store-text); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--store-text); font-weight: 700; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--gray-200); margin-bottom: 24px; }
.page-title { font-size: 30px; font-weight: 800; line-height: 1.2; }
.page-title small { font-size: 15px; font-weight: 500; color: var(--gray-500); margin-inline-start: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--btn-radius); background: var(--gray-100); font-size: 14px; font-weight: 500; }
.chip:hover { background: var(--gray-200); }
.chip.is-active { background: var(--store-primary); color: var(--store-accent); font-weight: 800; }
.chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
.chip button:hover { background: var(--gray-300); }
.chip .icon { width: 12px; height: 12px; stroke-width: 2.4; }

.shop-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 48px; }

/* لوحة التصفية: ثابتة في الحاسوب، ودرج في الهاتف */
.filter-block { border-bottom: 1px solid var(--gray-200); padding-block: 18px; }
.filter-block:first-child { padding-top: 0; }
.filter-block h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.filter-list li + li { margin-top: 8px; }
.filter-list a { display: flex; justify-content: space-between; font-size: 14.5px; }
.filter-list a:hover { text-decoration: underline; }
.filter-list a.is-active { font-weight: 800; }
.filter-list .count { color: var(--gray-500); font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border: 2px solid var(--gray-300); border-radius: 5px; display: grid; place-items: center; cursor: pointer; background: var(--white); }
.check input:checked { background: var(--store-accent); border-color: var(--store-accent); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--white); border-top: 0; border-inline-end: 0; transform: translateY(-1px) rotate(-45deg); }
[dir="rtl"] .check input:checked::after { transform: translateY(-1px) rotate(-45deg) scaleX(-1); }
.check .count { margin-inline-start: auto; color: var(--gray-500); font-size: 13px; }
.check .type-dot { position: static; width: 22px; height: 22px; box-shadow: none; }
.check .type-dot .icon { width: 12px; height: 12px; }
.check .stars .icon { width: 14px; height: 14px; }
.price-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 12px; }
.price-range .input { height: 40px; padding: 0 12px; text-align: center; }
.price-range span { color: var(--gray-500); font-size: 13px; }
.filters-actions { display: none; }

@media (min-width: 992px) {
  .drawer--filters { position: static; visibility: visible; overflow: visible; z-index: auto; }
  .drawer--filters .drawer__overlay, .drawer--filters .drawer__head { display: none; }
  .drawer--filters .drawer__panel { position: static; width: auto; transform: none; overflow: visible; background: transparent; }
}
@media (max-width: 991px) {
  .drawer--filters .drawer__panel { padding: 0 16px 16px; }
  .drawer--filters .drawer__head { margin-inline: -16px; margin-bottom: 18px; }
  .drawer--filters .drawer__head h2 { font-size: 18px; font-weight: 800; }
  .filters-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; bottom: 0; background: var(--white); padding-top: 14px; margin-top: auto; }
}

/* شريط الأدوات فوق الشبكة */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--gray-50); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.toolbar__count { font-size: 14px; color: var(--gray-500); }
.toolbar__count strong { color: var(--store-text); }
.toolbar__tools { display: flex; align-items: center; gap: 10px; }
.toolbar .select { height: 40px; width: auto; padding: 0 14px; font-size: 14px; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--gray-500); }
.view-toggle button[aria-pressed="true"] { background: var(--white); color: var(--store-accent); box-shadow: 0 1px 4px rgba(20, 24, 30, .12); }
.view-toggle .icon { width: 20px; height: 20px; }
.filters-btn { display: none; }
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; font-size: 14px; }
.active-filters__clear { font-weight: 700; text-decoration: underline; font-size: 13.5px; }

.shop-grid { --per-row: 4 !important; margin-bottom: 32px; }
.book-card__desc { display: none; }

/* عرض القائمة */
.shop-grid.is-list { grid-template-columns: 1fr; gap: 0 !important; }
.shop-grid.is-list .book-card {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr auto;
  column-gap: 24px; padding: 20px 8px; border: 0 !important; border-bottom: 1px solid var(--gray-200) !important; border-radius: 0 !important; box-shadow: none !important;
}
.shop-grid.is-list .book-card::after { display: none; }
.shop-grid.is-list .book-card__media { grid-column: 1; grid-row: 1 / -1; width: 100%; margin: 0; }
.shop-grid.is-list .book-card__author { grid-column: 2; grid-row: 1; }
.shop-grid.is-list .book-card__title { grid-column: 2; grid-row: 2; min-height: 0; font-size: 18px; margin-bottom: 6px; }
.shop-grid.is-list .book-card__desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; grid-column: 2; grid-row: 3; font-size: 14.5px; color: var(--gray-500); }
.shop-grid.is-list .book-card__rating { grid-column: 2; grid-row: 4; margin: 8px 0 0; }
.shop-grid.is-list .book-card__foot { grid-column: 3; grid-row: 1 / -1; flex-direction: column; align-items: flex-end; justify-content: center; gap: 12px; margin: 0; }
.shop-grid.is-list .book-card:hover .cover img { transform: none; }

.empty-state { text-align: center; padding: 60px 20px; border: 1px dashed var(--gray-300); border-radius: var(--radius); }
.empty-state .icon { width: 48px; height: 48px; color: var(--gray-500); margin: 0 auto 12px; }

@media (max-width: 1199px) {
  .shop-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 24px; }
  .shop-grid { --per-row: 3 !important; }
}
@media (max-width: 991px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filters-btn { display: inline-flex; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: 25px; }
  .shop-grid.is-list .book-card { grid-template-columns: 110px minmax(0, 1fr); }
  .shop-grid.is-list .book-card__foot { grid-column: 2; grid-row: 5; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 10px; }
  .shop-grid.is-list .book-card__desc { -webkit-line-clamp: 2; }
}
@media (max-width: 767px) {
  .shop-grid { --per-row: 2 !important; }
  .toolbar { padding: 8px; }
  .toolbar__count { width: 100%; order: 3; font-size: 13px; }
  .toolbar__tools { width: 100%; justify-content: space-between; }
  .toolbar .select { flex: 1; min-width: 0; }
  .view-toggle { display: none; }
  .page-head .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .page-head .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
}

/* ==========================================================
   صفحة الكتاب
   ========================================================== */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 300px; gap: 36px; align-items: start; padding-bottom: 40px; }
.product__gallery { position: sticky; top: 176px; }
.product__stage { position: relative; background: var(--gray-50); border-radius: calc(var(--radius) * 1.4); padding: 36px 40px; display: grid; place-items: center; }
.product__stage .cover { width: 100%; max-width: 330px; box-shadow: 0 18px 38px rgba(20, 24, 30, .25); }
.product__stage .type-dot { width: 38px; height: 38px; top: 12px; inset-inline-end: 12px; }
.product__stage .type-dot .icon { width: 20px; height: 20px; }
.product__stage .badge { top: 12px; inset-inline-start: 12px; font-size: 13px; padding: 4px 12px; }
.gallery-thumbs { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.gallery-thumbs button { width: 64px; padding: 4px; border-radius: var(--radius-sm); border: 2px solid var(--gray-200); background: var(--white); }
.gallery-thumbs button[aria-current="true"] { border-color: var(--store-primary); }
.gallery-thumbs img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; }

.product__author { display: inline-block; font-size: 15px; color: var(--gray-500); margin-bottom: 6px; }
.product__author a { color: var(--store-text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--store-primary); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.product__title { font-size: 32px; font-weight: 800; line-height: 1.25; margin-bottom: 12px; }
.product__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding-bottom: 18px; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; font-size: 14px; }
.product__meta a:hover { text-decoration: underline; }
.type-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.type-label .type-dot { position: static; width: 24px; height: 24px; box-shadow: none; }
.type-label .type-dot .icon { width: 13px; height: 13px; }
.product__lead { font-size: 16px; line-height: 1.8; margin-bottom: 20px; }
.spec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-bottom: 22px; font-size: 14.5px; }
.spec-list div { display: flex; gap: 8px; }
.spec-list dt { color: var(--gray-500); white-space: nowrap; }
.spec-list dd { margin: 0; font-weight: 700; }
.formats h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.formats__list { display: flex; flex-wrap: wrap; gap: 10px; }
.format { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid var(--gray-200); border-radius: var(--radius); min-width: 150px; }
.format:hover { border-color: var(--gray-300); }
.format.is-current { border-color: var(--store-primary); background: var(--gray-50); }
.format .type-dot { position: static; width: 28px; height: 28px; box-shadow: none; }
.format .type-dot .icon { width: 15px; height: 15px; }
.format__text strong { display: block; font-size: 14px; }
.format__text span { font-size: 13px; color: var(--gray-500); }

/* صندوق الشراء */
.buybox { position: sticky; top: 176px; border: 1px solid var(--gray-200); border-radius: calc(var(--radius) * 1.4); padding: 22px; background: var(--white); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.buybox .price { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buybox .price__now { font-size: 30px; }
.buybox .price__old { font-size: 16px; }
.save-note { font-size: 13.5px; font-weight: 700; color: var(--sale); }
.stock { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.stock::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #2E7D32; }
.stock--low::before { background: #E07B00; }
.stock--out::before { background: var(--sale); }
.buybox__row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.buybox__row .btn { min-width: 0; padding-inline: .8em; overflow: hidden; text-overflow: ellipsis; }
.buybox__row .btn .icon { display: none; }
.buybox .qty button { width: 34px; }
.buybox .qty input { width: 34px; }
@media (max-width: 1199px) { .buybox__row .btn .icon { display: inline-block; } }
.buybox__perks { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--gray-200); font-size: 13.5px; }
.buybox__perks li { display: flex; gap: 10px; align-items: flex-start; }
.buybox__perks .icon { width: 20px; height: 20px; color: var(--store-accent); margin-top: 1px; }
.buybox__perks strong { display: block; font-size: 14px; }
.buybox__perks span { color: var(--gray-500); }
.buybox__links { display: flex; justify-content: center; gap: 18px; font-size: 13.5px; color: var(--gray-500); }
.buybox__links button { display: inline-flex; align-items: center; gap: 6px; }
.buybox__links button:hover { color: var(--store-text); }
.buybox__links .icon { width: 16px; height: 16px; }

/* تبويبات التفاصيل */
.details { padding-block: 10px 30px; }
.details .section-head { justify-content: center; }
.details .tabs { padding-bottom: 14px; }
.details .tab { font-size: 16px; }
.prose { max-width: 820px; margin-inline: auto; font-size: 16px; line-height: 1.95; }
.prose p + p { margin-top: 14px; }
.prose h3 { font-size: 19px; font-weight: 800; margin: 22px 0 8px; }
.spec-table { width: 100%; max-width: 820px; margin-inline: auto; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--gray-200); }
.spec-table th { width: 34%; color: var(--gray-500); font-weight: 500; background: var(--gray-50); }
.spec-table td { font-weight: 700; }
.reviews-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; max-width: 1080px; margin-inline: auto; align-items: start; }
.reviews-list { display: grid; gap: 14px; }
.review-form { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; margin-top: 16px; display: grid; gap: 12px; }
.review-form h3 { font-size: 16px; font-weight: 800; }
.star-input { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: var(--gray-300); }
.star-input label .icon { width: 26px; height: 26px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-accent); border-radius: 4px; }
.textarea { width: 100%; min-height: 110px; border: 1px solid var(--gray-300); border-radius: var(--radius); padding: 12px 16px; font: inherit; resize: vertical; outline: 0; }
.textarea:focus { border-color: var(--store-accent); }

/* بطاقة المؤلّف داخل صفحة الكتاب */
.author-box { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 22px; align-items: center; background: var(--gray-50); border-radius: calc(var(--radius) * 1.4); padding: 24px; }
.author-box img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--white); }
.author-box h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.author-box p { color: var(--gray-500); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* شريط الشراء الثابت في الهاتف */
.sticky-buy { display: none; }

@media (max-width: 1199px) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .buybox { grid-column: 2; position: static; }
  .product__gallery { grid-row: span 2; }
}
@media (max-width: 991px) {
  .product { grid-template-columns: 1fr; gap: 24px; }
  .product__gallery { position: static; grid-row: auto; }
  .buybox { grid-column: auto; }
  .product__stage { padding: 28px; }
  .product__stage .cover { max-width: 260px; }
  .product__title { font-size: 26px; }
  .reviews-layout { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .product__stage .cover { max-width: 210px; }
  .product__title { font-size: 23px; }
  .spec-list { grid-template-columns: 1fr; }
  .formats__list { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .format { min-width: 0; }
  .format__text { display: flex; justify-content: space-between; align-items: baseline; flex: 1; gap: 8px; }
  .buybox .price__now { font-size: 26px; }
  .author-box { grid-template-columns: 72px minmax(0, 1fr); padding: 18px; gap: 14px; }
  .author-box img { width: 72px; height: 72px; }
  .author-box .btn { grid-column: 1 / -1; }
  .spec-table th { width: 42%; }
  .sticky-buy {
    display: flex; align-items: center; gap: 12px;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    background: var(--white); border-top: 1px solid var(--gray-200);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(20, 24, 30, .08);
  }
  .sticky-buy .price__now { font-size: 18px; }
  .sticky-buy .btn { flex: 1; }
  body.has-sticky-buy { padding-bottom: 72px; }
}

/* ==========================================================
   صفحة الكتاب الصوتيّ
   ========================================================== */
.sample-player { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--gray-200); border-radius: var(--btn-radius); background: var(--white); }
.sample-player__btn { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--store-primary); color: var(--store-accent); display: grid; place-items: center; }
.sample-player__btn:hover { background: var(--store-primary-dark); }
.sample-player__btn .icon { width: 20px; height: 20px; }
.sample-player__btn .i-pause { display: none; }
.sample-player__btn[aria-pressed="true"] .i-play { display: none; }
.sample-player__btn[aria-pressed="true"] .i-pause { display: block; }
.sample-player__body { flex: 1; min-width: 0; }
.sample-player__label { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.wave { display: flex; align-items: center; gap: 2px; height: 26px; }
.wave span { flex: 1; background: var(--gray-300); border-radius: 2px; min-width: 2px; }
.wave span.is-played { background: var(--store-accent); }
.sample-player__time { font-size: 12.5px; color: var(--gray-500); font-variant-numeric: tabular-nums; direction: ltr; flex: none; }
.duration-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.duration-chip .icon { width: 17px; height: 17px; color: var(--gray-500); }

.chapters { list-style: none; padding: 0; margin-block: 0; max-width: 820px; margin-inline: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.chapters li { display: flex; align-items: center; gap: 14px; padding: 12px 18px; font-size: 15px; }
.chapters li + li { border-top: 1px solid var(--gray-200); }
.chapters li:nth-child(odd) { background: var(--gray-50); }
.chapters__num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--white); border: 1px solid var(--gray-200); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.chapters__title { flex: 1; min-width: 0; }
.chapters__time { color: var(--gray-500); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chapters__lock { width: 16px; height: 16px; color: var(--gray-500); }
.chapters .is-free .chapters__time { color: var(--store-text); font-weight: 700; }

/* ==========================================================
   صفحة الوسيلة التعليميّة
   ========================================================== */
.edu-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.edu-fact { display: flex; align-items: center; gap: 10px; padding: 12px; min-width: 0; border-radius: var(--radius); background: var(--gray-50); border: 1px solid var(--gray-200); }
.edu-fact__icon { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--type-edu); color: var(--white); }
.edu-fact__icon .icon { width: 21px; height: 21px; }
.edu-fact small { display: block; font-size: 12.5px; color: var(--gray-500); }
.edu-fact strong { font-size: 15px; font-weight: 800; white-space: nowrap; }
.safety-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: #FFF6E5; color: #6B4600; font-size: 13.5px; margin-bottom: 22px; }
.safety-note .icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
@media (max-width: 767px) {
  .edu-facts { grid-template-columns: 1fr 1fr; }
  .edu-fact:last-child { grid-column: 1 / -1; }
}

/* ==========================================================
   صفحة المؤلّف
   ========================================================== */
.author-hero { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding-block: 36px; margin-bottom: 30px; }
.author-hero__inner { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 36px; align-items: center; }
.author-hero__photo { position: relative; width: 180px; height: 180px; }
.author-hero__photo::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--store-primary); }
.author-hero__photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.author-hero__kicker { font-size: 14px; font-weight: 700; color: var(--gray-500); margin-bottom: 4px; }
.author-hero h1 { font-size: 34px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.author-hero__bio { font-size: 16px; line-height: 1.85; max-width: 760px; margin-bottom: 18px; }
.author-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.author-stat { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--btn-radius); background: var(--white); border: 1px solid var(--gray-200); font-size: 14px; }
.author-stat strong { font-weight: 800; font-size: 15px; }
.author-stat > .icon { width: 17px; height: 17px; color: var(--gray-500); }
.author-works .section-head { flex-wrap: wrap; }
@media (max-width: 991px) {
  .author-hero__inner { grid-template-columns: 130px minmax(0, 1fr); gap: 24px; }
  .author-hero__photo { width: 130px; height: 130px; }
  .author-hero h1 { font-size: 28px; }
}
@media (max-width: 767px) {
  .author-hero { padding-block: 26px; }
  .author-hero__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 18px; }
  .author-hero__photo { width: 120px; height: 120px; }
  .author-hero h1 { font-size: 25px; }
  .author-hero__bio { font-size: 15px; }
  .author-stats { justify-content: center; }
}

/* ==========================================================
   السلّة
   ========================================================== */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; padding-bottom: 56px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table thead th { text-align: start; font-size: 13.5px; font-weight: 700; color: var(--gray-500); padding: 0 12px 12px; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
.cart-table td { padding: 18px 12px; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
.cart-item__product { display: flex; align-items: center; gap: 16px; }
.cart-item__product .cover { width: 72px; flex: none; }
.cart-item__product .type-dot { width: 22px; height: 22px; top: 4px; inset-inline-end: 4px; }
.cart-item__product .type-dot .icon { width: 12px; height: 12px; }
.cart-item__title { font-weight: 800; font-size: 15.5px; line-height: 1.4; }
.cart-item__title a:hover { text-decoration: underline; }
.cart-item__author { font-size: 13.5px; color: var(--gray-500); }
.cart-item__type { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; margin-top: 4px; }
.cart-item__type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cart-item__type--paper { color: #9E4A35; }
.cart-item__type--ebook { color: #3F5A82; }
.cart-item__type--audio { color: #73498A; }
.cart-item__type--edu { color: #2D6B4F; }
.cart-item__price, .cart-item__total { font-weight: 800; white-space: nowrap; }
.cart-item__price .price__old { display: block; font-weight: 500; }
.cart-item__total { font-size: 16px; }
.cart-item .qty { height: 40px; }
.cart-item .qty button { width: 34px; }
.cart-item .qty input { width: 34px; }
.qty-fixed { display: inline-block; font-size: 13px; color: var(--gray-500); white-space: nowrap; }
.remove-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--gray-500); }
.remove-btn:hover { background: #FDECEC; color: var(--sale); }
.remove-btn .icon { width: 18px; height: 18px; }

.cart-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 20px; }
.coupon { display: flex; height: 46px; border: 1px solid var(--gray-300); border-radius: var(--btn-radius); overflow: hidden; flex: 0 1 420px; background: var(--white); }
.coupon:focus-within { border-color: var(--store-accent); }
.coupon input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 18px; background: transparent; }
.coupon .btn { border-radius: var(--btn-radius); min-height: 44px; }
.cart-actions__links { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 700; }
.cart-actions__links a, .cart-actions__links button { display: inline-flex; align-items: center; gap: 6px; }
.cart-actions__links a:hover, .cart-actions__links button:hover { text-decoration: underline; }
.cart-actions__links .icon { width: 16px; height: 16px; }
.link-danger { color: var(--sale); }

.summary { position: sticky; top: 176px; border: 1px solid var(--gray-200); border-radius: calc(var(--radius) * 1.4); padding: 22px; background: var(--gray-50); display: grid; gap: 14px; }
.summary h2 { font-size: 19px; font-weight: 800; }
.ship-progress { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; }
.ship-progress p { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ship-progress .icon { width: 18px; height: 18px; }
.ship-progress .stock-bar { margin: 0; height: 8px; }
.summary__rows { display: grid; gap: 10px; font-size: 15px; }
.summary__row { display: flex; justify-content: space-between; gap: 10px; }
.summary__row span:last-child { font-weight: 700; white-space: nowrap; }
.summary__row--discount span:last-child { color: var(--sale); }
.summary__row--muted span:last-child { font-weight: 500; color: var(--gray-500); font-size: 13.5px; text-align: end; }
.applied-coupon { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; background: var(--white); border: 1px dashed var(--gray-300); border-radius: var(--btn-radius); padding: 2px 4px 2px 10px; margin-inline-start: 6px; direction: ltr; }
.applied-coupon button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.applied-coupon button:hover { background: var(--gray-200); }
.applied-coupon .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 2px solid var(--gray-200); }
.summary__total span:first-child { font-size: 16px; font-weight: 800; }
.summary__total strong { font-size: 26px; font-weight: 800; }
.summary__note { display: flex; gap: 8px; font-size: 13px; color: var(--gray-500); }
.summary__note .icon { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.summary .pay-chips { justify-content: center; }

.cart-empty { text-align: center; padding: 60px 20px 70px; }
.cart-empty__icon { width: 110px; height: 110px; border-radius: 50%; background: var(--gray-100); display: grid; place-items: center; margin: 0 auto 20px; }
.cart-empty__icon .icon { width: 50px; height: 50px; color: var(--gray-500); stroke-width: 1.4; }
.cart-empty h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.cart-empty p { color: var(--gray-500); margin-bottom: 22px; }

@media (max-width: 1199px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
  .cart-table .col-price { display: none; }
}
@media (max-width: 991px) {
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 767px) {
  .cart-table thead, .cart-table td.col-price { display: none; }
  .cart-table { border-collapse: separate; }
  .cart-table, .cart-table tbody { display: block; }
  .cart-table tr.cart-item {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "cov info rm" "cov qty total";
    column-gap: 14px; row-gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--gray-200);
  }
  .cart-table td { padding: 0; border: 0; }
  .cart-table td.col-product { grid-column: 1 / 3; grid-row: 1 / 3; display: contents; }
  .cart-item__product { display: contents; }
  .cart-item__product .cover { grid-area: cov; width: 72px; }
  .cart-item__info { grid-area: info; }
  .cart-table td.col-qty { grid-area: qty; align-self: end; }
  .cart-table td.col-total { grid-area: total; align-self: end; text-align: end; }
  .cart-table td.col-remove { grid-area: rm; align-self: start; }
  .cart-actions { flex-direction: column; align-items: stretch; }
  .coupon { flex-basis: auto; }
  .cart-actions__links { justify-content: space-between; }
}

/* ==========================================================
   صفحة غير موجودة
   ========================================================== */
.notfound { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 50px 30px; }
.notfound__art { position: relative; display: grid; place-items: center; min-height: 340px; }
.notfound__art::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: var(--store-primary); }
.notfound__code { position: relative; margin-bottom: 70px; font-size: 150px; font-weight: 800; line-height: 1; color: var(--store-accent); letter-spacing: -.02em; direction: ltr; }
.notfound__books { position: absolute; bottom: 18px; display: flex; gap: 10px; }
.notfound__books img { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 18px rgba(20, 24, 30, .25); }
.notfound__books img:nth-child(1) { transform: rotate(-10deg) translateY(6px); }
.notfound__books img:nth-child(3) { transform: rotate(9deg) translateY(4px); }
.notfound__kicker { font-size: 15px; font-weight: 700; color: var(--gray-500); margin-bottom: 6px; }
.notfound h1 { font-size: 34px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; }
.notfound__text { font-size: 16px; color: var(--gray-500); margin-bottom: 22px; max-width: 480px; }
.notfound .search { max-width: 520px; margin-bottom: 18px; }
.notfound__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notfound__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
@media (max-width: 991px) {
  .notfound { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 10px; padding-top: 24px; }
  .notfound__art { min-height: 260px; width: 100%; }
  .notfound__art::before { width: 230px; height: 230px; }
  .notfound__code { font-size: 110px; margin-bottom: 60px; }
  .notfound__actions, .notfound__links { justify-content: center; }
  .notfound .search { width: 100%; }
}
@media (max-width: 767px) {
  .notfound h1 { font-size: 26px; }
  .notfound__books img { width: 50px; }
}

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

/* ==========================================================
   ميزات المنصّة المعتمدة: عدّاد «عرض اليوم»، والمدوّنة، والأسئلة الشائعة
   ========================================================== */
.deal-timer { margin-bottom: 14px; text-align: center; }
.deal-timer[hidden] { display: none; }
.deal-timer__label { font-size: 13px; font-weight: 700; color: var(--gray-500); margin-bottom: 8px; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.countdown span { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: var(--radius-sm, 6px); background: var(--gray-100); line-height: 1.2; }
.countdown b { font-size: 18px; font-weight: 800; color: var(--store-text); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 11.5px; color: var(--gray-500); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: var(--white); transition: box-shadow .2s; }
.post-card:hover { box-shadow: 0 8px 22px rgba(20, 24, 30, .08); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--gray-100); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 6px; }
.post-card__date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-500); }
.post-card__date .icon { width: 15px; height: 15px; }
.post-card__title { font-size: 16.5px; font-weight: 800; line-height: 1.45; }
.post-card__title a:hover { text-decoration: underline; }
.post-card__excerpt { font-size: 14px; color: var(--gray-500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__more { margin-top: auto; padding-top: 6px; }
.post-grid--page { margin-bottom: 26px; }
.post-article { max-width: 820px; margin: 0 auto; padding-bottom: 20px; }
.post-article .page-head { flex-direction: column; align-items: flex-start; gap: 4px; }
.post-meta { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; color: var(--gray-500); }
.post-meta .icon { width: 16px; height: 16px; }
.post-hero { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.post-content { margin-top: 24px; font-size: 16.5px; line-height: 2; }
.post-content p + p { margin-top: 14px; }
.post-back { margin-top: 24px; }

.faq__item { border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white); }
.faq__item summary { position: relative; display: block; padding: 14px 18px; padding-inline-end: 52px; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--gray-100); color: var(--store-accent); font-size: 18px; font-weight: 700; line-height: 1;
}
.faq__item[open] { border-color: var(--store-primary); }
.faq__item[open] summary::after { content: "−"; background: var(--store-primary); }
.faq__answer { padding: 0 18px 14px; font-size: 14.5px; color: var(--gray-500); line-height: 1.85; }

@media (max-width: 991px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-grid > .post-card:nth-child(3):last-child { display: none; }
}
@media (max-width: 767px) {
  .post-grid > .post-card:nth-child(3):last-child { display: flex; }
  .post-content { font-size: 15.5px; }
}

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

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

/* ==========================================================
   الأشرطة المتناوبة وآراء القرّاء
   ========================================================== */
.band { padding-block: 40px; margin-block: 16px; }
.band--gray { background: var(--gray-50); }
.band--gray .book-card, .band--gray .book-row, .band--gray .author-card img { background: var(--white); }
.band--gray .section-head { border-bottom-color: var(--gray-300); }
.band--gray .book-row { border: 1px solid var(--gray-200); }
.band--dark { background: #2B343D; color: var(--white); }
.band--dark .section-head { border-bottom-color: rgba(255, 255, 255, .16); }
.band + .band { margin-top: -16px; }
main > .band:last-child { margin-bottom: 0; }

.store-score { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 12px; font-size: 14px; color: #D5DADF; }
.store-score strong { font-size: 20px; font-weight: 800; color: var(--white); }
.reviews-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.review-card { margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius); background: var(--white); color: var(--store-text); }
.review-card__text { margin: 0; font-size: 14.5px; line-height: 1.8; }
.review-card__who { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--gray-200); }
.review-card__who .review__avatar { background: var(--store-primary); width: 38px; height: 38px; }
.review-card__who .review__name { display: block; font-size: 14.5px; }
.review-card__book { display: block; font-size: 13px; color: var(--gray-500); }
.review-card__book a { color: var(--store-text); font-weight: 700; }
.review-card__book a:hover { text-decoration: underline; }

/* الأسئلة الشائعة في عمودين متّصلين: السؤال المفتوح لا يترك فراغًا بجانبه */
.faq { display: block; columns: 2; column-gap: 22px; }
.faq__item { break-inside: avoid; margin-bottom: 10px; }

@media (max-width: 1199px) {
  .deal-layout .book-grid > :nth-child(n+7) { display: none; }
  .rows-grid > :nth-child(n+7) { display: none; }
  .reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner-wide__title { font-size: 25px; }
  .banner-wide__body { width: 50%; padding-inline: 28px; }
}
@media (max-width: 991px) {
  .deal-layout .deal { max-width: none; }
  .deal__main { flex-direction: row; align-items: stretch; }
  .deal__stage { flex: 0 0 38%; }
  .deal .cover { width: 72%; }
  .deal__info { flex: 1; justify-content: center; }
  .faq { columns: 1; }
  .promo__title { font-size: 17px; }
  .banner-wide { display: flex; flex-direction: column; }
  .banner-wide img { min-height: 0; height: 130px; }
  .banner-wide__body { position: static; width: auto; padding: 16px 22px 22px; }
}
@media (max-width: 767px) {
  .section { padding-block: 22px; }
  .band { padding-block: 30px; margin-block: 10px; }
  .band + .band { margin-top: -10px; }
  .slider { height: 470px; }
  .slide { padding: 18px 18px 52px; gap: 6px; }
  .slide__media { height: 180px; }
  .slide__media::before { width: 150px; height: 150px; }
  .slide__media img { height: 168px; }
  .slide__title { font-size: 25px; margin-bottom: 8px; }
  .slide__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .slide__price { margin-bottom: 12px; }
  .trust { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
  .trust::-webkit-scrollbar { display: none; }
  .trust__item { flex: none; flex-direction: row; text-align: start; gap: 10px; padding: 10px 16px; scroll-snap-align: start; }
  .trust__item + .trust__item, .trust__item:nth-child(n+3) { border-top: 0; border-inline-start: 1px solid var(--gray-200); }
  .trust__icon { width: 36px; height: 36px; }
  .trust__icon .icon { width: 19px; height: 19px; }
  .trust__title { font-size: 14px; white-space: nowrap; }
  .deal { padding: 16px; }
  .deal__head { margin-bottom: 10px; }
  .deal__save { width: 58px; height: 58px; font-size: 11px; }
  .deal__save strong { font-size: 14px; }
  .deal__main { gap: 12px; }
  .deal__stage { flex-basis: 36%; padding: 12px 8px; }
  .deal .cover { width: 100%; }
  .deal__name { font-size: 15.5px; }
  .deal .price__now { font-size: 20px; }
  .deal .btn { min-height: 40px; font-size: 14px; padding: 0 .8em; }
  .countdown { gap: 4px; }
  .countdown b { font-size: 15px; }
  .countdown small { font-size: 10.5px; }
  .banner-wide__title { font-size: 20px; }
  .banner-wide__text { font-size: 14px; }
  .post-grid--page { grid-template-columns: minmax(0, 1fr); }
  .reviews-grid, .post-grid:not(.post-grid--page) { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; }
  .reviews-grid::-webkit-scrollbar, .post-grid::-webkit-scrollbar { display: none; }
  .reviews-grid > *, .post-grid:not(.post-grid--page) > * { scroll-snap-align: start; }
  .store-score { padding-bottom: 10px; font-size: 13px; }
  .section-head:has(.store-score) { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* صفوفٌ تُمرَّر أفقيًّا حتّى لا ينتهي صفٌّ بنصفه فارغًا: «شاهدتَه مؤخّرًا» وأعمال المؤلّف */
.recent-grid, .author-works .book-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(100% / var(--per-row, 5)); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 6px; }
.recent-grid > *, .author-works .book-grid > * { scroll-snap-align: start; }
@media (max-width: 767px) {
  .recent-grid, .author-works .book-grid { grid-auto-columns: 50%; }
}

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