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

:root {
  /* ألوان الهويّة (قيم تجريبيّة) */
  --store-primary: #0f5e4a;
  --store-primary-dark: #0b4a3a;
  --store-accent: #c9a24a;
  --store-bg: #fbf7f0;
  --store-text: #2b2118;

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

  /* ألوان محايدة دافئة */
  --gold: #e0a526;
  --surface: #f4ede1;
  --surface-2: #ece3d3;
  --line: #e4d9c6;
  --muted: #6b5d50;
  --muted-2: #6f6255;
  --danger: #a8321e;
  --success: #1d6b45;
  --ink-dark: #2b2118;
  --footer-bg: #14302a;
  --footer-text: #cfd9d3;
  --gold-ink: #7c5c14;

  /* المقاييس */
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1320px;
  --gutter: 16px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(43, 33, 24, .06);
  --shadow: 0 10px 28px rgba(43, 33, 24, .09);
  --shadow-lg: 0 18px 46px rgba(43, 33, 24, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.card__body { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; flex: 1; }
.card__author { font-size: 13px; color: var(--muted); }
.card__author:hover { color: var(--store-primary); }
.card__title {
  font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--ink-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__title a:hover { color: var(--store-primary); }
/* صفّ السعر وزرّ السلّة يُدفعان معًا إلى أسفل البطاقة لتتساوى الصفوف (البند 7)؛
   زرّ القالب الأصليّ: «أضف إلى السلّة» محدَّد بلون المتجر بعرض البطاقة، ظاهرٌ دائمًا وبلا كمّيّة */
.card__body > .price { margin-top: auto; padding-top: 2px; }
.card__foot { padding-top: 8px; }
.card__foot .btn { gap: 6px; }

/* النظرة السريعة: فوق زرّ المفضّلة على الغلاف، تطفو ولا تحجز مكانًا */
.card__quick {
  position: absolute; bottom: 54px; inset-inline-end: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--store-text); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: opacity .2s .03s, transform .2s .03s, background .2s, color .2s;
}
.card__quick svg { width: 18px; height: 18px; }
.card:hover .card__quick, .card__quick:focus-visible { opacity: 1; transform: none; }
.card__quick:hover { background: var(--store-primary); color: #fff; }
@media (hover: none) { .card__quick { opacity: 1; transform: none; } }

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

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

/* ==========================================================================
   بطاقة عرض اليوم
   ========================================================================== */
.deal {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
  background: #fff; border: 2px solid var(--store-primary); border-radius: var(--radius);
  padding: 16px; position: relative;
}
.deal .card__media { aspect-ratio: 2 / 3; }
.deal .badges { top: auto; bottom: 8px; }
.deal__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.deal__title { font-size: 17px; font-weight: 800; line-height: 1.4; }

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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


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

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

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

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


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

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

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

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

.buybar { display: none; }


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


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


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


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

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

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

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


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


/* ==========================================================================
   طابع «عِقد» — ما يختلف عن الأساس
   ========================================================================== */
.topbar { background: var(--store-primary-dark); color: #e6efe9; }
.topbar__promo strong { color: #f3d48a; }
.header { background: var(--store-bg); border-bottom: 0; }
.brand__name { letter-spacing: -.01em; }
.search__box { border: 1px solid var(--line); background: #fff; border-radius: var(--radius-pill); }
.search__box:focus-within { border-color: var(--store-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--store-primary) 12%, transparent); }
.search__cat { background: transparent; }
.search__btn { margin: 5px; border-radius: var(--radius-pill); padding-inline: 20px; }
.hact__icon { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--line); }
.hact__icon svg { width: 22px; height: 22px; }
.hact__badge { top: -4px; inset-inline-start: -4px; background: var(--store-accent); color: var(--ink-dark); border-color: var(--store-bg); }

.navbar { background: var(--store-bg); color: var(--store-text); border-block: 1px solid var(--line); }
.navbar .container { min-height: 54px; gap: 18px; }
.allcats { align-self: center; }
.allcats__btn { min-width: 0; height: 40px; border-radius: var(--radius-pill); background: var(--store-primary); padding-inline: 18px; }
.allcats__btn:hover { background: var(--store-primary-dark); }
.allcats__menu { border-radius: var(--radius); top: calc(100% + 8px); width: 270px; border-top: 1px solid var(--line); }
.mainnav a { position: relative; font-weight: 700; color: var(--store-text); padding-inline: 12px; }
.mainnav a::after { content: ""; position: absolute; inset-inline: 12px; bottom: 10px; height: 2px; background: var(--store-accent); transform: scaleX(0); transition: transform .25s var(--ease); }
.mainnav a:hover, .mainnav a.is-active { background: transparent; color: var(--store-primary); }
.mainnav a:hover::after, .mainnav a.is-active::after { transform: scaleX(1); }
.navbar__extra { color: var(--store-primary); }

.btn--accent { color: var(--ink-dark); }
.btn--outline { border-color: var(--store-primary); color: var(--store-primary); }
.link-arrow { color: var(--store-primary); }
.sec-head { align-items: flex-end; }
.sec-head__title { font-size: 26px; }
.sec-head__title::before { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6dc, var(--store-accent) 55%, #9b7a2c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--store-accent) 22%, transparent); }
.section--surface { background: var(--surface); }

.card { border-color: var(--line); border-radius: var(--radius); background: #fff; }
.card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--store-accent) 55%, var(--line)); }
.card__media { border-radius: 12px; }
.price__now { color: var(--store-primary); }
.price--sale .price__now { color: var(--danger); }
.badge--new { background: var(--store-accent); color: var(--ink-dark); }
.deal { border-color: var(--store-accent); background: #fff; }

.banner { border: 1px solid var(--line); }
.banner--soft-blue .banner__bg { background: linear-gradient(135deg, #eef3ee, #dbe8df); }
.banner--soft-sand .banner__bg { background: linear-gradient(135deg, #fbf1dc, #f1dfb8); }
.banner--soft-mint .banner__bg { background: linear-gradient(135deg, #e7f2ec, #cfe5d8); }
.banner--soft-lilac .banner__bg { background: linear-gradient(135deg, #f6ece6, #ecd8cc); }
.banner--dark .banner__bg { background: radial-gradient(120% 140% at 0% 0%, #1d4a3e 0%, #0f2a24 65%); }
.banner--dark .link-arrow { color: #f3d48a; }
.banner--primary .banner__bg { background: radial-gradient(120% 140% at 0% 100%, var(--store-primary) 0%, var(--store-primary-dark) 75%); }

.trust { background: #fff; }
.trust__icon { background: color-mix(in srgb, var(--store-accent) 16%, #fff); color: var(--gold-ink); }
.cat { background: #fff; }
.author__img { border-color: var(--store-bg); box-shadow: 0 0 0 2px var(--store-accent); }
.newsletter { background: var(--store-primary); }
.newsletter::after { background: color-mix(in srgb, var(--store-accent) 22%, transparent); }
.footer__call svg { color: var(--store-accent); }
.pager .is-current { background: var(--store-primary); border-color: var(--store-primary); }

/* صفّ أيقونات التصنيفات */
.cat-icons { padding-block: 20px 8px; }
.cat-icons__row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.cicon { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 14px; font-weight: 700; }
.cicon__ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); position: relative; transition: border-color .25s, transform .25s var(--ease); }
.cicon__ring::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px dashed transparent; transition: border-color .25s; }
.cicon:hover .cicon__ring { border-color: var(--store-accent); transform: translateY(-3px); }
.cicon:hover .cicon__ring::after { border-color: var(--store-accent); }
.cicon__ring img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; }
.cicon__ring svg { width: 34px; height: 34px; color: var(--store-primary); }
.cicon__ring--type { background: color-mix(in srgb, var(--t) 12%, #fff); }
.cicon__ring--type svg { color: var(--t); }
.cicon small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

/* بطاقة التصنيف الكبيرة */
.catcard { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: start; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .25s, border-color .25s; }
.catcard:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--store-accent) 55%, var(--line)); }
.catcard__img { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: var(--surface); }
.catcard__img img { width: 100%; height: 100%; object-fit: cover; }
.catcard__title { font-size: 18px; font-weight: 800; color: var(--ink-dark); display: flex; align-items: baseline; gap: 8px; }
.catcard__title small { font-size: 13px; color: var(--muted); font-weight: 500; }
.catcard__subs { display: grid; gap: 6px; margin-block: 10px 12px; font-size: 14px; }
.catcard__subs a { color: var(--muted); }
.catcard__subs a:hover { color: var(--store-primary); }

/* رأي القارئ البارز */
.quote { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 34px 40px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.quote__mark { font-size: 120px; line-height: .6; font-weight: 800; color: var(--store-accent); opacity: .5; align-self: start; padding-top: 30px; }
.quote__text { font-size: 22px; line-height: 1.8; font-weight: 500; color: var(--ink-dark); text-wrap: balance; }
.quote__by { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.quote__by b { color: var(--store-text); font-size: 15px; }
.quote__book { width: 110px; text-align: center; font-size: 13px; color: var(--muted); }
.quote__book img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow); margin-bottom: 8px; transform: rotate(-4deg); }

/* رائج هذا الموسم */
.season { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; align-items: stretch; }
.season__list { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.season__kicker { font-size: 14px; font-weight: 800; color: var(--gold-ink); margin-bottom: 6px; }
.season__list a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 28px; font-weight: 800; color: var(--ink-dark); transition: color .2s, padding .25s var(--ease); }
.season__list a small { font-size: 14px; font-weight: 500; color: var(--muted); }
.season__list a:hover { color: var(--store-primary); padding-inline-start: 10px; }
.season__stack { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; }
.season__stack .banner:first-child { grid-row: 1 / 3; }
.season__stack .banner { min-height: 0; }

/* الواجهة الرئيسيّة */
.hero-i { padding-block: 10px 6px; }
.hero-i__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.dealbox { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--store-accent); }
.dealbox__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dealbox__head h2 { font-size: 20px; font-weight: 800; }
.dealbox__cover { position: relative; display: grid; place-items: center; padding: 18px; border-radius: 12px; background: var(--surface); }
.dealbox__cover img { width: 54%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-lg); }
.dealbox__cover .badges { top: 12px; inset-inline-end: 12px; }
.dealbox__title { font-size: 18px; font-weight: 800; }
.showcase { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 20px; padding: 40px 48px; border-radius: var(--radius); overflow: hidden; isolation: isolate; background: radial-gradient(110% 140% at 100% 0%, #1d5a49 0%, var(--store-primary-dark) 55%, #0a2f26 100%); color: #fff; }
.showcase::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(40% 50% at 25% 60%, color-mix(in srgb, var(--store-accent) 35%, transparent), transparent 70%); }
.showcase__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: #f3d48a; }
.showcase__title { font-size: 44px; line-height: 1.2; font-weight: 800; margin-top: 8px; text-wrap: balance; }
.showcase__text { color: rgba(255, 255, 255, .85); margin-top: 10px; max-width: 40ch; }
.showcase .showcase .showcase .showcase .showcase__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.showcase__actions .btn--outline { border-color: rgba(255, 255, 255, .6); color: #fff; }
.showcase__actions .btn--outline:hover { background: #fff; color: var(--store-primary-dark); }
.showcase__art { position: relative; min-height: 320px; display: flex; align-items: center; justify-content: center; }
.showcase__art::before { content: ""; position: absolute; width: 74%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(243, 212, 138, .55); }
.showcase__art img { position: absolute; width: 36%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 24px 48px rgba(0, 0, 0, .4); }
.showcase__art img:nth-child(1) { transform: translateX(-52%) rotate(-10deg) scale(.86); }
.showcase__art img:nth-child(2) { z-index: 2; width: 42%; }
.showcase__art img:nth-child(3) { transform: translateX(52%) rotate(10deg) scale(.86); }

/* «شاهدتَه مؤخّرًا» والوسوم */
.recent { display: flex; gap: 16px; align-items: stretch; }
.recent > * { flex: 1 1 0; min-width: 0; }
.recent > .recent__box--viewed { flex-grow: 1.2; }
/* «شاهدتَه مؤخّرًا» يختفي كلّه إن لم يكن فيه كتاب، فيأخذ الصندوق المجاور العرض كلّه */
.recent__box--viewed:not(:has(.mini)) { display: none; }
.recent__box--viewed[hidden] { display: none; }

.recent__box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.recent__title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.recent__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.recent__list .mini { border-top: 1px dashed var(--line); }
.recent__list .mini:nth-child(-n+2) { border-top: 0; }
.recent--strip .recent__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.recent--strip .recent__list .mini:nth-child(-n+4) { border-top: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tags a { padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-size: 14px; font-weight: 600; background: var(--store-bg); }
.tags a:hover { border-color: var(--store-primary); color: var(--store-primary); }
.recent__trust { display: grid; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.recent__trust div { display: flex; align-items: center; gap: 12px; padding-block: 10px; font-size: 14px; }
.recent__trust div + div { border-top: 1px dashed var(--line); }
.recent__trust svg { width: 22px; height: 22px; color: var(--gold-ink); }


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

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

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

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


@media (max-width: 1199px) {
  .cat-icons__row { grid-template-columns: repeat(8, 104px); overflow-x: auto; scrollbar-width: none; }
  .hero-i__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .showcase { padding: 32px; }
  .showcase__title { font-size: 34px; }
}
@media (max-width: 991px) {
  .hero-i__grid { grid-template-columns: 1fr; }
  .dealbox { display: grid; grid-template-columns: 160px minmax(0, 1fr); grid-template-areas: "cover head" "cover body"; align-items: start; }
  .dealbox__head { grid-area: head; }
  .dealbox__cover { grid-area: cover; }
  .dealbox__body { grid-area: body; display: grid; gap: 8px; }
  .dealbox__cover img { width: 100%; }
  .recent { flex-direction: column; }
  .recent--strip .recent__list { grid-template-columns: 1fr 1fr; }
  .recent--strip .recent__list .mini:nth-child(n+3) { border-top: 1px dashed var(--line); }
  .season { grid-template-columns: 1fr; }
  .quote { grid-template-columns: minmax(0, 1fr) auto; padding: 28px; }
  .quote__mark { display: none; }
}
@media (max-width: 575px) {
  .cat-icons__row { grid-template-columns: repeat(8, 86px); gap: 8px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .cicon__ring { width: 70px; height: 70px; }
  .cicon__ring img { width: 58px; height: 58px; }
  .cicon { font-size: 13px; }
  .showcase { grid-template-columns: 1fr; padding: 24px 20px; }
  .showcase__art { order: -1; min-height: 200px; }
  .showcase__title { font-size: 28px; }
  .dealbox { grid-template-columns: 110px minmax(0, 1fr); padding: 16px; gap: 12px; }
  .recent__list, .recent--strip .recent__list { grid-template-columns: 1fr; }
  .recent__list .mini:nth-child(n+2) { border-top: 1px dashed var(--line); }
  .season__list a { font-size: 22px; }
  .season__stack { grid-template-columns: 1fr; grid-template-rows: none; }
  .season__stack .banner:first-child { grid-row: auto; }
  .catcard { grid-template-columns: 84px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .catcard__img { width: 84px; height: 84px; }
  .quote { grid-template-columns: 1fr; padding: 22px 20px; }
  .quote__text { font-size: 18px; }
  .quote__book { display: none; }
}

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

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

/* لون أساس للبانرات الداكنة تحت طبقة التدرّج، ليُحسب التباين على خلفيّتها الفعليّة */
.banner--dark { background-color: #0f2a24; }
.banner--primary { background-color: var(--store-primary-dark); }

/* بعد حذف العدّاد: مسافة بين نصّ الواجهة وأزرارها */
.showcase__text + .showcase__actions { margin-top: 14px; }

/* ==========================================================================
   ميزات المنصّة
   ========================================================================== */
/* العدّاد التنازليّ («عرض اليوم» و«مجموعة الموسم») */
.countdown { display: flex; gap: 6px; margin-top: 4px; }
.countdown[hidden] { display: none; }
.countdown > span { flex: 1; min-width: 0; max-width: 62px; padding: 6px 2px; border-radius: var(--radius-sm); background: var(--surface); text-align: center; line-height: 1.15; }
.countdown b { display: block; font-size: 19px; font-weight: 800; color: var(--store-primary); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 11px; color: var(--muted); }
.showcase .countdown { margin-top: 18px; }
.showcase .countdown > span { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.showcase .countdown b { color: #f3d48a; }
.showcase .countdown small { color: rgba(255, 255, 255, .82); }

/* الباقات */
.grid-bundles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bundle { display: flex; flex-direction: column; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.bundle:hover { border-color: var(--store-accent); box-shadow: var(--shadow); }
.bundle__art { display: flex; align-items: center; justify-content: center; padding: 22px 12px; background: linear-gradient(135deg, #fdf3e2, #f8e5c6); }
.bundle__art img { width: 27%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-lg); }
.bundle__art img:nth-child(1) { transform: rotate(-7deg) translateX(-12%); }
.bundle__art img:nth-child(2) { width: 32%; z-index: 1; }
.bundle__art img:nth-child(3) { transform: rotate(7deg) translateX(12%); }
.bundle__body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.bundle__title { font-size: 18px; font-weight: 800; color: var(--ink-dark); }
.bundle__text { font-size: 14px; color: var(--muted); }
.bundle .save-pill { margin-bottom: 4px; }
.bundle .btn { margin-top: auto; }

/* الخصم حسب الكمّيّة قرب السعر */
.qty-deal { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--store-primary); }
.qty-deal .i { width: 16px; height: 16px; }

/* الأسئلة الشائعة */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 28px; align-items: start; }
.faq__lead { color: var(--muted); font-size: 15px; }
.faq__list { display: grid; gap: 10px; }
.faq__item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 700; font-size: 15.5px; color: var(--ink-dark); }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary .i { width: 18px; height: 18px; flex: none; color: var(--store-primary); transition: transform .2s var(--ease); }
.faq__item[open] summary .i { transform: rotate(45deg); }
.faq__item p { padding: 0 18px 16px; color: var(--muted); font-size: 14.5px; line-height: 1.8; }

@media (max-width: 991px) {
  .grid-bundles { gap: 12px; }
  .bundle__body { padding: 14px; }
  .faq { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 700px) {
  .grid-bundles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .bundle { flex: 0 0 82%; scroll-snap-align: start; }
  .countdown b { font-size: 16px; }
}

/* ==========================================================================
   صفوفٌ كاملة: كلّ صفّ كتبٍ في الرئيسيّة وصفحات المنتج فيه ستّة كتب،
   ويُخفى الزائد بحسب عدد الأعمدة الفعليّ حتّى لا ينتهي صفٌّ نصف فارغ
   ========================================================================== */
@media (min-width: 1200px) {
  .grid-books--fit > .card:nth-child(n+6) { display: none; }
  body[data-books-per-row="4"] .grid-books--fit > .card:nth-child(n+5) { display: none; }
  body[data-books-per-row="3"] .grid-books--fit > .card:nth-child(6),
  body[data-books-per-row="6"] .grid-books--fit > .card:nth-child(6) { display: flex; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .grid-books--fit > .card:nth-child(n+5) { display: none; }
}
@media (max-width: 575px) {
  .grid-books--fit:not(.grid-books--row) > .card:nth-child(n+5) { display: none; }
}

/* «هدايا مقترحة»: دوّارٌ أفقيّ بالأسهم في كلّ العروض */
.grid-books--carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px 8px; }
.grid-books--carousel::-webkit-scrollbar { display: none; }
.grid-books--carousel > .card { flex: 0 0 calc((100% - (var(--cols) - 1) * 16px) / var(--cols)); scroll-snap-align: start; }
@media (max-width: 575px) {
  .grid-books--carousel > .card { flex-basis: 46%; }
  .sec-head__tools .arrows { display: none; }
}

/* «من مدوّنة الدار» وصفحتا المدوّنة */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .25s var(--ease), border-color .25s var(--ease); }
.post-card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--store-accent) 55%, var(--line)); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.post-card__date { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--gold-ink); }
.post-card__date .i { width: 15px; height: 15px; }
.post-card__title { font-size: 18px; font-weight: 800; line-height: 1.5; color: var(--ink-dark); }
.post-card__title a:hover { color: var(--store-primary); }
.post-card__excerpt { color: var(--muted); font-size: 14.5px; line-height: 1.8; }
.post-card .link-arrow { margin-top: auto; padding-top: 4px; }
.posts--blog .post-card:first-child { grid-column: 1 / -1; flex-direction: row; }
.posts--blog .post-card:first-child .post-card__media { flex: 0 0 56%; aspect-ratio: auto; min-height: 320px; }
.posts--blog .post-card:first-child .post-card__body { justify-content: center; padding: 32px; }
.posts--blog .post-card:first-child .post-card__title { font-size: 26px; }
.posts--blog .post-card:first-child .link-arrow { margin-top: 6px; }
.article { max-width: 760px; margin-inline: auto; }
.article__image { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.article__body { margin-top: 26px; font-size: 17px; line-height: 2; color: var(--store-text); }
.article__body p + p { margin-top: 14px; }
.article__back { margin-top: 22px; }
.page-head__meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--gold-ink); }
.page-head__meta .i { width: 15px; height: 15px; }
@media (max-width: 991px) {
  .posts:not(.posts--blog) { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; }
  .posts:not(.posts--blog) > .post-card { flex: 0 0 44%; scroll-snap-align: start; }
  .posts--blog { grid-template-columns: 1fr; }
  .posts--blog .post-card { flex-direction: row; }
  .posts--blog .post-card .post-card__media { flex: 0 0 42%; aspect-ratio: auto; min-height: 200px; }
  .posts--blog .post-card:first-child .post-card__media { flex-basis: 50%; min-height: 260px; }
}
@media (max-width: 575px) {
  .posts:not(.posts--blog) > .post-card { flex-basis: 84%; }
  .posts--blog .post-card { flex-direction: column; }
  .posts--blog .post-card .post-card__media, .posts--blog .post-card:first-child .post-card__media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .posts--blog .post-card:first-child .post-card__body { padding: 18px 20px 20px; }
  .posts--blog .post-card:first-child .post-card__title { font-size: 20px; }
  .article__body { font-size: 16px; }
  /* «تصنيفاتنا» شريطٌ يُمرَّر بدل ستّ بطاقاتٍ فوق بعضها */
  .grid-3[data-region="home_categories"] { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-bottom: 6px; }
  .grid-3[data-region="home_categories"] > .catcard { flex: 0 0 84%; scroll-snap-align: start; }
}

/* الشبكة / القائمة في صفحة التصنيف */
.view-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; background: #fff; flex: none; }
.view-switch button { width: 42px; height: 40px; display: grid; place-items: center; color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--store-primary); color: #fff; }
.view-switch .i { width: 18px; height: 18px; }
.shop .grid-books.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-books.is-list > .card { flex-direction: row; gap: 16px; }
.grid-books.is-list .card__media { flex: 0 0 140px; align-self: flex-start; }
.grid-books.is-list .card__body > .price { margin-top: 8px; }
.grid-books.is-list .card__foot { padding-top: 12px; }
.grid-books.is-list .card__body { padding-top: 2px; }
.grid-books.is-list .card__foot .btn { width: auto; padding-inline: 18px; }
@media (max-width: 1199px) { .shop .grid-books.is-list { grid-template-columns: 1fr; } }
@media (max-width: 575px) {
  .grid-books.is-list .card__media { flex-basis: 96px; }
  .grid-books.is-list .card__foot .btn { width: 100%; }
}

/* «لم تجد سؤالك؟» تحت مقدّمة الأسئلة الشائعة */
.faq__help { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.faq__help-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--store-accent) 16%, #fff); color: var(--gold-ink); }
.faq__help-icon .i { width: 26px; height: 26px; }
.faq__help-title { font-weight: 800; color: var(--ink-dark); }
.faq__help-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; font-size: 14px; font-weight: 700; }
.faq__help-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--store-primary); direction: ltr; }
.faq__help-links .i { width: 16px; height: 16px; }
@media (max-width: 991px) { .faq__help { margin-block: 12px 6px; } }
@media (max-width: 575px) {
  .toolbar .select { width: 0; flex: 1 1 0; }
  .view-switch button { width: 38px; }
}
@media (max-width: 575px) {
  .recent__box--viewed .recent__list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding-bottom: 4px; }
  .recent__box--viewed .recent__list .mini { flex: 0 0 78%; scroll-snap-align: start; border-top: 0 !important; }
}

/* اختيار الصيغة (book.formats): يختفي الصندوق كلّه إن لم يكن للعنوان غير صيغةٍ واحدة */
[data-slot="book.formats"]:not(:has(.format ~ .format)) { display: none; }

/* تبويبات صفّ الكتب (القاعدة 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; }

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