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

:root {
  /* ألوان الهويّة (قيم تجريبيّة) */
  --store-primary: #0b6bcb;
  --store-primary-dark: #08519b;
  --store-accent: #2ec4d6;
  --store-bg: #ffffff;
  --store-text: #0d2a4a;

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

  /* ألوان محايدة */
  --gold: #f5a623;
  --surface: #eef6fd;
  --surface-2: #e1eefa;
  --line: #dce7f2;
  --muted: #55657a;
  --muted-2: #5a6a80;
  --danger: #c0262d;
  --success: #1e7d4f;
  --ink-dark: #0d2a4a;
  --navy: #0d2a4a;
  --on-dark: #eef5fc;
  --on-dark-muted: #b3c4d8;
  --footer-bg: #0b2340;
  --footer-text: #b3c4d8;

  /* المقاييس */
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1280px;
  --gutter: 16px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(13, 42, 74, .06);
  --shadow: 0 12px 30px rgba(13, 42, 74, .09);
  --shadow-lg: 0 24px 54px rgba(13, 42, 74, .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-active { 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); }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.card__foot .price { flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.card__cart {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--store-primary); transition: background .2s, color .2s;
}
.card__cart svg { width: 19px; height: 19px; }
.card__cart:hover { background: var(--store-primary); color: #fff; }
.card__cart[disabled] { color: var(--muted-2); background: var(--surface); cursor: not-allowed; }

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

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

/* ==========================================================================
   البانرات
   ========================================================================== */
.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, .94); 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; }


/* الأكثر مبيعًا: عمود جانبيّ وشبكة */
.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: #dbe8f6; }
.topbar__promo strong { color: #fff; }
.topbar__hours { display: inline-flex; align-items: center; gap: 6px; }
.topbar__hours svg { width: 15px; height: 15px; }
.search__box { border-radius: var(--radius-pill); border-color: var(--line); background: var(--surface); }
.search__cat { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.search__btn { border-radius: var(--radius-pill); margin: 4px; }
.navbar { background: #fff; border-block: 1px solid var(--line); }
.navbar .mainnav a { color: var(--ink-dark); white-space: nowrap; padding-inline: 10px; }
.mainnav a:hover, .mainnav a.is-active { background: var(--surface); color: var(--store-primary); }
.navbar__extra { color: var(--store-primary); }
.allcats__btn { border-radius: var(--radius-pill); }
.mainnav__tag { background: var(--store-accent); color: var(--navy); }
.btn { border-radius: var(--radius-pill); }
.btn--accent { background: var(--store-accent); color: var(--navy); }
.badge--new { background: var(--store-accent); color: var(--navy); }
.sec-head { flex-wrap: wrap; }
.sec-head__title { font-size: 30px; font-weight: 800; }
.sec-head__title::before { display: none; }
.sec-head__kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--store-primary); margin-bottom: 4px; }
.sec-head__kicker::before { content: ""; width: 8px; height: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--store-accent); }
.sec-head--center { justify-content: center; text-align: center; }
.sec-head--center > div { display: flex; flex-direction: column; align-items: center; }
.card { border-radius: var(--radius); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card__cat { font-size: 12px; font-weight: 800; color: var(--store-primary); }
.card__cart { border-radius: 50%; }
.section--surface { background: var(--surface); }
.section--wave { position: relative; }
.wave { display: block; width: 100%; height: 48px; color: var(--surface); }
.wave--down { transform: scaleY(-1); }
.grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }

