/* ==========================================================================
   قالب «سَمَر» — منصّة ناشر
   طابع داكن هادئ: خلفيّة ليليّة، وبطاقات أفتح قليلًا بحدود رفيعة، ولون هويّة
   واحد للأزرار والإبرازات. الألوان المحايدة كلّها مشتقّة من --store-bg و
   --store-text، فيبقى القالب سليمًا إن اختار الناشر خلفيّة فاتحة.
   ========================================================================== */

:root {
  /* ألوان الهويّة (قيم تجريبيّة يغيّرها الناشر) */
  --store-primary: #6d4dff;
  --store-primary-dark: #5133e0;
  --store-accent: #ffb547;
  --store-bg: #0d0f1c;
  --store-text: #eceaf6;

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

  /* محايدة مشتقّة */
  --surface: color-mix(in srgb, var(--store-text) 3%, var(--store-bg));
  --card: color-mix(in srgb, var(--store-text) 5%, var(--store-bg));
  --surface-2: color-mix(in srgb, var(--store-text) 10%, var(--store-bg));
  --line: color-mix(in srgb, var(--store-text) 13%, var(--store-bg));
  --line-strong: color-mix(in srgb, var(--store-text) 24%, var(--store-bg));
  --muted: color-mix(in srgb, var(--store-text) 75%, var(--store-bg));
  --muted-2: color-mix(in srgb, var(--store-text) 70%, var(--store-bg));
  --deep: color-mix(in srgb, #000 22%, var(--store-bg));
  --heading: var(--store-text);
  --primary-ink: color-mix(in srgb, var(--store-primary) 60%, var(--store-text));
  --primary-soft: color-mix(in srgb, var(--store-primary) 16%, var(--store-bg));
  --accent-soft: color-mix(in srgb, var(--store-accent) 14%, var(--store-bg));
  --on-primary: #fff;
  --on-accent: #14151f;
  --gold: #f5b021;
  --danger: color-mix(in srgb, #ff3b5c 75%, var(--store-text));
  --danger-soft: color-mix(in srgb, #ff3b5c 14%, var(--store-bg));
  --success: color-mix(in srgb, #20c47a 70%, var(--store-text));
  --success-soft: color-mix(in srgb, #20c47a 12%, var(--store-bg));
  --warn: color-mix(in srgb, #ff9a1f 75%, var(--store-text));
  --warn-soft: color-mix(in srgb, #ff9a1f 12%, var(--store-bg));

  /* المقاييس */
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1320px;
  --gutter: 16px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px color-mix(in srgb, #000 35%, transparent);
  --shadow-lg: 0 18px 50px color-mix(in srgb, #000 50%, transparent);
  --glow: 0 0 0 1px color-mix(in srgb, var(--store-primary) 55%, transparent), 0 12px 34px color-mix(in srgb, var(--store-primary) 28%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

body[data-corners="sharp"] { --radius: 3px; --radius-sm: 2px; --radius-pill: 3px; }

/* ---------- أساسيّات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
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-accent); 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: 34px; }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.stack > * + * { margin-top: 12px; }

/* ==========================================================================
   الأزرار
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border-radius: var(--radius-pill);
  font-weight: 800; font-size: 15px; line-height: 1; border: 1.5px solid transparent; white-space: nowrap;
  transition: background .2s var(--ease), color .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--store-primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--store-primary-dark); box-shadow: var(--glow); }
.btn--accent { background: var(--store-accent); color: var(--on-accent); }
.btn--accent:hover { filter: brightness(1.06); }
.btn--outline { border-color: var(--line-strong); color: var(--store-text); background: transparent; }
.btn--outline:hover { border-color: var(--store-primary); color: var(--primary-ink); }
.btn--light { background: var(--surface-2); color: var(--store-text); border-color: var(--line); }
.btn--light:hover { border-color: var(--line-strong); }
.btn--dark { background: var(--deep); color: var(--store-text); border-color: var(--line); }
.btn--dark:hover { border-color: var(--line-strong); }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { min-height: 54px; padding: 0 32px; 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; box-shadow: none; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--primary-ink); 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: var(--surface-2); color: var(--store-text); border: 1px solid var(--line); transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--store-primary); color: var(--on-primary); border-color: var(--store-primary); }
.icon-btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   الشريط العلويّ والرأس
   ========================================================================== */
.topbar { background: var(--deep); color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.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 svg { width: 16px; height: 16px; color: var(--store-accent); }
.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: var(--store-text); }
.topbar__links svg { width: 15px; height: 15px; }

/* الرأس مثبّتٌ أعلى الشاشة؛ الشريط العلويّ فوقه يمرّ */
.header { background: var(--store-bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
#reviews { scroll-margin-top: 188px; }
@media (max-width: 991px) { #reviews { scroll-margin-top: 140px; } }
.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: 12px; }
.brand__name { font-size: 22px; font-weight: 800; color: var(--heading); 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; height: 50px; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: var(--radius-pill); background: var(--card);
  transition: border-color .2s, box-shadow .2s;
}
.search__box:focus-within { border-color: var(--store-primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search__cat { display: inline-flex; align-items: center; gap: 6px; padding-inline: 18px 14px; border-inline-end: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--store-text); 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; color: var(--store-text); }
.search__input:focus { outline: none; }
.search__input::placeholder { color: var(--muted-2); }
.search__btn { display: inline-flex; align-items: center; gap: 8px; margin: 5px; padding-inline: 20px; border-radius: var(--radius-pill); background: var(--store-primary); color: var(--on-primary); font-weight: 800; }
.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(--primary-ink); }

.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; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.hact__icon svg { width: 22px; height: 22px; }
.hact__badge {
  position: absolute; top: -4px; inset-inline-start: -4px; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 10px;
  display: grid; place-items: center; background: var(--store-accent); color: var(--on-accent); font-size: 11px; font-weight: 800; line-height: 1;
  border: 2px solid var(--store-bg);
}
.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: 800; }
.hact:hover .hact__icon { border-color: var(--store-primary); color: var(--primary-ink); }
.burger { display: none; }
.mobile-search { display: none; }

.navbar { border-top: 1px solid var(--line); }
.navbar .container { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.allcats { position: relative; }
.allcats__btn { display: flex; align-items: center; gap: 10px; height: 42px; padding-inline: 18px; border-radius: var(--radius-pill); background: var(--store-primary); color: var(--on-primary); font-weight: 800; }
.allcats__btn:hover { background: var(--store-primary-dark); }
.allcats__btn svg:last-child { width: 16px; height: 16px; transition: transform .2s; }
.allcats.is-open .allcats__btn svg:last-child { transform: rotate(180deg); }
.allcats__menu {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: 270px;
  background: var(--card); color: var(--store-text); border: 1px solid var(--line); border-radius: var(--radius);
  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-2); color: var(--primary-ink); }
.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(--primary-ink); font-weight: 700; }
.mainnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.mainnav a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; font-weight: 700; font-size: 15px; color: var(--muted); border-radius: var(--radius-pill); transition: color .2s, background .2s; }
.mainnav a:hover { color: var(--store-text); background: var(--surface-2); }
.mainnav a.is-active { color: var(--store-text); background: var(--surface-2); }
.mainnav .dot { width: 8px; height: 8px; border-radius: 50%; }
.mainnav__tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: var(--store-accent); color: var(--on-accent); line-height: 1.3; }
.navbar__extra { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--store-accent); }
.navbar__extra svg { width: 18px; height: 18px; }

/* درج الهاتف */
.drawer-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, #000 60%, transparent); 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: var(--card); 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); border-inline-end: 1px solid var(--line);
}
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(--primary-ink); 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(--line); 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(--primary-ink); }
.tabbar { display: none; }

/* شريط الروابط السريعة */
.quicklinks { border-bottom: 1px solid var(--line); background: var(--surface); }
.quicklinks .container { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 12px; }
.qlink { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; white-space: nowrap; transition: border-color .2s, color .2s; }
.qlink svg { width: 17px; height: 17px; color: var(--primary-ink); }
.qlink:hover, .qlink.is-active { border-color: var(--store-primary); color: var(--primary-ink); }
.qlink .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ==========================================================================
   عنوان القسم
   ========================================================================== */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sec-head__kicker { display: block; font-size: 13px; font-weight: 800; color: var(--store-accent); line-height: 1.5; margin-bottom: 4px; }
.sec-head__title { font-size: 26px; font-weight: 800; color: var(--heading); line-height: 1.25; }
.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: 700; color: var(--muted); border: 1px solid transparent; }
.tabs button:is(.is-active, [aria-selected="true"]) { color: var(--store-text); border-color: var(--line-strong); background: var(--surface-2); }
.tabs button:hover { color: var(--store-text); }
.arrows { display: flex; gap: 6px; }
.arrows button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); }
.arrows button:hover { background: var(--store-primary); color: var(--on-primary); 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: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--store-primary) 60%, var(--line)); box-shadow: var(--shadow); transform: translateY(-3px); }
body[data-card-style="classic"] .card { border-color: transparent; background: var(--surface-2); }
body[data-card-style="minimal"] .card { border-color: transparent; background: transparent; padding: 0; }
body[data-card-style="minimal"] .card:hover { box-shadow: none; }

.card__media { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.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.05); }

