/* =====================================================================
   قالب «عافية» — منصّة ناشر
   كحليٌّ وبرتقاليّ على أبيض، شبكة بطاقاتٍ ملتصقة، وأقسامٌ بعناوين في الوسط.
   ألوان الهويّة الخمسة متغيّراتٌ يختارها الناشر؛ وكلّ ما يُشتقّ منها بـ color-mix.
   ===================================================================== */

:root {
  --store-primary: #103178;
  --store-primary-dark: #0b2257;
  --store-accent: #fd8d27;
  --store-bg: #ffffff;
  --store-text: #103178;

  /* محايدات */
  --soft: #f0f2f5;
  --line: #d9dee8;
  --muted: #4f5f82;
  --white: #ffffff;

  /* مشتقّات من ألوان المتجر */
  --price: color-mix(in srgb, var(--store-accent) 62%, #000);
  --hero-bg: color-mix(in srgb, var(--store-primary) 9%, #fff);
  --hero-ring: color-mix(in srgb, var(--store-primary) 14%, transparent);
  --cream: color-mix(in srgb, var(--store-accent) 8%, #fff);
  --cream-ring: color-mix(in srgb, var(--store-accent) 22%, transparent);
  --accent-soft: color-mix(in srgb, var(--store-accent) 14%, #fff);

  /* ثوابت لا يغيّرها الناشر */
  --gold: #f2b01e;
  --new: #0e7a45;
  --hot: #c62828;
  --type-print: #DB7056;
  --type-ebook: #5675A3;
  --type-audio: #986AB0;
  --type-edu: #3f8f6b;

  --font-h: "Readex Pro", "Tajawal", system-ui, sans-serif;
  --font-b: "Tajawal", system-ui, sans-serif;
  --radius: 6px;
  --cols: 5;
  --container: 1300px;
  --header-h: 76px;
}

/* ---------------------------------------------------------- أساس */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.6;
  color: var(--store-text);
  background: var(--store-bg);
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--store-primary-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4 { font-family: var(--font-h); line-height: 1.3; margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--store-accent); outline-offset: 2px; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .container { padding-inline: 24px; } }

.section { margin-block: 56px; }
.section--tight { margin-block: 28px; }

/* ---------------------------------------------------------- الأزرار */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: 15px; line-height: 1; white-space: nowrap;
  border: 1.5px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn--accent { background: var(--store-accent); color: var(--store-primary-dark); }
.btn--accent:hover { background: color-mix(in srgb, var(--store-accent) 85%, #000); color: var(--store-primary-dark); }
.btn--primary { background: var(--store-primary); color: var(--white); }
.btn--primary:hover { background: var(--store-primary-dark); color: var(--white); }
.btn--ghost { background: var(--white); color: var(--store-primary); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--store-primary); color: var(--store-primary); }
.btn--green { background: var(--new); color: var(--white); }
.btn--lg { min-height: 52px; padding: 0 32px; font-size: 16px; }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); }

.hbtn {
  position: relative; display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; color: var(--store-primary);
}
.hbtn .icon { width: 24px; height: 24px; }
.hbtn:hover { background: var(--soft); }
.hbtn--ring { border: 1.5px solid var(--line); width: 52px; height: 52px; }
.hbtn[aria-pressed="true"] { color: var(--hot); }
.hbtn[aria-pressed="true"] .icon { fill: currentColor; }
.hbtn__count {
  position: absolute; top: 0; inset-inline-end: -2px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--store-primary); color: var(--white);
  font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
  border: 2px solid var(--white); box-sizing: content-box;
}

/* ---------------------------------------------------------- شريط الإعلان وشريط الخدمات */
.announce { background: var(--store-primary); color: var(--white); }
.announce__text { padding-block: 7px; text-align: center; font-size: 13.5px; font-weight: 500; }
.announce:has(.announce__text:empty) { display: none; }

.services { background: var(--soft); color: var(--muted); font-size: 13px; }
.services__inner { display: flex; align-items: center; gap: 16px; min-height: 36px; }
.services__ship { flex: 1; min-width: 0; }
.services__ship:not(:has(> :not([hidden]))) { display: none; }
.services__links { display: flex; align-items: center; margin-inline-start: auto; }
.services__links li + li { border-inline-start: 1px solid var(--line); }
.services__links a { display: block; padding: 0 14px; color: var(--muted); }
.services__links a:hover { color: var(--store-primary); }
.socials--mini { display: flex; gap: 2px; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.socials--mini a { display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); }
.socials--mini .icon { width: 16px; height: 16px; }

.shipbar { display: flex; align-items: center; gap: 10px; color: var(--store-text); }
.shipbar > .icon { width: 18px; height: 18px; color: var(--new); }
.shipbar strong { color: var(--store-primary); }
.shipbar__track { position: relative; width: 120px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; flex: none; }
.shipbar__fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--store-accent); }
.shipbar.is-free [data-ship-msg] { color: var(--new); font-weight: 700; }
.shipbar.is-free .shipbar__fill { background: var(--new); }
[data-slot="cart.free_shipping_left"][hidden] { display: none !important; }
@media (min-width: 768px) and (max-width: 1099px) {
  .shipbar__track { display: none; }
  .shipbar [data-ship-msg] { white-space: nowrap; }
  .services__links a { padding: 0 10px; }
}
@media (max-width: 767px) {
  .services__links, .socials--mini { display: none; }
  .services__inner { justify-content: center; }
  .services__ship { flex: 1; }
  .shipbar { justify-content: center; font-size: 12.5px; line-height: 1.4; padding-block: 6px; text-align: center; }
  .shipbar [data-ship-msg] { min-width: 0; }
  .services:not(:has(.services__ship [data-slot="cart.free_shipping_left"]:not([hidden]))) { display: none; }
  .shipbar__track { display: none; }
}