/* الواجهة */
.hero-m { position: relative; display: grid; background: linear-gradient(180deg, var(--surface) 0%, #f7fbff 100%); overflow: hidden; isolation: isolate; }
.hero-m::before, .hero-m::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; }
.hero-m::before { width: 520px; height: 520px; inset-inline-end: -120px; top: -160px; background: radial-gradient(circle, color-mix(in srgb, var(--store-accent) 30%, transparent), transparent 70%); }
.hero-m::after { width: 360px; height: 360px; inset-inline-start: -100px; bottom: -120px; background: radial-gradient(circle, color-mix(in srgb, var(--store-primary) 16%, transparent), transparent 70%); }
.hero-m__slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility .6s; }
.hero-m__slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-m__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; min-height: 520px; padding-block: 48px 86px; }
.hero-m__kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill); background: #fff; color: var(--store-primary); font-weight: 800; font-size: 14px; box-shadow: var(--shadow-sm); }
.hero-m__kicker svg { width: 16px; height: 16px; }
.hero-m__title { font-size: 54px; line-height: 1.15; font-weight: 800; margin-top: 16px; text-wrap: balance; }
.hero-m__title span { color: var(--store-primary); }
.hero-m__text { color: var(--muted); font-size: 17px; margin-top: 14px; max-width: 46ch; line-height: 1.8; }
.hero-m__search { margin-top: 26px; background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); max-width: 540px; }
.hero-m__search h2 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.hero-m__search .search__box { background: var(--surface); }
.hero-m__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.hero-m__chips a { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-dark); font-weight: 700; }
.hero-m__chips a:hover { background: var(--store-primary); color: #fff; }
.hero-m__art { position: relative; min-height: 400px; display: grid; place-items: center; }
.hero-m__circle { position: absolute; width: 82%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, color-mix(in srgb, var(--store-accent) 35%, #fff)); box-shadow: inset 0 0 0 14px rgba(255, 255, 255, .6); }
.hero-m__art img { position: absolute; width: 38%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-lg); }
.hero-m__art img:nth-of-type(1) { transform: translate(-46%, 16px) rotate(-7deg); }
.hero-m__art img:nth-of-type(2) { z-index: 2; width: 44%; }
.hero-m__art img:nth-of-type(3) { transform: translate(46%, 16px) rotate(7deg); }
.bubble { position: absolute; z-index: 3; border-radius: 50%; background: rgba(255, 255, 255, .75); border: 2px solid color-mix(in srgb, var(--store-accent) 60%, #fff); animation: float 6s ease-in-out infinite; }
.bubble--1 { width: 26px; height: 26px; top: 12%; inset-inline-start: 18%; }
.bubble--2 { width: 14px; height: 14px; top: 28%; inset-inline-end: 12%; animation-delay: 1.5s; }
.bubble--3 { width: 20px; height: 20px; bottom: 16%; inset-inline-start: 10%; animation-delay: 3s; }
@keyframes float { 50% { transform: translateY(-14px); } }
.hero-m__badge { position: absolute; z-index: 4; bottom: 10%; inset-inline-end: 4%; display: flex; align-items: center; gap: 10px; background: #fff; padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13px; }
.hero-m__badge i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--store-primary); }
.hero-m__badge svg { width: 20px; height: 20px; }
.hero-m__badge b { display: block; font-size: 15px; }
.hero-m__ctrl { grid-area: 1 / 1; align-self: end; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding-bottom: 26px; pointer-events: none; }
.hero-m__ctrl > * { pointer-events: auto; }
.hero-m__ctrl .slider__dots { position: static; }



/* بانر التوصيل */
.dlv { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); border-radius: calc(var(--radius) + 6px); overflow: hidden; background: var(--store-primary); color: #fff; }
.dlv__body { padding: 40px; }
.dlv__kicker { color: #fff; font-weight: 800; font-size: 13px; opacity: .9; }
.dlv__title { font-size: 34px; font-weight: 800; margin-top: 6px; }
.dlv__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.dlv__tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .16); }
.dlv__tile i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--store-accent); color: var(--navy); flex: none; }
.dlv__tile svg { width: 22px; height: 22px; }
.dlv__tile b { display: block; font-size: 16px; }
.dlv__tile small { color: #fff; font-size: 13px; }
.dlv__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.dlv__actions .btn--outline { border-color: #fff; color: #fff; }
.dlv__actions .btn--outline:hover { background: #fff; color: var(--store-primary-dark); }
.dlv__art { position: relative; background: var(--store-primary-dark); min-height: 320px; display: grid; place-items: center; overflow: hidden; }
.dlv__art::before { content: ""; position: absolute; width: 120%; aspect-ratio: 1; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); }
.dlv__art img { position: absolute; width: 34%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
.dlv__art img:nth-child(1) { transform: translateX(-40%) rotate(-6deg); }
.dlv__art img:nth-child(2) { transform: translateX(40%) rotate(6deg); z-index: 2; }

/* الباقات */
.plan { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); position: relative; text-align: center; align-items: center; }
.plan--hot { border: 2px solid var(--store-primary); box-shadow: var(--shadow-lg); transform: translateY(-10px); }
.plan__tag { position: absolute; top: -14px; background: var(--store-primary); color: #fff; font-size: 12px; font-weight: 800; padding: 5px 14px; border-radius: var(--radius-pill); }
.plan__name { font-size: 22px; font-weight: 800; }
.plan__desc { color: var(--muted); font-size: 14px; }
.plan__covers { display: flex; gap: 6px; justify-content: center; }
.plan__covers img { width: 66px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow); }
.plan__price { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.plan__price b { font-size: 38px; font-weight: 800; color: var(--store-primary); line-height: 1; }
.plan__price del { color: var(--muted); }
.plan__list { display: grid; gap: 10px; font-size: 14px; width: 100%; border-top: 1px dashed var(--line); padding-top: 14px; }
.plan__list li { display: flex; align-items: center; gap: 8px; justify-content: center; }
.plan__list svg { width: 16px; height: 16px; color: var(--success); flex: none; }
.plan .btn { margin-top: auto; }

/* كيف يُصنع كتابنا */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.story__img { position: relative; border-radius: 50% 50% var(--radius) var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface); }
.story__img { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fff, var(--surface-2)); }
.story__img img { position: absolute; width: 36%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-lg); }
.story__img img:nth-child(1) { transform: translate(-48%, -14%) rotate(-6deg); }
.story__img img:nth-child(2) { z-index: 2; width: 42%; transform: translateY(6%); }
.story__img img:nth-child(3) { transform: translate(48%, -14%) rotate(6deg); }
.story__text { color: var(--muted); line-height: 1.9; margin-top: 10px; }
.steps { display: grid; gap: 14px; margin-top: 22px; counter-reset: st; }
.step { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; }
.step::before { counter-increment: st; content: counter(st); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--surface); color: var(--store-primary); }
.step b { display: block; font-size: 17px; }
.step p { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* العدّادات */
.stats-section:has([data-option="stats"]:empty) { display: none; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; background: var(--navy); color: #fff; border-radius: calc(var(--radius) + 6px); padding: 34px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 44px; font-weight: 800; line-height: 1.1; color: #fff; }
.stat small { color: var(--on-dark-muted); font-size: 14px; }
.stat + .stat { border-inline-start: 1px solid rgba(255, 255, 255, .12); }

/* آراء القرّاء */
.revs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.rev { background: #fff; border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.rev__text { line-height: 1.85; }
.rev__by { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.rev__av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--store-primary); font-weight: 800; font-size: 18px; flex: none; }
.rev__by b { display: block; }
.rev__by small { color: var(--muted); font-size: 13px; }
.rev__book { font-size: 13px; color: var(--muted); }
.rev__book a { color: var(--store-primary); font-weight: 700; }

/* التذييل */
.footer__news { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-block: 28px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer__news h2 { color: #fff; font-size: 22px; font-weight: 800; }
.footer__news p { font-size: 14px; margin-top: 4px; }
.footer__news .newsletter__form { flex: 0 1 460px; }
.footer__hours { display: grid; gap: 4px; margin-top: 14px; font-size: 13px; }
.footer__hours div { display: flex; justify-content: space-between; gap: 12px; max-width: 260px; }
.footer__hours b { color: #fff; font-weight: 700; }
.footer__call svg { color: var(--store-accent); }
.footer .footer__social a:hover { background: var(--store-accent); color: var(--navy); }

/* ==========================================================================
   العروض المتجاوبة
   ========================================================================== */
@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; }
  .newsletter { grid-template-columns: 1fr; }
  .cmp-grid-3 { grid-template-columns: 1fr 1fr; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__side { grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__side .banner__art { display: none; }
  .hero__side .banner__body { width: 100%; }
  .slider { min-height: 380px; }
  .grid-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-authors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .split > aside { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .side-promo { margin-top: 0; min-height: 0; }
  .side-promo .banner__art { display: none; }
  .shop { grid-template-columns: 1fr; }
  .filter-btn { display: inline-flex; }
  .filters {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(340px, 88vw); z-index: 100;
    border-radius: 0; border: 0; overflow-y: auto; display: flex; flex-direction: column;
    transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s;
  }
  .filters__body { flex: 1; }
  .filters__close { display: inline-grid; }
  .filters__foot { position: sticky; bottom: 0; background: #fff; }
  body.filters-open { overflow: hidden; }
  body.filters-open .filters { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  body.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
  .product { grid-template-columns: 1fr; }
  .gallery { position: static; grid-template-columns: 1fr; }
  .gallery__thumbs { flex-direction: row; order: 2; justify-content: center; }
  .gallery__thumbs button { width: 58px; }
  .gallery__main img { width: min(62%, 300px); }
  .rsum { grid-template-columns: 1fr; gap: 18px; }
  body.has-buybar .tabbar { display: none; }
  .buybar {
    display: flex; align-items: center; gap: 12px; position: fixed; bottom: 0; inset-inline: 0; z-index: 70;
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .buybar .price { flex-direction: column; align-items: flex-start; gap: 0; }
  .buybar .btn { flex: 1; }

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

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


@media (max-width: 1199px) {
  .hero-m__title { font-size: 44px; }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dlv__body { padding: 30px; }
}
@media (max-width: 991px) {
  .hero-m__grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-m__art { min-height: 320px; }
  .dlv { grid-template-columns: 1fr; }
  .dlv__art { min-height: 260px; }
  .story { grid-template-columns: 1fr; }
  .story__img { max-width: 420px; aspect-ratio: 1; margin-inline: auto; width: 100%; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .stat:nth-child(3) { border-inline-start: 0; }
  .revs { grid-template-columns: 1fr; }
  .plan--hot { transform: none; }
}
@media (max-width: 575px) {
  .hero-m__title { font-size: 34px; }
  .hero-m__text { font-size: 15px; }
  .hero-m__search { padding: 14px; }
  .hero-m__art { min-height: 260px; }
  .hero-m__badge { display: none; }
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dlv__body { padding: 22px; }
  .dlv__title { font-size: 26px; }
  .dlv__tiles { grid-template-columns: 1fr; }
  .stats { padding: 24px 14px; }
  .stat b { font-size: 32px; }
  .sec-head__title { font-size: 24px; }
  .wave { height: 28px; }
}

@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: var(--ink-dark); }
.banner--primary { background-color: var(--store-primary-dark); }

/* ==========================================================================
   ميزات المنصّة
   ========================================================================== */
/* الخصم حسب الكمّيّة قرب السعر */
.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__list { display: grid; gap: 10px; max-width: 860px; margin-inline: auto; }
.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; }
.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; }
.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; }

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

/* ==========================================================================
   الإصدار الثاني: أقسام الرئيسيّة الجديدة
   ========================================================================== */
.sec-head__sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }

/* المفضّلة والنظرة السريعة تطفوان فوق الغلاف: عند التحويم في الحاسوب، ودائمًا في اللمس، ولا تحجزان مكانًا */
.card__tools { position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.card__tools .card__wish, .card__quick {
  position: static; width: 40px; height: 40px; 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__quick { transition-delay: .04s; }
.card__quick svg { width: 18px; height: 18px; }
.card:hover .card__tools > *, .card__tools > :focus-visible { opacity: 1; transform: none; }
.card__quick:hover { background: var(--store-primary); color: #fff; }
@media (hover: none) { .card__tools > * { opacity: 1; transform: none; } }

/* شريط الثقة المدمج تحت الواجهة */
.trust-strip { position: relative; z-index: 2; margin-top: -34px; }
.hero-m:has(+ .trust-strip) .hero-m__grid { padding-bottom: 110px; }
.hero-m:has(+ .trust-strip) .hero-m__ctrl { padding-bottom: 58px; }
.tstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-radius: var(--radius-pill); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 10px 14px; }
.tstrip__item { display: flex; align-items: center; gap: 12px; padding: 6px 14px; }
.tstrip__item + .tstrip__item { border-inline-start: 1px solid var(--line); }
.tstrip__item i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--store-primary); }
.tstrip__item svg { width: 22px; height: 22px; }
.tstrip__item b { display: block; font-size: 15px; font-weight: 800; }
.tstrip__item small { display: block; color: var(--muted); font-size: 13px; }

/* التصنيفات: دوائر في صفّ */
.section--cats { padding-top: 40px; }
.rcats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.rcat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.rcat__img { width: min(100%, 150px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 6px solid #fff; box-shadow: 0 0 0 2px var(--surface-2), var(--shadow-sm); margin-bottom: 8px; transition: box-shadow .2s, transform .25s var(--ease); }
.rcat__img img { width: 100%; height: 100%; object-fit: cover; }
.rcat:hover .rcat__img { box-shadow: 0 0 0 2px var(--store-primary), var(--shadow); transform: translateY(-4px); }
.rcat__name { font-weight: 800; font-size: 16px; }
.rcat:hover .rcat__name { color: var(--store-primary); }
.rcat__count { font-size: 13px; color: var(--muted); }

/* الدوّار الأفقيّ */
.carousel__track { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - (var(--cols) - 1) * 16px) / var(--cols)); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px 10px; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { scroll-snap-align: start; }
.arrows button:disabled { opacity: .4; cursor: default; background: #fff; color: inherit; border-color: var(--line); }

/* تبويبات «مختارات الدار»: الشريط يختفي إن لم يُختر غير مصدرٍ واحد (القاعدة 16) */
.row-tabs { background: var(--surface); border-radius: var(--radius-pill); padding: 4px; gap: 2px; }
.row-tabs button { padding: 8px 16px; min-height: 40px; }
.row-tabs button[aria-selected="true"] { background: var(--store-primary); color: #fff; border-color: transparent; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }
/* صفٌّ واحد: لا يبقى صفٌّ ناقص مهما كان عدد الكتب في الصفّ */
.grid-books--one { --one: 5; }
body[data-books-per-row="3"] .grid-books--one { --one: 3; }
body[data-books-per-row="4"] .grid-books--one { --one: 4; }
body[data-books-per-row="6"] .grid-books--one { --one: 6; }
body[data-books-per-row="3"] .grid-books--one > :nth-child(n+4),
body[data-books-per-row="4"] .grid-books--one > :nth-child(n+5),
body[data-books-per-row="5"] .grid-books--one > :nth-child(n+6) { display: none; }

/* عروض الأسبوع بعدّادٍ واحد */
.deals__head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 28px; align-items: center; margin-bottom: 22px; }
.deals__head > .sec-head__kicker, .deals__head > .sec-head__title, .deals__head > .sec-head__sub { grid-column: 1; justify-self: start; }
.deals__head > .sec-head__kicker { grid-row: 1; }
.deals__head > .sec-head__title { grid-row: 2; }
.deals__head > .sec-head__sub { grid-row: 3; }
.deals__label { grid-column: 2; grid-row: 1; font-weight: 800; font-size: 14px; color: var(--ink-dark); }
.deals__head > .drops { grid-column: 2; grid-row: 2 / 4; }
.deals__head > .btn { grid-column: 3; grid-row: 1 / 4; }
.drops { display: flex; gap: 8px; }
.drops[hidden], .deals__label[hidden] { display: none; }
.drops__unit { width: 62px; padding: 10px 2px 8px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background: #fff; text-align: center; line-height: 1.1; box-shadow: var(--shadow-sm); border: 2px solid color-mix(in srgb, var(--store-accent) 45%, #fff); }
.drops__unit b { display: block; font-size: 22px; font-weight: 800; color: var(--store-primary-dark); font-variant-numeric: tabular-nums; }
.drops__unit small { font-size: 11.5px; color: var(--muted); }
.deals__items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card--h { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.card--h .card__media { min-width: 0; align-self: start; }
.card--h .card__title { font-size: 15px; }
.card--h .card__body { padding-top: 2px; }
.card--h .type-dot { width: 28px; height: 28px; top: 6px; inset-inline-start: 6px; }
.card--h .type-dot svg { width: 14px; height: 14px; }
.card--h .badges { top: auto; bottom: 6px; inset-inline-end: 6px; }
.card--h .card__body { flex: none; }
.card--h .card__foot { margin-top: 0; padding-top: 8px; }

/* مؤلّفونا */
.grid-authors--home .author { background: #fff; border-radius: var(--radius); padding: 20px 10px 16px; border: 1px solid var(--line); transition: box-shadow .2s, transform .25s var(--ease); }
.grid-authors--home .author:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.grid-authors--home .author__img { box-shadow: 0 0 0 3px color-mix(in srgb, var(--store-accent) 55%, #fff); }

/* كيف يُصنع كتابنا: صورةٌ واحدة */
.story__img img:only-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; border-radius: 0; box-shadow: none; transform: 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 .2s, transform .25s var(--ease); }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.post-card__media { display: block; aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.post-card__date { font-size: 13px; color: var(--muted); }
.post-card__title { font-size: 17px; font-weight: 800; line-height: 1.5; }
.post-card__title a:hover { color: var(--store-primary); }
.post-card__excerpt { color: var(--muted); font-size: 14px; line-height: 1.8; }

/* البانر العريض بصورةٍ واحدة */
.banner__art--img { display: block; padding: 0; }
.banner--wide .banner__art--img { width: 46%; inset-block: 0; inset-inline-end: 0; }
.banner__art--img img, .banner--wide .banner__art--img img { width: 100%; max-width: none; height: 100%; aspect-ratio: auto; object-fit: cover; border-radius: 0; box-shadow: none; transform: none; }
.banner--wide .banner__art--img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, var(--store-primary-dark), transparent 38%); }

@media (max-width: 1199px) {
  .plan__price { flex-wrap: wrap; }
  .plan__price b { font-size: 30px; }
  .tstrip__item { padding-inline: 10px; gap: 10px; }
  .tstrip__item small { font-size: 12px; }
  .deals__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--h { grid-template-columns: 110px minmax(0, 1fr); }
  .grid-books--one { --one: 4; }
  body[data-books-per-row] .grid-books--one > :nth-child(n+5) { display: none; }
}
@media (max-width: 991px) {
  .hero-m__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
  .hero-m__art { min-height: 300px; }
  .hero-m__search { display: none; }
  .hero-m__title { font-size: 38px; }
  .grid-3[data-region="home_bundles"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .grid-3[data-region="home_bundles"] > .plan { grid-column: auto !important; padding: 20px 14px; gap: 10px; }
  .plan__covers img { width: 50px; }
  .plan__name { font-size: 18px; }
  .plan__desc { font-size: 13px; }
  .plan__price b { font-size: 26px; }
  .trust-strip { margin-top: 0; padding-top: 16px; }
  .tstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--radius); row-gap: 6px; }
  .tstrip__item:nth-child(3) { border-inline-start: 0; }
  .rcats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
  body[data-books-per-row] .grid-books--one > :nth-child(n+4) { display: none; }
  .posts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .post-card__excerpt { display: none; }
  .grid-authors--home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .hero-m__grid { grid-template-columns: 1fr; gap: 10px; padding-block: 18px 58px; }
  .hero-m__art { order: -1; min-height: 200px; }
  .hero-m__art img { width: 30%; }
  .hero-m__art img:nth-of-type(2) { width: 34%; }
  .hero-m__circle { width: 62%; }
  .hero-m__title { margin-top: 10px; font-size: 30px; }
  .hero-m__search { display: none; }
  .hero-m__ctrl { padding-bottom: 16px; }
  .trust-strip { padding-top: 12px; }
  .tstrip, .rcats, .posts, .revs, .deals__items { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .tstrip { border: 0; box-shadow: none; background: transparent; padding-block: 0; gap: 8px; }
  .tstrip__item { flex: 0 0 auto; background: #fff; border: 1px solid var(--line) !important; border-radius: var(--radius-pill); padding: 6px 14px 6px 8px; scroll-snap-align: start; }
  .tstrip__item i { width: 36px; height: 36px; }
  .tstrip__item svg { width: 18px; height: 18px; }
  .tstrip__item b { font-size: 13.5px; white-space: nowrap; }
  .tstrip__item small { white-space: nowrap; }
  .section--cats { padding-top: 24px; }
  .rcats { gap: 12px; padding-bottom: 4px; }
  .rcat { flex: 0 0 96px; scroll-snap-align: start; }
  .rcat__img { border-width: 4px; margin-bottom: 4px; }
  .rcat__name { font-size: 14px; }
  .rcat__count { font-size: 12px; }
  .carousel__track { grid-auto-columns: 46%; gap: 10px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .sec-head__tools .arrows { display: none; }
  .row-tabs { order: 2; width: 100%; }
  .row-tabs button { padding: 6px 12px; }
  .deals__head { grid-template-columns: 1fr; row-gap: 6px; }
  .deals__head > * { grid-column: 1 !important; grid-row: auto !important; justify-self: start; }
  .deals__label { margin-top: 8px; }
  .drops__unit { width: 56px; }
  .drops__unit b { font-size: 19px; }
  .deals__items { gap: 10px; padding-bottom: 6px; }
  .deals__items > .card--h { flex: 0 0 86%; scroll-snap-align: start; }
  .card--h { grid-template-columns: 86px minmax(0, 1fr); gap: 10px; }
  .grid-authors--home .author { padding: 14px 8px 12px; }
  .posts, .revs { gap: 12px; padding-bottom: 6px; }
  .posts > *, .revs > * { flex: 0 0 82%; scroll-snap-align: start; }
  .post-card__excerpt { display: block; }
  .rev { padding: 18px; }
  .banner--wide { padding: 0; flex-direction: column; align-items: stretch; }
  .banner--wide .banner__art--img { position: relative; width: 100%; height: 170px; }
  .banner--wide .banner__art--img::after { background: linear-gradient(to top, var(--store-primary-dark), transparent 50%); }
  .banner--wide .banner__body { width: 100%; padding: 6px 20px 22px; }
  .hero-m:has(+ .trust-strip) .hero-m__grid { padding-bottom: 58px; }
  .hero-m:has(+ .trust-strip) .hero-m__ctrl { padding-bottom: 16px; }
  .dlv__art { display: none; }
  .dlv__tiles { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
  .dlv__tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .dlv__tile i { width: 36px; height: 36px; }
  .dlv__tile svg { width: 18px; height: 18px; }
  .dlv__tile b { font-size: 14px; }
  .dlv__tile small { font-size: 12px; }
  .dlv__actions .btn { flex: 1 1 0; padding-inline: 12px; }
  [data-region="home_bundles"] { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding: 14px var(--gutter) 8px !important; }
  [data-region="home_bundles"] > .plan { flex: 0 0 84%; scroll-snap-align: center; padding: 22px 16px; }
  .plan__price b { font-size: 30px; }
  .story__img { aspect-ratio: 4 / 3; border-radius: 40% 40% var(--radius) var(--radius) / 30% 30% var(--radius) var(--radius); }
}

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

/* صفحة التصنيف: التصنيفات الفرعيّة، والتبديل بين الشبكة والقائمة */
.subcats__list { display: contents; }
.view-toggle { display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface); }
.view-toggle button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.view-toggle button svg { width: 18px; height: 18px; }
.view-toggle button[aria-pressed="true"] { background: #fff; color: var(--store-primary); box-shadow: var(--shadow-sm); }
.shop-grid.is-list { grid-template-columns: 1fr !important; }
.shop-grid.is-list .card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }
.shop-grid.is-list .card__body { padding-top: 4px; }
.shop-grid.is-list .card__foot { margin-top: auto; justify-content: flex-start; gap: 18px; }

/* مؤلّفون آخرون: صفٌّ متوسّط بلا عمودٍ فارغ */
.grid-authors--others { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 34px; }
.grid-authors--others > .author { flex: 0 0 140px; }

/* المدوّنة */
.post-card .link-arrow { margin-top: 4px; }
.posts--blog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.post-card--wide .post-card__media { aspect-ratio: auto; min-height: 320px; }
.post-card--wide .post-card__body { padding: 34px; justify-content: center; gap: 10px; }
.post-card--wide .post-card__title { font-size: 26px; }
.post-card--wide .post-card__excerpt { font-size: 15.5px; }
.page-head--slim { padding-block: 14px; }
.article { max-width: 820px; padding-block: 30px 44px; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--muted); }
.article__tag { background: var(--surface); color: var(--store-primary); font-weight: 800; padding: 4px 12px; border-radius: var(--radius-pill); }
.article__title { font-size: 38px; font-weight: 800; line-height: 1.35; margin-top: 12px; text-wrap: balance; }
.article__cover { margin-top: 22px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); }
.article__cover img { width: 100%; height: 100%; object-fit: cover; }
.article__body { margin-top: 26px; font-size: 17px; line-height: 2; }
.article__body p + p, .article__body h2 + p { margin-top: 10px; }
.article__body h2 { font-size: 22px; font-weight: 800; margin-top: 26px; color: var(--ink-dark); }
.article__body blockquote { margin: 24px 0; padding: 18px 22px; border-inline-start: 5px solid var(--store-accent); background: var(--surface); border-radius: var(--radius-sm); font-weight: 700; color: var(--ink-dark); }
.article__books { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 30px; padding-top: 22px; border-top: 1px dashed var(--line); }

@media (max-width: 991px) {
  .post-card--wide { grid-template-columns: 1fr; }
  .post-card--wide .post-card__media { min-height: 0; aspect-ratio: 16 / 9; }
  .post-card--wide .post-card__body { padding: 22px; }
  .posts--blog .post-card__excerpt { display: block; }
  .posts--blog { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 575px) {
  body[data-books-per-row] .grid-books--one > * { display: flex !important; }
  .grid-authors--others { gap: 16px; }
  .grid-authors--others > .author { flex-basis: 120px; }
  .shop-grid.is-list .card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .view-toggle { display: none; }
  .posts--blog { display: grid; grid-template-columns: 1fr; margin: 0; padding: 0; overflow: visible; }
  .posts--blog > * { flex: none; }
  .post-card--wide .post-card__title { font-size: 20px; }
  .article { padding-block: 18px 30px; }
  .article__title { font-size: 26px; }
  .article__body { font-size: 16px; line-height: 1.95; }
  .article__books .btn { width: 100%; }
}

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