.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; border: 2px solid color-mix(in srgb, #fff 85%, transparent); box-shadow: 0 2px 8px color-mix(in srgb, #000 40%, transparent);
}
.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 9px; border-radius: 6px; line-height: 1.4; }
.badge--sale { background: #e11d48; color: #fff; }
.badge--new { background: var(--store-accent); color: var(--on-accent); }

/* المفضّلة والنظرة السريعة تطفوان فوق الغلاف ولا تحجزان مكانًا (الملحق، البند 7) */
.card__wish, .card__qv {
  position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: color-mix(in srgb, var(--store-bg) 80%, transparent); color: var(--store-text);
  border: 1px solid var(--line); backdrop-filter: blur(4px);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s, color .2s, background .2s;
}
.card__qv { inset-inline-end: 56px; transition-delay: .04s; }
.card__wish svg, .card__qv svg { width: 18px; height: 18px; }
.card:hover :is(.card__wish, .card__qv), :is(.card__wish, .card__qv):focus-visible { opacity: 1; transform: none; }
.card__wish:hover, .card__wish.is-active { color: var(--danger); }
.card__qv:hover { background: var(--store-primary); border-color: var(--store-primary); color: var(--on-primary); }
.card__wish.is-active svg { fill: currentColor; }
@media (hover: none) { .card__wish, .card__qv { opacity: 1; transform: none; } }

.card__soldout { position: absolute; inset-inline: 0; top: 50%; transform: translateY(-50%); z-index: 1; background: color-mix(in srgb, #000 75%, transparent); color: #fff; text-align: center; font-weight: 800; font-size: 13px; padding: 8px; }
.card.is-soldout .card__media img { filter: grayscale(.9) brightness(.7); }

.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(--primary-ink); }
.card__title { font-size: 15px; font-weight: 800; line-height: 1.45; color: var(--heading); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__title a:hover { color: var(--primary-ink); }
.card__foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 8px; }
.card__cart {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 40px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--store-text); font-weight: 800; font-size: 14px; border: 1px solid var(--line); transition: background .2s, color .2s, border-color .2s;
}
.card__cart svg { width: 17px; height: 17px; }
.card:hover .card__cart, .card__cart:hover { background: var(--store-primary); border-color: var(--store-primary); color: var(--on-primary); }
.card__cart[disabled] { background: var(--surface-2); color: var(--muted-2); border-color: var(--line); cursor: not-allowed; }
.card:hover .card__cart[disabled] { background: var(--surface-2); color: var(--muted-2); border-color: var(--line); }

/* السعر */
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price__now { font-size: 18px; font-weight: 800; color: var(--heading); }
.price--sale .price__now { color: var(--store-accent); }
.price__old { font-size: 13px; color: var(--muted-2); text-decoration: line-through; }
.price--lg .price__now { font-size: 30px; }
.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: var(--line-strong); }
.rating--lg .stars svg { width: 18px; height: 18px; }
.rating--lg { font-size: 14px; }