/* ---------------------------------------------------------- الرأس الثابت */
.header {
  position: sticky; top: 0; z-index: 40;
  background: var(--white); border-bottom: 1px solid var(--line);
  transition: box-shadow .2s;
}
.header.is-scrolled { box-shadow: 0 6px 18px rgb(11 34 87 / .08); }
.header__row { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.header__menu { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__logo { width: 44px; height: 44px; object-fit: contain; }
.brand__name { font-family: var(--font-h); font-weight: 700; font-size: 21px; color: var(--store-primary); white-space: nowrap; }
.brand--sm .brand__logo { width: 36px; height: 36px; }
.brand--sm .brand__name { font-size: 18px; }

.search { position: relative; flex: 1; max-width: 560px; margin-inline: auto; display: flex; align-items: center; }
.search__input {
  width: 100%; height: 46px; padding-inline: 22px 54px; border-radius: 999px;
  border: 1px solid transparent; background: var(--soft); color: var(--store-text); outline: 0;
}
.search__input::placeholder { color: var(--muted); }
.search__input:focus { border-color: var(--store-primary); background: var(--white); }
.search__btn { position: absolute; inset-inline-end: 6px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--store-primary); }
.search__btn .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.header__icons { display: flex; align-items: center; gap: 6px; flex: none; }
.header__icons .hbtn { color: var(--store-accent); }
.header__icons .hbtn .icon { stroke: color-mix(in srgb, var(--store-accent) 75%, #000); }
.msearch { display: none; }

/* صفّ القائمة */
.navrow { border-bottom: 1px solid var(--line); background: var(--white); }
.navrow__inner { display: flex; align-items: center; gap: 28px; min-height: 52px; }
.catmenu { position: relative; }
.catmenu__btn { display: inline-flex; align-items: center; gap: 8px; height: 52px; font-weight: 700; color: var(--store-primary); }
.catmenu__btn .chev { width: 16px; height: 16px; transition: transform .2s; }
.catmenu.is-open .chev { transform: rotate(180deg); }
.catmenu__list {
  position: absolute; top: 100%; inset-inline-start: 0; z-index: 45; min-width: 240px;
  padding: 8px 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 30px rgb(11 34 87 / .12);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.catmenu.is-open .catmenu__list { opacity: 1; visibility: visible; transform: none; }
.catmenu__list a { display: block; padding: 9px 20px; font-weight: 500; }
.catmenu__list a:hover { background: var(--soft); color: var(--store-primary); }
.navlinks { display: flex; gap: 26px; }
.navlinks a { display: block; padding-block: 14px; font-weight: 500; border-bottom: 2px solid transparent; }
.navlinks a.is-active, .navlinks a:hover { color: var(--store-primary); border-bottom-color: var(--store-accent); }
.navrow__help { margin-inline-start: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.navrow__help a { color: var(--store-primary); font-weight: 700; }

@media (max-width: 1099px) {
  .navlinks { gap: 18px; }
  .navrow__help { display: none; }
}
@media (max-width: 767px) {
  :root { --header-h: 62px; }
  .header__row { gap: 8px; }
  .header__menu { display: inline-grid; }
  .header .search, .navrow, .hide-sm { display: none; }
  .brand { margin-inline-end: auto; }
  .brand__logo { width: 38px; height: 38px; }
  .brand__name { font-size: 18px; }
  .header__icons { gap: 0; margin-inline-end: -6px; }
  .header__menu { margin-inline-start: -8px; }
  .msearch { display: block; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .search--m { max-width: none; }
  .search--m .search__input { height: 42px; }
}

/* الدرج الجانبيّ */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__overlay { position: absolute; inset: 0; background: rgb(11 34 87 / .45); opacity: 0; transition: opacity .25s; }
.drawer.is-open .drawer__overlay { opacity: 1; }
.drawer__panel {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: min(340px, 86vw);
  background: var(--white); overflow-y: auto; padding: 16px 20px 28px;
  transform: translateX(100%); transition: transform .28s ease;
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer__title { margin: 20px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.drawer__list a { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--soft); font-weight: 500; }
.drawer__list .icon { width: 16px; height: 16px; color: var(--muted); }
.drawer__foot { display: grid; gap: 4px; margin-top: 22px; }
.drawer__foot a { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 500; }
.drawer__foot .icon { color: var(--store-primary); }
body.is-locked { overflow: hidden; }

/* ---------------------------------------------------------- عناوين الأقسام */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; margin-bottom: 26px; text-align: center; position: relative; }
.section-title { font-size: clamp(24px, 2.4vw, 34px); font-weight: 600; color: var(--store-primary); }
.section-title--side { font-size: 24px; text-align: start; }
.section-sub { flex-basis: 100%; color: var(--muted); }
.section-link { position: absolute; inset-inline-end: 0; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--store-primary); }
.section-link .icon { width: 16px; height: 16px; }
@media (max-width: 767px) {
  .section-head { justify-content: space-between; text-align: start; margin-bottom: 18px; }
  .section-link { position: static; }
  .section { margin-block: 40px; }
}

/* ---------------------------------------------------------- السلايدر */
.hero { position: relative; background: var(--hero-bg); overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--hero-ring); pointer-events: none;
}
.hero::before { width: 760px; height: 760px; inset-inline-end: 6%; top: -120px; }
.hero::after { width: 1100px; height: 1100px; inset-inline-end: -8%; top: -290px; }
.slider { position: relative; max-width: var(--container); margin-inline: auto; }
.slide { display: none; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 48px 72px 56px; min-height: 480px; }
.slide.is-active { display: grid; animation: slide-in .5s ease; }
@keyframes slide-in { from { opacity: 0; } to { opacity: 1; } }
.slide__title { font-size: clamp(34px, 4.4vw, 60px); font-weight: 700; line-height: 1.15; color: var(--store-primary); }
.slide__text { margin: 16px 0 28px; font-size: 19px; color: var(--store-text); max-width: 30em; }
.slide__media img { width: 100%; max-height: 420px; object-fit: contain; }
.slider__arrow {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(255 255 255 / .75); color: var(--store-primary); box-shadow: 0 4px 14px rgb(11 34 87 / .1);
}
.slider__arrow:hover { background: var(--white); }
.slider__arrow--prev { inset-inline-start: 16px; }
.slider__arrow--next { inset-inline-end: 16px; }
.slider__dots { position: absolute; bottom: 18px; inset-inline: 0; display: flex; justify-content: center; gap: 8px; }
.slider__dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--store-primary); opacity: .5; }
.slider__dot.is-active { background: var(--store-primary); opacity: 1; }
@media (max-width: 899px) {
  .slide { grid-template-columns: 1fr; text-align: center; padding: 32px 20px 52px; min-height: 0; gap: 12px; }
  .slide__text { margin-inline: auto; font-size: 16px; margin-block: 10px 20px; }
  .slide__media { order: 2; }
  .slide__media img { max-height: 260px; margin-inline: auto; }
}
@media (max-width: 599px) {
  .slide { padding: 24px 16px 44px; }
  .slide__media img { max-height: 210px; }
  .slider__arrow { display: none; }
  .hero::before { width: 420px; height: 420px; inset-inline-end: -120px; top: auto; bottom: -140px; }
  .hero::after { width: 640px; height: 640px; inset-inline-end: -260px; top: auto; bottom: -260px; }
}

/* ---------------------------------------------------------- البانرات */
.promos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promos--two { grid-template-columns: repeat(2, 1fr); }
.promo { position: relative; display: block; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 3; isolation: isolate; color: var(--store-primary); }
.promo--wide { aspect-ratio: 840 / 380; }
.promo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .5s; }
.promo:hover > img { transform: scale(1.04); }
.promo__body { position: absolute; inset-block: 0; inset-inline-start: 0; width: 56%; padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; }
.promo__title { font-family: var(--font-h); font-size: clamp(20px, 2vw, 26px); font-weight: 600; line-height: 1.25; }
.promo__text { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.promo--light, .promo--light:hover { color: var(--store-primary-dark); }
.promo--dark, .promo--dark:hover { color: var(--white); }
.promo--dark .btn { background: var(--white); color: var(--store-primary-dark); }
@media (max-width: 899px) {
  .promos { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .promos > * { scroll-snap-align: start; }
  .promos::-webkit-scrollbar { display: none; }
  .promos--two { grid-auto-columns: 78%; }
  .promo__body { width: 60%; padding: 18px; gap: 6px; }
  .promo__text { font-size: 14px; margin-bottom: 4px; }
}
@media (max-width: 599px) {
  .promos { grid-auto-columns: 86%; gap: 10px; }
  .promos--two { grid-auto-columns: 86%; }
  .promo, .promo--wide { aspect-ratio: 16 / 8; }
}

/* بانر رفيع عريض */
.strip { position: relative; display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 16px 28px; border-radius: var(--radius); overflow: hidden; isolation: isolate; color: var(--store-primary-dark); }
.strip > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; z-index: -1; }
.strip__body { flex: 1; font-size: 18px; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.strip__body > .icon { width: 26px; height: 26px; color: var(--new); }
.strip__title { font-family: var(--font-h); font-weight: 700; color: var(--new); }
.strip__btn { flex: none; }
@media (max-width: 899px) { .strip > img { object-position: 100% 50%; opacity: .3; } }
@media (max-width: 767px) {
  .strip { flex-direction: column; align-items: flex-start; padding: 18px; }
  .strip__body { font-size: 16px; }
}

/* ---------------------------------------------------------- التصنيفات */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 18px 0; border-radius: var(--radius); background: var(--soft); overflow: hidden; min-height: 230px; transition: background .2s; }
.cat:hover { background: color-mix(in srgb, var(--store-primary) 8%, var(--soft)); }
.cat__name { font-family: var(--font-h); font-weight: 600; font-size: 18px; color: var(--store-primary); }
.cat__count { font-size: 13px; color: var(--muted); }
.cat__more { margin-top: 6px; padding: 3px 14px; border-radius: 999px; background: var(--white); font-size: 13px; font-weight: 700; color: var(--store-primary); }
.cat img { margin-top: auto; align-self: center; width: 100%; max-width: 220px; aspect-ratio: 4 / 3; object-fit: contain; }
.cat--sm { min-height: 0; padding: 14px 14px 0; }
.cat--sm .cat__name { font-size: 15px; }
.cat--sm img { max-width: 150px; }
.cats--strip { grid-template-columns: repeat(6, 1fr); }
.cats--kit { grid-template-columns: repeat(3, minmax(0, 220px)); }
@media (max-width: 1099px) { .cats { grid-template-columns: repeat(3, 1fr); } .cat { min-height: 200px; } .cat img { max-width: 170px; } }
@media (max-width: 767px) {
  .cats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 40%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cats > * { scroll-snap-align: start; }
  .cat { min-height: 176px; padding: 14px 14px 0; }
  .cat img { max-width: 150px; }
  .cat__name { font-size: 16px; }
  .cats--strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cats--strip .cat { flex: 0 0 42%; scroll-snap-align: start; }
}

/* فهرس التصنيفات بفروعها */
.catidx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.catidx__col { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 6px 16px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--line); }
.catidx__name { font-size: 17px; font-weight: 600; color: var(--store-primary); }
.catidx__kids { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; }
.catidx__kids a { color: var(--store-text); }
.catidx__kids a:hover { color: var(--price); }
@media (max-width: 1099px) { .catidx { grid-template-columns: repeat(2, minmax(0, 1fr)); } .catidx__col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .catidx { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .catidx__col { scroll-snap-align: start; padding: 14px 16px; }
  .catidx__name { font-size: 16px; }
  .catidx__kids { font-size: 14px; }
}

/* ---------------------------------------------------------- شبكة الكتب: خلايا ملتصقة */
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 1px; padding: 1px; }
[data-books-per-row="4"] { --cols: 4; }
[data-books-per-row="5"] { --cols: 5; }
[data-books-per-row="6"] { --cols: 6; }
.grid--4 { --cols: 4; }
.grid--list { --cols: 4; }
@media (min-width: 1280px) { [data-books-per-row="6"] .grid--list { --cols: 6; } }
@media (max-width: 1099px) { .grid, .grid--4, .grid--list { --cols: 3; } [data-books-per-row="6"] .grid--list { --cols: 3; } }
@media (max-width: 767px) { .grid, .grid--4, .grid--list { --cols: 2; } [data-books-per-row="6"] .grid--list { --cols: 2; } }
/* صفوفٌ كاملة: «مختارات المتجر» 12 كتابًا تملأ 3 و4 و6، وتُقصّ إلى 10 مع 5، وإلى 6 في الهاتف؛ و«وصل حديثًا» 8 تُقصّ إلى 6 بثلاثة أعمدة */
@media (min-width: 1100px) { [data-books-per-row="5"] .grid--featured > :nth-child(n+11) { display: none; } }
@media (max-width: 767px) { .grid--featured > :nth-child(n+7) { display: none; } }
@media (min-width: 768px) and (max-width: 1099px) { .grid--4 > :nth-child(n+7) { display: none; } }

.card { position: relative; display: flex; flex-direction: column; background: var(--white); outline: 1px solid var(--line); padding: 14px 14px 16px; min-width: 0; }
.card__media { position: relative; }
.card__cover { display: block; padding: 6px 14px 4px; }
.card__cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 8px 18px rgb(11 34 87 / .14); transition: transform .3s; }
.card:hover .card__cover img { transform: translateY(-3px); }
.card__badges { position: absolute; top: 0; inset-inline-start: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.6; }
.badge--sale { background: var(--store-accent); color: var(--store-primary-dark); }
.badge--new { background: var(--new); color: var(--white); }
.badge--out { background: #e3e7ee; color: #3f4d6b; }
.badge--circle, .card--deal .badge--sale {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%;
  background: var(--store-primary); color: var(--white); font-size: 13px;
}
.type-dot {
  position: absolute; bottom: 10px; inset-inline-end: 6px; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--white); border: 2px solid var(--white); box-shadow: 0 2px 6px rgb(0 0 0 / .18);
}
.type-dot .icon { width: 16px; height: 16px; stroke-width: 2; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-edu); }
.kit .type-dot, .citem .type-dot { position: static; }
.card__tools { position: absolute; top: 0; inset-inline-end: 0; z-index: 2; display: grid; gap: 6px; opacity: 0; transform: translateX(-6px); transition: .2s; }
.card:hover .card__tools, .card:focus-within .card__tools { opacity: 1; transform: none; }
@media (hover: none) { .card__tools { opacity: 1; transform: none; } }
.tool { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--white); color: var(--store-primary); box-shadow: 0 3px 10px rgb(11 34 87 / .14); }
.tool .icon { width: 18px; height: 18px; }
.tool:hover { background: var(--store-primary); color: var(--white); }
.tool[aria-pressed="true"] { color: var(--hot); }
.tool[aria-pressed="true"] .icon { fill: currentColor; }

.card__body { display: flex; flex-direction: column; flex: 1; gap: 4px; margin-top: 12px; }
.card__title { font-family: var(--font-b); font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--store-primary); }
.card__title a:hover { color: var(--price); }
.card__author { font-size: 13px; color: var(--muted); }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; }
.price__now { font-weight: 700; font-size: 17px; color: var(--store-primary); }
.price__old { font-size: 13.5px; color: var(--muted); }
.price:has(.price__old) .price__now { color: var(--price); }
.rating { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: #d3d8e2; }
.stars .icon { width: 14px; height: 14px; }
.stars .is-on { color: var(--gold); }
.stars--sm .icon { width: 13px; height: 13px; }
.card__buy { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; }
.card__add { flex: 1; padding-inline: 12px; }
.card__add .icon { width: 17px; height: 17px; }
.card.is-out .card__cover img { opacity: .55; filter: grayscale(.4); }

/* الكمّيّة */
.qty { display: inline-flex; align-items: center; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); flex: none; }
.qty button { width: 38px; height: 100%; display: grid; place-items: center; color: var(--store-primary); }
.qty button .icon { width: 16px; height: 16px; }
.qty input { width: 38px; border: 0; text-align: center; font-weight: 700; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty--sm { height: 36px; }
.qty--sm button { width: 28px; }
.qty--sm input { width: 26px; font-size: 14px; }

/* بطاقات منفصلة (خيار card_style) */
[data-card-style="boxed"] .grid { gap: 18px; padding: 0; }
[data-card-style="boxed"] .card { outline: 0; border: 1px solid var(--line); border-radius: 10px; transition: box-shadow .2s, border-color .2s; }
[data-card-style="boxed"] .card:hover { border-color: transparent; box-shadow: 0 12px 28px rgb(11 34 87 / .12); }
@media (max-width: 767px) { [data-card-style="boxed"] .grid { gap: 10px; } }

@media (max-width: 767px) {
  .card { padding: 10px 10px 12px; }
  .card__cover { padding: 4px 8px; }
  .card__title { font-size: 14px; }
  .price__now { font-size: 15px; }
  .card .price { flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
  .card .price__old { font-size: 12px; }
  .card__add span { font-size: 13px; }
  .tool { width: 32px; height: 32px; }
}

/* ---------------------------------------------------------- الدوّار الأفقيّ */
.scroller { position: relative; }
.scroller__track.grid--row {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--cols) - 1) * 1px - 2px) / var(--cols));
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.scroller__track::-webkit-scrollbar { display: none; }
.scroller__track > * { scroll-snap-align: start; }
[data-card-style="boxed"] .scroller__track.grid--row { grid-auto-columns: calc((100% - (var(--cols) - 1) * 18px) / var(--cols)); padding-block: 4px 14px; }
.scroller__arrow {
  position: absolute; top: 42%; z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft); color: var(--store-primary); box-shadow: 0 0 0 4px var(--white);
}
.scroller__arrow:hover { background: var(--store-primary); color: var(--white); }
.scroller__arrow:disabled { opacity: 0; pointer-events: none; }
.scroller__arrow--prev { inset-inline-start: -21px; }
.scroller__arrow--next { inset-inline-end: -21px; }
@media (max-width: 1099px) { .scroller__arrow { display: none; } }
@media (max-width: 767px) {
  .scroller__track.grid--row { grid-auto-columns: 46%; }
  [data-card-style="boxed"] .scroller__track.grid--row { grid-auto-columns: 46%; gap: 10px; }
}