/* ==========================================================================
   بطاقة عرض اليوم
   ========================================================================== */
.deal {
  position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--store-primary) 12%, var(--card)), var(--card) 60%);
  border: 1px solid color-mix(in srgb, var(--store-primary) 50%, var(--line)); border-radius: var(--radius);
}
.deal .card__media { aspect-ratio: 2 / 3; }
.deal .badges { top: auto; bottom: 8px; }
.deal__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.deal__title { font-size: 18px; font-weight: 800; line-height: 1.4; color: var(--heading); }

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

/* ==========================================================================
   البطاقة المميّزة («اختيار المحرّر»)
   ========================================================================== */
.feature {
  position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; align-items: center; padding: 22px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); overflow: hidden; isolation: isolate;
}
.feature::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 120% at 100% 0%, var(--primary-soft), transparent 60%); }
.feature__cover { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lg); }
.feature__cover img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.feature__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--store-accent); }
.feature__tag svg { width: 14px; height: 14px; }
.feature__title { font-size: 22px; font-weight: 800; line-height: 1.35; color: var(--heading); }
.feature__text { color: var(--muted); font-size: 14px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feature__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

/* صيغ الكتاب (أيقونات) */
.formats-icons { display: flex; gap: 8px; flex-wrap: wrap; }
.fmt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 12px 5px 6px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line); }
.fmt i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.fmt i svg { width: 13px; height: 13px; }


/* ==========================================================================
   البانرات
   ========================================================================== */
.banner {
  position: relative; display: flex; align-items: center; overflow: hidden; isolation: isolate;
  border-radius: var(--radius); min-height: 200px; padding: 28px 30px; color: var(--store-text); border: 1px solid var(--line);
}
.banner__bg { position: absolute; inset: 0; z-index: -2; }
.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: 800; color: var(--store-accent); }
.banner__title { font-size: 24px; font-weight: 800; line-height: 1.3; color: var(--heading); }
.banner__text { font-size: 14px; color: var(--muted); }
.banner .link-arrow { margin-top: 8px; }
.banner--violet .banner__bg { background: radial-gradient(110% 130% at 0% 100%, color-mix(in srgb, var(--store-primary) 38%, var(--card)), var(--card) 70%); }
.banner--amber .banner__bg { background: radial-gradient(110% 130% at 0% 100%, color-mix(in srgb, var(--store-accent) 26%, var(--card)), var(--card) 70%); }
.banner--primary { color: var(--on-primary); border-color: transparent; }
.banner--primary .banner__bg { background: radial-gradient(120% 140% at 0% 100%, var(--store-primary) 0%, var(--store-primary-dark) 75%); }
.banner--primary .banner__title { color: var(--on-primary); }
.banner--primary .banner__kicker { color: var(--on-primary); opacity: .9; }
.banner--primary .banner__text { color: color-mix(in srgb, var(--on-primary) 88%, transparent); }
.banner--primary .link-arrow { color: var(--on-primary); }

/* ==========================================================================
   التصنيف والمؤلّف وشريط الثقة
   ========================================================================== */
.cat { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 18px 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.cat:hover { border-color: var(--store-primary); transform: translateY(-3px); }
.cat__img { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 4px var(--surface-2); }
.cat__img img { width: 100%; height: 100%; object-fit: cover; }
.cat__name { font-weight: 800; font-size: 15px; line-height: 1.3; }
.cat__count { font-size: 12px; color: var(--muted); background: var(--surface-2); 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 var(--store-bg); box-shadow: 0 0 0 2px var(--line-strong); 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: 800; }
.author__meta { font-size: 13px; color: var(--muted); }

.trust { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); 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(--primary-soft); color: var(--primary-ink); 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: 800; border: 1px solid var(--line); background: var(--card); }
.pager a:hover { border-color: var(--store-primary); color: var(--primary-ink); }
.pager .is-current { background: var(--store-primary); border-color: var(--store-primary); color: var(--on-primary); }
.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: 32px 36px; border-radius: var(--radius);
  background: radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--store-primary) 40%, var(--card)), var(--card) 65%);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.newsletter__title { font-size: 24px; font-weight: 800; line-height: 1.35; color: var(--heading); }
.newsletter__text { color: var(--muted); font-size: 14px; margin-top: 4px; }
.newsletter__form { display: flex; gap: 8px; background: var(--deep); border: 1px solid var(--line); 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::placeholder { color: var(--muted-2); }
.newsletter__form input:focus { outline: none; }

/* ==========================================================================
   التذييل
   ========================================================================== */
.footer { background: var(--deep); color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.footer a:hover { color: var(--store-text); }
.footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; padding-block: 48px 36px; }
.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: var(--store-text); font-size: 19px; font-weight: 800; direction: ltr; text-align: end; }
.footer__title { color: var(--store-text); 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: var(--surface-2); border: 1px solid var(--line); }
.footer__social a:hover { background: var(--store-primary); color: var(--on-primary); border-color: var(--store-primary); }
.footer__social svg { width: 17px; height: 17px; }
.footer__bottom { border-top: 1px solid var(--line); }
.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: 6px; display: inline-grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--store-text); font-size: 12px; font-weight: 800; }

/* ==========================================================================
   الحقول
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field > span { font-size: 14px; font-weight: 700; }
.input, .select { height: 46px; padding-inline: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--store-text); width: 100%; }
.input::placeholder { color: var(--muted-2); }
.input:focus, .select:focus { outline: none; border-color: var(--store-primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-pill); height: 46px; overflow: hidden; background: var(--card); }
.qty button { width: 42px; height: 100%; display: grid; place-items: center; }
.qty button:hover { background: var(--surface-2); }
.qty input { width: 44px; text-align: center; border: 0; font-weight: 800; background: transparent; color: var(--store-text); }
.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-2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.chip svg { width: 14px; height: 14px; }
.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: var(--success-soft); 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: var(--danger-soft); color: var(--danger); }
.coupon-applied button svg { width: 16px; height: 16px; }

/* ==========================================================================
   صفحة المكوّنات (للمراجعة فقط)
   ========================================================================== */
.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; 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-2); 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-4 { display: grid; grid-template-columns: repeat(4, 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; background: var(--card); }
.swatch i { display: block; height: 64px; border-bottom: 1px solid var(--line); }
.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: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); width: 270px; 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(--primary-ink); }
.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; }


/* ==========================================================================
   الرئيسيّة
   ========================================================================== */
.hero { padding-block: 22px 0; }
.slider { position: relative; display: grid; border-radius: calc(var(--radius) + 6px); overflow: hidden; min-height: 480px; isolation: isolate; border: 1px solid var(--line); }
.slide {
  grid-area: 1 / 1; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; padding: 44px 60px;
  opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility .7s;
  background: radial-gradient(90% 120% at 15% 50%, color-mix(in srgb, var(--hue) 45%, var(--card)) 0%, var(--card) 62%, var(--deep) 100%);
}
.slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.slide--1 { --hue: var(--store-primary); }
.slide--2 { --hue: var(--type-audio); }
.slide--3 { --hue: var(--type-edu); }
.slide__body { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.slide__status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--success); }
.slide__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--success-soft); }
.slide__title { font-size: 46px; line-height: 1.15; font-weight: 800; color: var(--heading); text-wrap: balance; }
.slide__title span { display: block; color: var(--store-accent); }
.slide__text { font-size: 16px; color: var(--muted); max-width: 42ch; }
.slide__price { display: flex; align-items: baseline; gap: 10px; }
.slide__price b { font-size: 30px; font-weight: 800; color: var(--heading); }
.slide__price del { color: var(--muted-2); }
.slide__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.slide__art { position: relative; height: 100%; min-height: 320px; display: flex; align-items: center; justify-content: center; }
.slide__art img { position: absolute; width: 38%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 30px 60px color-mix(in srgb, #000 55%, transparent); }
.slide__art img:nth-child(1) { transform: translateX(-56%) rotate(-10deg) scale(.84); opacity: .9; }
.slide__art img:nth-child(2) { z-index: 2; width: 44%; }
.slide__art img:nth-child(3) { transform: translateX(56%) rotate(10deg) scale(.84); opacity: .9; }
.slide__art::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--hue) 55%, transparent), transparent 70%); filter: blur(10px); }
.slider__dots { position: absolute; bottom: 20px; inset-inline-start: 60px; display: flex; gap: 8px; z-index: 3; }
.slider__dots button { width: 10px; height: 10px; border-radius: 6px; background: var(--line-strong); transition: width .3s var(--ease), background .3s; }
.slider__dots button.is-active { width: 30px; background: var(--store-accent); }
.slider__arrows { position: absolute; bottom: 14px; inset-inline-end: 18px; display: flex; gap: 8px; z-index: 3; }