/* ---------------------------------------------------------- عرض اليوم بجانب «وصل حديثًا» */
.duo { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.duo:not(:has(.duo__deal:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
.duo__deal .section-title { margin-bottom: 18px; text-align: center; }
.duo__main .section-head { justify-content: center; }
.deal { border: 2px solid var(--store-accent); border-radius: var(--radius); padding: 16px; background: var(--white); }
.deal .card { outline: 0; padding: 0; }
.deal .card__cover { padding: 18px 20px 6px; }
.card--big .card__title { font-size: 17px; }
.card--big .price__now { font-size: 20px; }
@media (max-width: 1099px) { .duo { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 899px) {
  .duo { grid-template-columns: minmax(0, 1fr); }
  .duo__deal .section-title { text-align: start; margin-bottom: 14px; }
  .deal { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 22px; align-items: center; padding: 14px 18px; }
  .deal .countdown--deal { grid-column: 2; grid-row: 1; justify-content: flex-start; width: auto; margin: 0; }
  .deal > [data-slot="section.items"] { display: contents; }
  .deal .card--deal { display: contents; }
  .deal .card__media { grid-column: 1; grid-row: 1 / span 2; width: 200px; }
  .deal .card__cover { padding: 0; }
  .deal .card__body { grid-column: 2; grid-row: 2; margin-top: 4px; align-self: start; }
  .deal .card__buy { justify-content: flex-start; }
  .deal .card__add { flex: 0 1 260px; }
  .duo__main .section-head { justify-content: space-between; }
}

/* العدّاد */
.countdown { display: inline-flex; align-items: flex-start; gap: 4px; direction: ltr; }
.countdown__unit { display: grid; justify-items: center; gap: 2px; }
.countdown__unit b {
  min-width: 40px; height: 40px; padding: 0 6px; border-radius: 4px; display: grid; place-items: center;
  background: var(--store-accent); color: var(--store-primary-dark); font-family: var(--font-h); font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.countdown__unit small { font-size: 11.5px; color: var(--muted); }
.countdown > i { font-style: normal; font-weight: 700; font-size: 20px; line-height: 40px; color: var(--store-primary); }
.countdown--deal { display: flex; justify-content: center; width: 100%; margin-bottom: 6px; direction: rtl; }
.countdown--deal .countdown__unit b { min-width: 46px; height: 46px; font-size: 22px; }
.countdown--deal > i { line-height: 46px; }
.section-head--timer { gap: 12px 24px; }

/* عروض الأسبوع: إطار برتقاليّ */
.deals { border: 2px solid var(--store-accent); border-radius: var(--radius); padding: 10px; }
.deals .scroller__track.grid--row { padding: 0; }
.deals .card { outline-color: transparent; border-inline-end: 1px solid var(--line); }
[data-card-style="boxed"] .deals .card { border: 1px solid var(--line); }

/* التبويبات */
.section-head--tabs { flex-direction: column; gap: 14px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; }
.tab { padding: 4px 2px; font-size: 18px; font-weight: 500; color: var(--store-text); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--store-primary); }
.tab[aria-selected="true"] { font-weight: 700; color: var(--store-primary); border-bottom-color: var(--store-primary); }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }
@media (max-width: 767px) {
  .section-head--tabs { align-items: stretch; }
  .tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 20px; }
  .tab { font-size: 16px; white-space: nowrap; }
}

/* ---------------------------------------------------------- عن المتجر */
.about { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 48px 56px 0; border-radius: var(--radius); background: var(--soft); overflow: hidden; isolation: isolate; }
.about::before { content: ""; position: absolute; width: 640px; height: 640px; inset-inline-end: -120px; top: -160px; border-radius: 50%; border: 1px solid var(--hero-ring); z-index: -1; }
.about__body { display: grid; justify-items: start; gap: 14px; padding-bottom: 48px; }
.about__title { font-size: clamp(28px, 3vw, 42px); font-weight: 700; color: var(--store-primary); line-height: 1.2; }
.about__text { font-size: 17px; max-width: 34em; }
.about__line { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--store-primary); }
.about__line .icon { color: var(--new); }
.about__media { align-self: end; }
.about__media img { width: 100%; max-height: 420px; object-fit: contain; object-position: bottom; }
@media (max-width: 899px) {
  .about { grid-template-columns: 1fr; padding: 28px 20px 0; }
  .about__body { padding-bottom: 0; }
  .about__media img { max-height: 260px; margin-inline: auto; }
}

/* ---------------------------------------------------------- آراء القرّاء */
.reviews { position: relative; background: var(--cream); padding-block: 56px 64px; overflow: hidden; isolation: isolate; }
.reviews::before, .reviews::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--cream-ring); z-index: -1; }
.reviews::before { width: 900px; height: 900px; inset-inline-start: -260px; top: -420px; }
.reviews::after { width: 700px; height: 700px; inset-inline-end: -200px; bottom: -420px; }
.section-head--reviews { gap: 10px 22px; }
.section-title__q { width: 40px; height: 40px; color: var(--store-accent); stroke-width: 3; margin-inline-end: 8px; vertical-align: -8px; }
.store-rating { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--white); font-size: 14px; color: var(--muted); }
.store-rating__score { font-family: var(--font-h); font-weight: 700; font-size: 18px; color: var(--store-primary); }
.reviews__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px; }
.reviews__track > * { scroll-snap-align: start; }
.review { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 20px; border-radius: var(--radius); background: var(--white); box-shadow: 0 6px 18px rgb(11 34 87 / .06); }
.review__q { width: 26px; height: 26px; color: var(--store-accent); stroke-width: 2.6; }
.review__text { font-size: 16px; line-height: 1.7; flex: 1; }
.review__name { font-family: var(--font-h); font-weight: 600; color: var(--store-primary); }
.review__book { font-size: 13.5px; color: var(--muted); margin-top: -6px; }
.review__book a { color: var(--store-primary); font-weight: 700; }
.reviews__track--kit { grid-auto-columns: minmax(0, 340px); }
@media (max-width: 1099px) { .reviews__track { grid-auto-columns: calc((100% - 20px) / 2); } }
@media (max-width: 767px) { .reviews__track { grid-auto-columns: 84%; gap: 12px; } .reviews { padding-block: 40px 44px; } }
[data-show-reviews="false"] .reviews, [data-show-reviews="false"] .ptab--reviews, [data-show-reviews="false"] .pdp-reviews { display: none !important; }