.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; }

/* بانر الكتاب المميّز */
.spotlight {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 30px; align-items: center;
  padding: 36px 44px; border-radius: calc(var(--radius) + 6px); overflow: hidden; isolation: isolate; border: 1px solid var(--line);
  background: radial-gradient(80% 140% at 0% 50%, color-mix(in srgb, var(--store-accent) 22%, var(--card)), var(--card) 55%, var(--deep));
}
.spotlight__body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.spotlight__kicker { font-size: 13px; font-weight: 800; color: var(--store-accent); letter-spacing: .02em; }
.spotlight__title { font-size: 34px; font-weight: 800; line-height: 1.25; color: var(--heading); }
.spotlight__text { color: var(--muted); max-width: 48ch; line-height: 1.85; }
.spotlight__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spotlight__art { display: flex; justify-content: center; }
.spotlight__art img { width: min(52%, 200px); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 30px 60px color-mix(in srgb, #000 55%, transparent); transform: rotate(-4deg); }

/* الأكثر رواجًا الآن: بانرٌ بجانب صفٍّ دوّار */
.trend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr); gap: 16px; align-items: stretch; }
.trend .banner { min-height: 100%; flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 26px 24px; }
.trend .banner__art { position: relative; inset: auto; width: 100%; flex: 1; min-height: 190px; margin-bottom: 18px; }
.trend .banner__body { width: 100%; }
.trend .banner__title { font-size: 26px; }

/* دعوة المكتبة الرقميّة */
.cta {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 40px 44px;
  border-radius: calc(var(--radius) + 6px); border: 1px solid var(--line); position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(120deg, var(--deep), var(--card));
}
.cta::before { content: ""; position: absolute; inset-inline-end: -60px; top: -80px; width: 340px; height: 340px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, color-mix(in srgb, var(--store-primary) 45%, transparent), transparent 70%); }
.cta__title { font-size: 30px; font-weight: 800; line-height: 1.3; color: var(--heading); text-wrap: balance; }
.cta__text { color: var(--muted); margin-top: 8px; max-width: 56ch; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cta__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 1199px) {
  .slide { padding: 36px 40px; }
  .slide__title { font-size: 38px; }
  .slider__dots { inset-inline-start: 40px; }
}
@media (max-width: 991px) {
  .slider { min-height: 400px; }
  .grid-cats, .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; }
  .grid-2 { grid-template-columns: 1fr; }
  .spotlight { padding: 28px; }
  .spotlight__title { font-size: 26px; }
  .trend { grid-template-columns: 1fr; }
  .trend .banner { min-height: 0; flex-direction: row; align-items: center; padding: 22px 24px; }
  .trend .banner__art { order: 2; width: 38%; min-height: 170px; margin: 0; }
  .trend .banner__body { width: 62%; }
  .cta { grid-template-columns: 1fr; padding: 30px; }
}
@media (max-width: 575px) {
  .hero { padding-top: 14px; }
  .slider { min-height: 0; }
  .slide { grid-template-columns: 1fr; padding: 24px 20px 56px; gap: 8px; }
  .slide__art { order: -1; min-height: 200px; }
  .slide__art img { width: 30%; }
  .slide__art img:nth-child(2) { width: 34%; }
  .slide__title { font-size: 28px; }
  .slide__text { font-size: 14px; }
  .slider__dots { inset-inline-start: 20px; bottom: 22px; }
  .slider__arrows { display: none; }
  .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: 78px; height: 78px; }
  .author__img { width: 92px; height: 92px; }
  .spotlight { grid-template-columns: 1fr; padding: 22px 20px; gap: 18px; }
  .spotlight__art { order: -1; }
  .spotlight__art img { width: 44%; }
  .spotlight__title { font-size: 22px; }
  .trend .banner { padding: 18px; }
  .trend .banner__art { width: 40%; min-height: 140px; }
  .trend .banner__body { width: 60%; }
  .trend .banner__title { font-size: 20px; }
  .cta { padding: 24px 20px; }
  .cta__title { font-size: 22px; }
  .grid-deals { grid-template-columns: 1fr; }
}

/* ==========================================================================
   صفحة التصنيف والبحث
   ========================================================================== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--primary-ink); }
.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(--heading); 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 var(--line-strong); }
.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: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.subcats a:hover, .subcats a.is-active { border-color: var(--primary-ink); color: var(--primary-ink); }

.shop { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; padding-block: 24px 40px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 188px; }
.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(--primary-ink); }
.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(--primary-ink); 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: var(--card); 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: 188px; }
.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(--primary-ink); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main { position: relative; background: radial-gradient(80% 80% at 50% 40%, var(--primary-soft), var(--card)); border: 1px solid var(--line); 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 26px 50px color-mix(in srgb, #000 50%, transparent); }
.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(--heading); 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(--primary-ink); 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: var(--danger-soft); 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: var(--warn); }
.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(--card); border: 1px solid var(--line); 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(--primary-ink); }
.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: var(--card); }
.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(--primary-ink); box-shadow: 0 0 0 1px var(--store-primary); }
.format:not(.is-current):hover { border-color: var(--line-strong); }
.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(--primary-ink); 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(--primary-ink); border-color: var(--primary-ink); }
.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: color-mix(in srgb, var(--type-audio) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--type-audio) 35%, var(--line)); }
.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: var(--surface-2); 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: color-mix(in srgb, var(--type-edu) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--type-edu) 35%, var(--line)); }
.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: var(--warn); background: var(--warn-soft); 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 var(--store-bg); box-shadow: 0 0 0 2px var(--line-strong), 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(--primary-ink); }
.author-hero__name { font-size: 34px; font-weight: 800; line-height: 1.2; color: var(--heading); }
.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: var(--card); 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(--heading); }
.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: var(--card); 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(--primary-ink); }
.freeship b { color: var(--primary-ink); }
.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: var(--card); 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(--primary-ink); }
.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: var(--danger-soft); 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: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 16px; position: sticky; top: 188px; }
.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: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-cart__icon { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--primary-ink); }
.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(--primary-ink); 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(--line-strong); 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(--primary-ink); }
.nf__title { font-size: 36px; font-weight: 800; line-height: 1.25; color: var(--heading); 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; }
}


/* العروض المتجاوبة لصفحات التصنيف والمنتج */
@media (max-width: 1199px) {
  .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) {
  .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; }
  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: var(--card); border-top: 1px solid var(--line);
    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; }
}
@media (max-width: 575px) {
  .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%; }
}

/* ==========================================================================
   العروض المتجاوبة
   ========================================================================== */
@media (max-width: 1199px) {
  .header__main { gap: 18px; }
  .hact__text { display: none; }
  .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)); }
}

@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; }
  .header .search { display: none; }
  .mobile-search { display: block; padding-bottom: 12px; }
  .mobile-search .search__box { height: 46px; }
  .mobile-search .search__cat { display: none; }
  .mobile-search .search__btn span { display: none; }
  .header__actions .hact--hide-md { display: none; }
  .brand { justify-self: start; }
  .navbar { display: none; }
  .trust { grid-template-columns: 1fr 1fr; }
  .trust__item:nth-child(3) { border-inline-start: 0; }
  .trust__item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid-books { --cols: 3 !important; }
  .deal { grid-template-columns: 120px 1fr; }
  .newsletter { grid-template-columns: 1fr; }
  .cmp-grid-3, .cmp-grid-4 { grid-template-columns: 1fr 1fr; }
  .cmp-grid-2 { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 70; height: 64px;
    background: var(--card); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .is-active { color: var(--primary-ink); }
  .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: 10px; }
  .header__actions .hact--hide-sm { display: none; }
  .hact__icon { width: 40px; height: 40px; }
  .sec-head { flex-wrap: wrap; align-items: center; }
  .sec-head__title { font-size: 21px; }
  .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 { --cols: 2 !important; gap: 10px; }
  .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; }
  .card { padding: 8px; }
  .card__title { font-size: 14px; }
  .price__now { font-size: 16px; }
  .card__cart { min-height: 40px; font-size: 13px; }
  .card__cart span { display: none; }
  .feature__foot .btn--sm, .deal__cart { min-height: 40px; }
  .type-dot { width: 28px; height: 28px; }
  .type-dot svg { width: 14px; height: 14px; }
  .deal { grid-template-columns: 100px 1fr; gap: 12px; padding: 12px; }
  .feature { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .feature__title { font-size: 18px; }
  .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; }
  .footer__top { grid-template-columns: 1fr; gap: 26px; padding-block: 36px 26px; }
  .footer__bottom .container { justify-content: center; text-align: center; }
  .cmp-grid-3, .cmp-grid-4 { grid-template-columns: 1fr; }
  .cmp-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-panel { width: calc(100% - 28px); inset-inline-end: 14px; }
}

@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,
body[data-show-reviews="false"] .reviews-tab,
body[data-show-quicklinks="false"] .quicklinks { display: none; }

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

/* الباقات (كما كانت «باقة الشهر» في المرجع) */
.bundle-list { display: grid; gap: 16px; }
.bundle {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
}
.bundle__items { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px; flex-wrap: wrap; }
.bundle__item { display: grid; gap: 8px; width: 150px; text-align: center; }
.bundle__item .card__media { box-shadow: var(--shadow); }
.bundle__item-title { font-size: 14px; font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bundle__item .price { justify-content: center; }
.bundle__item .price__now { font-size: 15px; }
.bundle__plus { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--primary-ink); flex: none; margin-bottom: 70px; }
.bundle__plus svg { width: 18px; height: 18px; }
.bundle__buy { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px; background: linear-gradient(170deg, var(--primary-soft), var(--surface)); border-inline-start: 1px solid var(--line); }
.bundle__label { font-size: 14px; font-weight: 800; color: var(--store-accent); display: flex; align-items: center; gap: 8px; }
.bundle__label svg { width: 18px; height: 18px; }
.bundle__title { font-size: 20px; font-weight: 800; line-height: 1.35; color: var(--heading); }
.bundle__rows { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.bundle__rows div { display: flex; justify-content: space-between; gap: 10px; }
.bundle__rows del { color: var(--muted-2); }
.bundle__save { color: var(--success); font-weight: 800; }
.bundle__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.bundle__total span { font-weight: 800; }
.bundle__total b { font-size: 28px; font-weight: 800; color: var(--heading); }
.spotlight__bundle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--primary-ink); }
.spotlight__bundle svg { width: 18px; height: 18px; }