/* ---------------------------------------------------------- المدوّنة */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card__media { display: block; border-radius: var(--radius); overflow: hidden; }
.post-card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { display: grid; gap: 6px; padding-top: 14px; }
.post-card__date { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.post-card__title { font-size: 19px; font-weight: 500; line-height: 1.4; color: var(--store-primary); }
.post-card__title a:hover { color: var(--price); }
.post-card__excerpt { color: var(--muted); font-size: 14.5px; }
.posts--blog { row-gap: 40px; }
@media (max-width: 899px) { .posts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) {
  .posts { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; }
  .posts > * { scroll-snap-align: start; }
  .posts--blog { grid-auto-flow: row; grid-template-columns: 1fr; overflow: visible; }
}

/* ---------------------------------------------------------- المؤلّفون */
.authors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.author { display: grid; gap: 4px; text-align: center; }
.author img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); filter: saturate(.9); transition: filter .3s, transform .3s; }
.author:hover img { filter: saturate(1.1); transform: translateY(-3px); }
.author__name { margin-top: 8px; font-family: var(--font-h); font-weight: 600; color: var(--store-primary); font-size: 15px; }
.author__count { font-size: 13px; color: var(--muted); }
@media (max-width: 1099px) { .authors { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px) {
  .authors { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 40%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; }
  .authors > * { scroll-snap-align: start; }
}

/* ---------------------------------------------------------- النشرة وشريط الثقة */
.newsletter { position: relative; padding-block: 64px; overflow: hidden; text-align: center; isolation: isolate; }
.newsletter__title { font-size: clamp(24px, 3vw, 36px); font-weight: 600; color: var(--store-primary); line-height: 1.35; }
.newsletter__offer { display: block; }
.newsletter__field { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.newsletter__field input { width: min(360px, 100%); height: 48px; padding-inline: 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); outline: 0; }
.newsletter__field input:focus { border-color: var(--store-primary); background: var(--white); }
.newsletter__field .btn { min-height: 48px; padding-inline: 34px; }
.nl-env { position: absolute; z-index: -1; fill: none; stroke: #c9d0dc; stroke-width: 1.6; }
.nl-env--1 { width: 110px; inset-inline-start: 8%; top: 34%; rotate: -14deg; }
.nl-env--2 { width: 54px; inset-inline-start: 16%; top: 18%; rotate: 12deg; }
.nl-env--3 { width: 120px; inset-inline-end: 7%; top: 40%; rotate: 10deg; }
.nl-env--4 { width: 50px; inset-inline-end: 16%; top: 20%; rotate: -18deg; }
@media (max-width: 767px) {
  .newsletter { padding-block: 44px; }
  .newsletter__field { flex-direction: column; align-items: stretch; }
  .newsletter__field input { width: 100%; }
  .nl-env--2, .nl-env--4 { display: none; }
  .nl-env--1, .nl-env--3 { width: 70px; top: 6%; opacity: .7; }
}

.trust { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--soft); border-radius: var(--radius); margin-bottom: 40px; }
.trust li { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; font-size: 15px; }
.trust li + li { border-inline-start: 1px solid var(--line); }
.trust .icon { color: var(--store-primary); width: 22px; height: 22px; }
.trust strong { font-weight: 700; }
[data-show-trust-bar="false"] .trust { display: none; }
@media (max-width: 767px) {
  .trust { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-bottom: 28px; }
  .trust li { justify-content: flex-start; padding: 10px 14px; font-size: 14px; scroll-snap-align: start; }
  .trust .icon { width: 19px; height: 19px; }
}

/* ---------------------------------------------------------- التذييل */
.footer { border-top: 1px solid var(--line); }
.footer__main { display: grid; grid-template-columns: 1.3fr 1.6fr 1fr 1fr 1fr; gap: 32px; padding-block: 44px 36px; }
.footer__brand { display: grid; gap: 14px; align-content: start; padding-inline-end: 24px; border-inline-end: 1px solid var(--line); }
.footer__about, .footer__address { color: var(--muted); font-size: 14.5px; }
.footer__address { display: flex; gap: 6px; }
.footer__address .icon { color: var(--store-primary); margin-top: 3px; }
.socials { display: flex; gap: 8px; }
.socials a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--store-primary); }
.socials a:hover { background: var(--store-primary); color: var(--white); }
.socials .icon { width: 18px; height: 18px; }
.footer__title { font-size: 17px; font-weight: 600; color: var(--store-primary); margin-bottom: 14px; }
.footer__help { display: grid; gap: 10px; align-content: start; }
.footer__help .footer__title { margin-bottom: 4px; }
.footer__phone { display: flex; align-items: center; gap: 10px; font-family: var(--font-h); font-weight: 700; font-size: 24px; color: var(--store-primary); }
.footer__phone .icon { color: color-mix(in srgb, var(--store-accent) 75%, #000); width: 26px; height: 26px; }
.footer__hours { color: var(--muted); font-size: 14px; padding-inline-start: 36px; }
.footer__mail { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; }
.footer__col a { display: block; padding-block: 5px; color: var(--muted); font-size: 14.5px; }
.footer__col a:hover { color: var(--store-primary); }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px 26px; border-top: 1px solid var(--line); font-size: 14px; }
.paychips { display: flex; flex-wrap: wrap; gap: 8px; }
.paychips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 500; }
.paychips .icon { width: 16px; height: 16px; }
@media (max-width: 1099px) {
  .footer__main { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; border: 0; padding: 0; }
  .footer__help { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .footer__main { grid-template-columns: 1fr 1fr; gap: 26px 16px; }
  .footer__col:last-child { grid-column: 1 / -1; }
  .footer__phone { font-size: 21px; }
  .footer__bottom { justify-content: center; text-align: center; }
}

/* ---------------------------------------------------------- رؤوس الصفحات الداخليّة */
.pagehead { position: relative; background: var(--hero-bg); padding-block: 26px 30px; overflow: hidden; isolation: isolate; }
.pagehead::after { content: ""; position: absolute; width: 520px; height: 520px; inset-inline-end: -120px; top: -300px; border-radius: 50%; border: 1px solid var(--hero-ring); z-index: -1; }
.pagehead__title { font-size: clamp(26px, 3vw, 38px); font-weight: 700; color: var(--store-primary); margin-top: 10px; }
.pagehead__sub { margin-top: 4px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 4px; color: #a4afc4; }
.crumbs a:hover { color: var(--store-primary); }
.crumbs [aria-current] { color: var(--store-text); font-weight: 500; }

/* ---------------------------------------------------------- صفحة التصنيف */
.listing { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }
.filters { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.filters__head { display: none; }
.fbox { background: var(--soft); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; }
.fbox__title { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: var(--store-primary); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary); margin: 0; }
.check small { margin-inline-start: auto; color: var(--muted); }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-range label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.price-range input { width: 100%; height: 38px; padding-inline: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.toolbar__count { color: var(--muted); font-size: 14px; }
.toolbar__sort { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.toolbar__sort select { height: 40px; padding-inline: 14px 30px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--store-text); }
.toolbar__filter { display: none; }
.toolbar .section-title--side { margin-inline-end: 6px; }
.filters-overlay { display: none; }
@media (max-width: 899px) {
  .listing { grid-template-columns: minmax(0, 1fr); }
  .toolbar__filter { display: inline-flex; }
  .filters {
    position: fixed; inset-block: 0; inset-inline-start: 0; top: 0; z-index: 85; width: min(340px, 88vw);
    background: var(--white); overflow-y: auto; padding: 18px; align-content: start;
    transform: translateX(100%); transition: transform .28s; visibility: hidden;
  }
  .filters.is-open { transform: none; visibility: visible; }
  .filters__head { display: flex; align-items: center; justify-content: space-between; }
  .filters__head h2 { font-size: 18px; }
  .filters-overlay { position: fixed; inset: 0; z-index: 84; background: rgb(11 34 87 / .45); }
  .filters-overlay.is-open { display: block; }
}

/* ترقيم الصفحات */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 34px; }
.pager__num, .pager__btn { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 50%; font-weight: 700; color: var(--store-primary); background: var(--soft); }
.pager__num:hover, .pager__btn:hover { background: color-mix(in srgb, var(--store-primary) 12%, var(--soft)); }
.pager__num.is-current { background: var(--store-primary); color: var(--white); }
.pager__btn .icon { width: 18px; height: 18px; }
.pager__gap { color: var(--muted); }

/* ---------------------------------------------------------- صفحة الكتاب */
.pdp { margin-top: 22px; }
main > .container > .crumbs { margin-top: 20px; }
.pdp { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; margin-bottom: 20px; }
.pdp__gallery { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.pdp__frame { position: relative; display: grid; place-items: center; padding: 44px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.pdp__frame .card__badges { top: 14px; inset-inline-start: 14px; }
.pdp__frame .type-dot { width: 40px; height: 40px; bottom: 16px; inset-inline-end: 16px; }
.pdp__frame .type-dot .icon { width: 20px; height: 20px; }
.pdp__img { width: min(340px, 100%); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 18px 40px rgb(11 34 87 / .2); }
.pdp__thumbs { display: flex; gap: 10px; }
.thumb { width: 76px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.thumb img { aspect-ratio: 2 / 3; object-fit: cover; }
.thumb.is-active { border-color: var(--store-primary); box-shadow: 0 0 0 1px var(--store-primary); }
.pdp__info { display: grid; gap: 14px; }
.pdp__kind { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 700; color: var(--store-primary); }
.pdp__kind .icon { width: 16px; height: 16px; }
.pdp__title { font-size: clamp(28px, 3vw, 40px); font-weight: 700; color: var(--store-primary); }
.pdp__author { color: var(--muted); margin-top: -6px; }
.pdp__author a { color: var(--store-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pdp__rating { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pdp__rating a { color: var(--muted); }
.pdp__rating .stars .icon { width: 17px; height: 17px; }
.price--lg .price__now { font-size: 30px; font-family: var(--font-h); }
.price--lg .price__old { font-size: 18px; }
.pdp__desc { color: var(--store-text); line-height: 1.8; display: grid; gap: 10px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.facts li { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--soft); }
.facts .icon { color: var(--store-primary); width: 22px; height: 22px; margin-bottom: 4px; }
.fact__label { font-size: 12.5px; color: var(--muted); }
.facts strong { font-size: 14.5px; }
.pdp__buy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdp__add { flex: 1; min-width: 200px; }
.pdp__perks { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.pdp__perks li { display: flex; align-items: center; gap: 8px; }
.pdp__perks .icon { color: var(--new); }
.sample { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--soft); }
.sample__play { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--store-primary); color: var(--white); flex: none; }
.sample__play .icon { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.sample__i-pause, .sample__play[aria-pressed="true"] .sample__i-play { display: none; }
.sample__play[aria-pressed="true"] .sample__i-pause { display: block; }
.sample__body { display: grid; gap: 6px; flex: 1; }
.sample__body small { color: var(--muted); }
.sample__bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.sample__bar span { display: block; height: 100%; background: var(--store-accent); }
@media (max-width: 899px) {
  .pdp { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .pdp__gallery { position: static; }
  .pdp__frame { padding: 28px 20px; }
  .pdp__img { width: min(240px, 70%); }
}
@media (max-width: 599px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:last-child { grid-column: 1 / -1; }
  .pdp__add { min-width: 0; }
}

/* تبويبات صفحة الكتاب */
.ptabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.ptab { padding: 12px 2px; font-family: var(--font-h); font-size: 18px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptab[aria-selected="true"] { color: var(--store-primary); border-bottom-color: var(--store-primary); font-weight: 600; }
.spec { width: 100%; max-width: 760px; border-collapse: collapse; }
.spec th, .spec td { padding: 12px 16px; border: 1px solid var(--line); text-align: start; font-size: 15px; }
.spec th { width: 34%; background: var(--soft); font-weight: 700; color: var(--store-primary); }
.pdp-reviews__grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.pdp-reviews__sum { display: grid; justify-items: center; gap: 6px; padding: 24px; border-radius: var(--radius); background: var(--soft); text-align: center; color: var(--muted); }
.pdp-reviews__score { font-family: var(--font-h); font-size: 44px; font-weight: 700; color: var(--store-primary); line-height: 1; }
.pdp-reviews__sum .btn { margin-top: 8px; }
.pdp-reviews__list { display: grid; gap: 14px; }
.prev { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; }
.prev__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.prev__head strong { color: var(--store-primary); }
.prev__head time { margin-inline-start: auto; font-size: 13px; color: var(--muted); }
.review-form { margin-top: 20px; padding: 20px; border-radius: var(--radius); background: var(--soft); display: grid; gap: 12px; max-width: 640px; }
.review-form h3 { font-size: 18px; }
.review-form__stars { display: flex; gap: 4px; color: #c3cad8; }
.review-form__stars .icon { width: 24px; height: 24px; }
.review-form textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); resize: vertical; }
.review-form .btn { justify-self: start; }
@media (max-width: 767px) { .pdp-reviews__grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- صفحة المؤلّف */
.authorhead { position: relative; background: var(--hero-bg); padding-block: 26px 44px; overflow: hidden; isolation: isolate; }
.authorhead::before, .authorhead::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--hero-ring); z-index: -1; }
.authorhead::before { width: 700px; height: 700px; inset-inline-end: -160px; top: -200px; }
.authorhead::after { width: 1000px; height: 1000px; inset-inline-end: -340px; top: -360px; }
.authorhead__row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: center; margin-top: 22px; }
.authorhead__photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 6px solid var(--white); box-shadow: 0 14px 34px rgb(11 34 87 / .16); }
.authorhead__name { font-size: clamp(28px, 3.4vw, 44px); font-weight: 700; color: var(--store-primary); }
.authorhead__count { display: inline-block; margin-top: 8px; padding: 3px 14px; border-radius: 999px; background: var(--white); font-weight: 700; font-size: 14px; }
.authorhead__bio { margin-top: 14px; font-size: 16.5px; line-height: 1.85; max-width: 46em; }
@media (max-width: 767px) {
  .authorhead__row { grid-template-columns: 1fr; gap: 18px; text-align: center; justify-items: center; }
  .authorhead__photo { width: 180px; }
}

/* ---------------------------------------------------------- السلّة */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.ctable { width: 100%; border-collapse: collapse; }
.ctable th { padding: 12px; font-size: 14px; font-weight: 700; color: var(--muted); text-align: start; border-bottom: 1px solid var(--line); background: var(--soft); }
.ctable td { padding: 16px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.citem__book { display: flex; align-items: center; gap: 14px; }
.citem__cover { position: relative; width: 70px; flex: none; }
.citem__cover img { aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 4px 10px rgb(11 34 87 / .14); }
.citem__cover .type-dot { position: absolute; bottom: -6px; inset-inline-end: -8px; width: 26px; height: 26px; }
.citem__cover .type-dot .icon { width: 13px; height: 13px; }
.citem__title { font-weight: 700; color: var(--store-primary); }
.citem__author { font-size: 13.5px; color: var(--muted); }
.citem__price .price { margin: 0; }
.citem__total strong { font-size: 16px; }
.citem__rm .hbtn { color: var(--muted); }
.citem__rm .hbtn:hover { color: var(--hot); }
.cart__actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; }
.cart-empty { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; border-radius: var(--radius); background: var(--soft); }
.cart-empty__i { width: 48px; height: 48px; color: var(--store-primary); }
.summary { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; padding: 24px; border-radius: var(--radius); background: var(--soft); }
.summary__title { font-size: 20px; }
.coupon { display: flex; gap: 8px; }
.coupon input { flex: 1; min-width: 0; height: 40px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); }
.coupon__applied { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--new); }
.coupon__applied button { margin-inline-start: auto; color: var(--store-primary); text-decoration: underline; font-size: 13px; }
.summary__rows { margin: 0; display: grid; gap: 10px; }
.summary__rows div { display: flex; justify-content: space-between; }
.summary__rows dt { color: var(--muted); }
.summary__rows dd { margin: 0; font-weight: 700; }
.summary__rows .is-discount { color: var(--new); }
.summary__total { padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; }
.summary__total dt { color: var(--store-primary); font-weight: 700; }
.summary__note { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.summary__note .icon { color: var(--new); flex: none; }
@media (max-width: 1099px) { .cart { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 899px) {
  .cart { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .ctable thead { display: none; }
  .ctable, .ctable tbody { display: block; }
  .ctable tr { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); position: relative; }
  .ctable td { padding: 0; border: 0; }
  .citem__book { grid-column: 1 / -1; padding-inline-end: 44px !important; }
  .citem__price, .citem__total { display: flex; align-items: center; gap: 8px; }
  .citem__price::before, .citem__total::before { content: attr(data-label) ":"; font-size: 13px; color: var(--muted); }
  .citem__qty { grid-row: 2 / span 2; grid-column: 2; align-self: center; }
  .citem__rm { position: absolute; top: 12px; inset-inline-end: 0; }
}

/* ---------------------------------------------------------- 404 */
.nf { display: grid; justify-items: center; gap: 14px; text-align: center; margin-top: 48px; }
.nf__code { display: flex; align-items: center; gap: 10px; font-family: var(--font-h); font-weight: 700; font-size: clamp(90px, 16vw, 170px); line-height: 1; color: var(--store-primary); }
.nf__zero { display: grid; place-items: center; width: 1em; height: 1em; border-radius: 50%; background: var(--store-accent); color: var(--store-primary-dark); font-size: .62em; }
.nf__title { font-size: clamp(24px, 3vw, 34px); color: var(--store-primary); }
.nf__text { color: var(--muted); max-width: 32em; }
.search--nf { width: min(520px, 100%); flex: none; margin-block: 6px; }

/* ---------------------------------------------------------- المقال */
.article { max-width: 880px; margin-top: 24px; }
.article__head { display: grid; gap: 8px; margin-block: 18px; }
.article__title { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; color: var(--store-primary); }
.article__img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.article__body { max-width: 720px; margin: 28px auto 0; font-size: 17.5px; line-height: 1.95; }
.article__body p + p, .article__body h2 + p, .article__body p + h2, .article__body blockquote + p, .article__body p + blockquote { margin-top: 16px; }
.article__body h2 { font-size: 24px; color: var(--store-primary); margin-top: 30px; }
.article__body blockquote { margin: 26px 0; padding: 18px 22px; border-inline-start: 4px solid var(--store-accent); background: var(--cream); font-family: var(--font-h); font-size: 20px; color: var(--store-primary); border-radius: 0 var(--radius) var(--radius) 0; }
.article__foot { max-width: 720px; margin: 30px auto 0; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------- صفحة المكوّنات */
.kit { padding-block: 34px; border-bottom: 1px solid var(--line); }
.kit--cream { background: var(--cream); }
.kit__title { font-size: 20px; margin-bottom: 18px; color: var(--store-primary); }
.kit__title code { font-size: 13px; padding: 2px 8px; border-radius: 4px; background: var(--soft); color: var(--muted); direction: ltr; display: inline-block; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.kit-stack { display: grid; gap: 10px; }
.kit-note { color: var(--muted); font-size: 14px; }
.kit-note code { direction: ltr; display: inline-block; }
.services--kit { border-radius: var(--radius); }
.services--kit .services__inner { padding-inline: 16px; }
.kit-deal { max-width: 320px; }
.kit-opts { display: grid; gap: 10px; }
.kit-opts p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kit-opts strong { margin-inline-end: 6px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--store-primary); color: var(--white); border-color: var(--store-primary); }

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

/* ---------------------------------------------------------- إضافات الإصدار الثاني */
@media (max-width: 599px) {
  .deal { gap: 4px 14px; padding: 12px; }
  .deal .card__media { width: 118px; }
  .deal .countdown--deal .countdown__unit b { min-width: 36px; height: 36px; font-size: 17px; padding: 0 4px; }
  .deal .countdown--deal > i { line-height: 36px; font-size: 16px; }
  .deal .countdown__unit small { font-size: 10.5px; }
  .deal .card__add { flex: 1 1 auto; }
  .card--big .card__title { font-size: 15px; }
  .card--big .price__now { font-size: 17px; }
}

/* «عرض اليوم» بطول «وصل حديثًا»: الغلاف على منصّةٍ رماديّة تمتدّ، فلا يبقى تحت الإطار فراغ */
@media (min-width: 900px) {
  .duo { align-items: stretch; }
  .duo__deal { display: flex; flex-direction: column; }
  .deal { flex: 1; display: flex; flex-direction: column; }
  .deal > [data-slot="section.items"] { flex: 1; display: flex; }
  .deal .card--deal { flex: 1; }
  .deal .card__media { flex: 1; display: grid; place-items: center; margin-top: 10px; border-radius: var(--radius); background: var(--soft); }
  .deal .card__cover { padding: 26px 28px; }
  .deal .card--deal .card__body { flex: none; }
  .deal .card--deal .badge--sale { margin: 10px; }
  .deal .type-dot { bottom: 14px; inset-inline-end: 14px; }
}

/* المواصفات بعمودين في الحاسوب، فلا يبقى نصف التبويب فارغًا */
@media (min-width: 900px) {
  .spec { max-width: none; }
  .spec tbody { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .spec tr { display: grid; grid-template-columns: 34% 1fr; }
  .spec th { width: auto; }
  .spec tr + tr th, .spec tr + tr td { border-top: 0; }
  .spec tr:nth-child(2) th, .spec tr:nth-child(2) td { border-top: 1px solid var(--line); }
}

/* اختيار الصيغة (book.formats) */
.formats-box { display: grid; gap: 8px; }
.formats-box__label { font-size: 14px; font-weight: 700; color: var(--store-primary); }
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.format-opt { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--store-text); min-height: 44px; }
.format-opt .type-dot { position: static; width: 28px; height: 28px; border-width: 0; box-shadow: none; }
.format-opt .type-dot .icon { width: 14px; height: 14px; }
.format-opt__name { font-weight: 700; color: var(--store-primary); }
.format-opt__price { font-size: 13.5px; color: var(--muted); }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt.is-current { border-color: var(--store-primary); box-shadow: 0 0 0 1px var(--store-primary); background: var(--soft); }
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ .format-opt)) { display: none; }

/* شرائح التصفية الفعّالة وتبديل العرض في صفحة التصنيف */
.toolbar__view { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--soft); }
.toolbar__view button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }
.toolbar__view button[aria-pressed="true"] { background: var(--white); color: var(--store-primary); box-shadow: 0 2px 6px rgb(11 34 87 / .12); }
.toolbar__view .icon { width: 18px; height: 18px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 16px; }
.active-filters:not(:has(.fchip)) { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px 4px 14px; border-radius: 999px; background: color-mix(in srgb, var(--store-primary) 9%, var(--white)); color: var(--store-primary); font-size: 14px; font-weight: 700; }
.fchip .icon { width: 14px; height: 14px; }
.fchip:hover { background: var(--store-primary); color: var(--white); }
.active-filters__clear { font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.grid--list.is-rows { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid--list.is-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid--list.is-rows .card { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0 20px; align-items: center; padding: 14px 18px; }
.grid--list.is-rows .card__cover { padding: 0; }
.grid--list.is-rows .card__body { margin-top: 0; }
.grid--list.is-rows .card__buy { padding-top: 10px; margin-top: 0; }
.grid--list.is-rows .card__add { flex: 0 1 220px; }
.grid--list.is-rows .card__title { font-size: 17px; }
@media (max-width: 599px) {
  .grid--list.is-rows .card { grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; padding: 12px; }
}

/* أعمال المؤلّف دوّارٌ أفقيّ، فلا يبقى صفٌّ ناقص */
.works-head { margin-bottom: 18px; }

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