/* عدّاد العرض (واحدٌ لقسم «عروض اليوم») */
.countdown { display: flex; gap: 6px; margin-top: 4px; }
.countdown__unit { flex: 1; min-width: 0; max-width: 62px; padding: 7px 2px; border-radius: var(--radius-sm); background: var(--deep); border: 1px solid var(--line); text-align: center; line-height: 1.15; }
.countdown b { display: block; font-size: 20px; font-weight: 800; color: var(--store-accent); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 11px; color: var(--muted); }

/* المدوّنة */
.post { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s; }
.post:hover { border-color: var(--line-strong); }
.post__img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.post:hover .post__img img { transform: scale(1.05); }
.post__body { display: grid; gap: 8px; padding: 16px; }
.post__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.post__meta svg { width: 14px; height: 14px; }
.post__title { font-size: 16px; font-weight: 800; line-height: 1.5; }
.post__title:hover { color: var(--primary-ink); }
.post__excerpt { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-grid { row-gap: 22px; }
.blog-pager { margin-top: 28px; }
.post-page__title { margin-top: 10px; max-width: 900px; line-height: 1.35; }
.post-page__meta { margin-top: 8px; font-size: 13px; }
.post-page__wrap { max-width: 860px; padding-block: 28px 44px; }
.post-page__hero { margin: 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.post-page__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-page__body { padding-top: 26px; font-size: 18px; line-height: 1.95; }
.post-page__body p + p { margin-top: 16px; }

/* الأسئلة الشائعة */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.faq-head__text { color: var(--muted); margin-top: 6px; font-size: 14px; }
.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.faq-item[open] { border-color: var(--line-strong); }
.faq-item summary { position: relative; list-style: none; cursor: pointer; padding: 16px 18px; padding-inline-end: 52px; font-weight: 800; color: var(--heading); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; inset-inline-end: 16px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
  background: var(--surface-2) linear-gradient(var(--primary-ink), var(--primary-ink)) center / 11px 2px no-repeat; border: 1px solid var(--line);
}
.faq-item:not([open]) summary::after {
  background-image: linear-gradient(var(--primary-ink), var(--primary-ink)), linear-gradient(var(--primary-ink), var(--primary-ink));
  background-size: 11px 2px, 2px 11px; background-position: center; background-repeat: no-repeat;
}
.faq-item__answer { padding: 0 18px 16px; color: var(--muted); font-size: 15px; }

/* اشترِ أكثر ووفّر */
.qty-deal { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-ink); font-size: 14px; font-weight: 800; }
.qty-deal svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .bundle { grid-template-columns: 1fr; }
  .bundle__buy { border-inline-start: 0; border-top: 1px solid var(--line); }
  .faq-wrap { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 600px) {
  .bundle__items { gap: 8px; padding: 18px 12px; flex-wrap: nowrap; }
  .bundle__item { width: auto; flex: 1; min-width: 0; }
  .bundle__plus { width: 26px; height: 26px; margin-bottom: 60px; }
  .bundle__plus svg { width: 14px; height: 14px; }
  .post-page__body { font-size: 16px; }
}

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

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

/* ================= التطوير الثاني: متجرٌ أغنى بلا فراغات ================= */

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

/* الصفّ الدوّار: يُمرَّر أفقيًّا بالسحب أو بالأسهم */
.carousel {
  --vis: 4; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; padding-bottom: 2px;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > .card { flex: 0 0 calc((100% - (var(--vis) - 1) * 16px) / var(--vis)); scroll-snap-align: start; }
.carousel > .card:hover { transform: none; }
.grid-books--carousel { --vis: var(--cols, 5); }
@media (max-width: 1199px) { .carousel { --vis: 3; } .grid-books--carousel { --vis: 4; } }
@media (max-width: 991px) { .grid-books--carousel { --vis: 3; } }
@media (max-width: 575px) {
  .carousel, .grid-books--carousel { --vis: 2.15; gap: 10px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .carousel > .card { flex-basis: calc((100% - 12px) / 2.15); }
}

/* عدّادٌ واحد لقسم «عروض اليوم» */
.countdown--head { align-items: center; gap: 6px; margin: 0; }
.countdown--head .countdown__unit { flex: none; width: 54px; padding: 5px 2px; }
.countdown--head b { font-size: 18px; }
.countdown__label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--store-accent); margin-inline-end: 4px; white-space: nowrap; }
.countdown__label svg { width: 16px; height: 16px; }
.deal__cart { align-self: flex-start; margin-top: auto; }
.deal__body .price { margin-bottom: 4px; }
@media (max-width: 575px) {
  .deals-head .sec-head__tools { flex-wrap: wrap; row-gap: 10px; }
  .countdown--head { width: 100%; }
  .countdown--head .countdown__unit { flex: 1; width: auto; }
}

/* آراء القرّاء في الرئيسيّة (على الكتب، من المشترين) */
.home-reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hreview { margin: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); position: relative; }
.hreview::before { content: "”"; position: absolute; top: 4px; inset-inline-end: 18px; font-size: 64px; line-height: 1; font-weight: 800; color: color-mix(in srgb, var(--store-primary) 45%, var(--card)); }
.hreview blockquote { margin: 0; color: var(--store-text); line-height: 1.85; font-size: 15px; }
.hreview__by { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.hreview__avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; }
.hreview__by > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hreview__name { font-weight: 800; font-size: 14px; }
.hreview__book { font-size: 13px; color: var(--muted); }
.hreview__book a { color: var(--primary-ink); font-weight: 700; }
.hreview__cover { width: 34px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; flex: none; box-shadow: var(--shadow); }
@media (max-width: 991px) {
  .home-reviews { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .hreview { flex: 0 0 min(360px, 82%); scroll-snap-align: start; }
}

/* الأسئلة الشائعة: صندوق مساعدة تحت العنوان بدل عمودٍ فارغ */
.faq-help { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; margin-top: 22px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.faq-help__icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--store-accent); }
.faq-help b { display: block; font-weight: 800; color: var(--heading); }
.faq-help p { font-size: 13px; color: var(--muted); }
.faq-help .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 900px) { .faq-help { margin-block: 14px 8px; } }

/* صيغ الكتاب في «كتاب الشهر» و«اختيار المحرّر» روابط بأسعارها */
a.fmt { transition: border-color .2s; }
a.fmt:hover { border-color: var(--store-primary); }
.fmt small { font-size: 12px; font-weight: 700; color: var(--muted); margin-inline-start: 2px; }

/* شريط الثقة في الهاتف: شريطٌ واحد مدمج يُمرَّر */
@media (max-width: 575px) {
  .trust-section { padding-top: 14px; }
  .trust { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius-sm); }
  .trust::-webkit-scrollbar { display: none; }
  .trust__item { flex: 0 0 auto; flex-direction: row; text-align: start; gap: 10px; padding: 10px 14px; scroll-snap-align: start; border-top: 0 !important; }
  .trust__item + .trust__item { border-inline-start: 1px solid var(--line) !important; }
  .trust__icon { width: 34px; height: 34px; }
  .trust__icon svg { width: 18px; height: 18px; }
  .trust__title { font-size: 13px; white-space: nowrap; }
  .trust__text { font-size: 11.5px; white-space: nowrap; }
  .quicklinks .container { padding-block: 10px 0; }
}

/* الهاتف: الباقات والمقالات صفٌّ يُمرَّر بدل عمودٍ طويل */
@media (max-width: 575px) {
  .bundle-list, .posts-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .bundle-list > .bundle { flex: 0 0 88%; scroll-snap-align: start; }
  .posts-row > .post { flex: 0 0 82%; scroll-snap-align: start; }
}

/* «شاهدتَه مؤخّرًا» في صفحات الكتاب: قائمةٌ مدمجة من بطاقاتٍ أفقيّة */
.recent-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recent-list .mini { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); transition: border-color .2s; }
.recent-list .mini + .mini { border-top: 1px solid var(--line); }
.recent-list .mini:hover { border-color: var(--line-strong); }
.mini__cover { position: relative; }
.mini__cover .type-dot { top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-width: 1.5px; }
.mini__cover .type-dot svg { width: 11px; height: 11px; }
.mini .card__author { font-size: 12px; }
@media (max-width: 991px) { .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) {
  .recent-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .recent-list .mini { flex: 0 0 78%; scroll-snap-align: start; }
}

/* صفحة التصنيف: مبدّل العرض الشبكيّ والقائمة */
.view-toggle { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--card); }
.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:hover { color: var(--store-text); }
.view-toggle button.is-active { background: var(--surface-2); color: var(--primary-ink); }
.shop .grid-books.is-list { --cols: 2 !important; }
.grid-books.is-list .card { flex-direction: row; gap: 16px; align-items: stretch; }
.grid-books.is-list .card__media { width: 132px; flex: none; align-self: flex-start; }
.grid-books.is-list .card__body { padding-top: 2px; }
.grid-books.is-list .card__foot { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-books.is-list .card__cart { width: auto; padding-inline: 16px; }
@media (max-width: 575px) {
  .toolbar .select { flex: 1 1 0; width: 0; }
  .view-toggle button { width: 36px; height: 36px; }
  .toolbar .filter-btn { padding-inline: 14px; flex: none; }
}
@media (max-width: 767px) {
  .shop .grid-books.is-list { --cols: 1 !important; }
  .grid-books.is-list .card__media { width: 104px; }
  .grid-books.is-list .card__cart span { display: inline; }
}

/* «اختيار المحرّر» و«كتاب الشهر»: السعر تحت العنوان والتقييم مباشرةً */
.feature__price .price__now { font-size: 20px; }
.spotlight__body > .price .price__now { font-size: 26px; color: var(--store-accent); }

@media (min-width: 576px) and (max-width: 991px) {
  .posts-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .posts-row > :last-child:nth-child(odd) { grid-column: auto; }
  .posts-row .post__body { padding: 12px; }
}

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