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

:root {
  /* ألوان الهويّة (قيم تجريبيّة) */
  --store-primary: #9B4A58;
  --store-primary-dark: #6E2F3B;
  --store-accent: #F5EBE6;
  --store-bg: #FFFFFF;
  --store-text: #2B2426;

  /* ألوان محايدة */
  --muted: #6F6466;
  --line: #E8E1DE;
  --soft: #FAF7F5;
  --ink: #1E1A1B;
  --white: #FFFFFF;
  --gold: #C9A227;
  --danger-bg: #2B2426;

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

  /* قياسات */
  --container: 1280px;
  --gutter: 16px;
  --radius: 0px;
  --radius-sm: 0px;
  --header-h: 84px;
  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

body[data-corners="rounded"] { --radius: 14px; --radius-sm: 8px; }

/* ---------- أساسيّات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--store-text);
  background: var(--store-bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
svg { flex-shrink: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--store-primary); outline-offset: 2px; }

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- الشريط العلويّ ---------- */
.topbar {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.topbar-info { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar-info span { display: inline-flex; align-items: center; gap: 6px; }
.topbar-tools { display: flex; align-items: center; gap: 18px; }
.topbar-tools a:hover { color: var(--store-primary); }
.social { display: flex; gap: 12px; }
.social a { display: inline-flex; }

/* ---------- شريط الإعلانات ---------- */
.announce {
  background: var(--store-primary-dark);
  color: var(--white);
  font-size: 13px;
  letter-spacing: .3px;
  text-align: center;
  overflow: hidden;
}
.announce-track { position: relative; height: 38px; }
.announce-item {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  opacity: 0; transform: translateY(100%);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.announce-item.is-active { opacity: 1; transform: none; }
.announce-item a { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

/* ---------- الرأس ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--store-bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(30,26,27,.06); }
.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  gap: 24px;
}
.nav-split { display: flex; gap: 30px; font-size: 15px; font-weight: 500; }
.nav-split.end { justify-content: flex-start; }
.nav-split a { position: relative; padding-block: 6px; }
.nav-split a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: var(--store-primary); transform: scaleX(0); transition: transform .3s var(--ease);
}
.nav-split a:hover::after, .nav-split a[aria-current="page"]::after { transform: scaleX(1); }
.nav-split a[aria-current="page"] { color: var(--store-primary); }

.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; }
.brand-tag { font-size: 11px; color: var(--muted); letter-spacing: 2px; }

.header-end { display: flex; align-items: center; justify-content: flex-end; gap: 28px; }
.header-icons { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .2s;
}
.icon-btn:hover { background: var(--soft); }
.icon-btn .count {
  position: absolute; top: 3px; inset-inline-end: 1px;
  min-width: 18px; height: 18px; padding-inline: 4px;
  border-radius: 9px; background: var(--store-primary); color: var(--white);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.header-start { display: flex; align-items: center; }
.menu-toggle { display: none; }

/* لوحة البحث */
.search-panel {
  position: absolute; inset-inline: 0; top: 100%;
  background: var(--store-bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 24px 40px rgba(30,26,27,.08);
  padding-block: 32px 40px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .3s, transform .3s var(--ease), visibility .3s;
}
.search-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.search-form { display: flex; border-bottom: 2px solid var(--store-text); max-width: 760px; margin-inline: auto; }
.search-form input {
  flex: 1; border: 0; background: transparent; padding: 12px 4px; font-size: 20px; outline: none; min-width: 0;
}
.search-form button { padding-inline: 10px; }
.search-trending { max-width: 760px; margin: 16px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; padding: 4px 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--store-text); font-size: 13px;
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--store-primary); color: var(--store-primary); }
.search-cats { max-width: 980px; margin: 32px auto 0; }
.search-cats h3 { font-size: 14px; letter-spacing: 1px; color: var(--muted); font-weight: 500; text-align: center; margin-bottom: 18px; }
.search-cats ul { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.search-cats li a { display: block; text-align: center; }
.search-cats img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 10px; transition: transform .4s var(--ease); }
.search-cats li a:hover img { transform: scale(1.03); }
.search-cats h4 { font-size: 15px; font-weight: 500; }
.search-cats small { color: var(--muted); font-size: 12px; }

/* الدرج الجانبيّ للهاتف */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(30,26,27,.45); z-index: 90;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 100;
  width: min(86vw, 340px);
  background: var(--store-bg);
  transform: translateX(100%);
  transition: transform .35s var(--ease);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.drawer-open .drawer { transform: none; }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head .brand { flex-direction: row; gap: 10px; }
.drawer-head .brand img { width: 34px; height: 34px; }
.drawer-search { display: flex; margin: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.drawer-search input { flex: 1; border: 0; padding: 10px 12px; background: transparent; outline: none; min-width: 0; }
.drawer-search button { padding-inline: 12px; }
.drawer-nav a { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 500; }
.drawer-nav a:hover { color: var(--store-primary); }
.drawer-foot { margin-top: auto; padding: 16px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); background: var(--soft); }
.drawer-foot span { display: inline-flex; gap: 8px; align-items: center; }

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

/* ---------- عنوان القسم ---------- */
.section { padding-block: 72px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.eyebrow {
  display: inline-block; font-size: 14px; font-weight: 500; color: var(--store-primary);
  letter-spacing: 1px; margin-bottom: 8px;
}
.section-title { font-size: 34px; font-weight: 300; letter-spacing: .5px; color: var(--ink); }
.section-title strong { font-weight: 800; }
.section-desc { margin-top: 12px; color: var(--muted); font-size: 15px; }
.section-head::after {
  content: ""; display: block; width: 48px; height: 2px; margin: 20px auto 0; background: var(--store-primary);
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 30px;
  font-size: 15px; font-weight: 700; letter-spacing: .4px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: background .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn-primary { background: var(--store-primary); color: var(--white); }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--store-primary-dark); }
.btn-outline { border-color: var(--store-text); color: var(--store-text); }
.btn-outline:hover { background: var(--store-text); color: var(--white); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { background: var(--store-accent); }
.btn-sm { min-height: 40px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--ink);
  padding-bottom: 4px; border-bottom: 1px solid currentColor;
  transition: color .2s, gap .25s var(--ease);
}
.link-arrow:hover { color: var(--store-primary); gap: 12px; }

/* ---------- التقييم ---------- */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; }
.stars svg { width: 15px; height: 15px; }
.stars .on { fill: var(--gold); }
.stars .off { fill: #E2DADA; }
.stars .half { fill: url(#half-gold); }

/* ---------- السعر ---------- */
.price { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-now { font-weight: 700; font-size: 16px; color: var(--ink); }
.price-old { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.price.is-sale .price-now { color: var(--store-primary); }

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

.book-card { position: relative; display: flex; flex-direction: column; }
.book-media {
  position: relative; overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--soft);
  border-radius: var(--radius);
}
.book-media > a > img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.book-card:hover .book-media > a > img { transform: scale(1.05); }

/* دائرة نوع الكتاب */
.type-dot {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white); box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.type-dot svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.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: 12px; inset-inline-start: 12px; z-index: 2; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.badge { display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 700; line-height: 1.6; border-radius: var(--radius-sm); }
.badge-sale { background: var(--store-primary); color: var(--white); }
.badge-new { background: var(--white); color: var(--ink); border: 1px solid var(--ink); }

/* المفضّلة والنظرة السريعة: تطفوان فوق الغلاف عند التحويم، ودائمًا في اللمس، ولا تحجزان مكانًا */
.card-tools {
  position: absolute; top: 54px; inset-inline-end: 12px; z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; transform: translateX(-8px);
  transition: opacity .3s, transform .3s var(--ease);
}
.book-card:hover .card-tools, .card-tools:focus-within { opacity: 1; transform: none; }
.tool-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--white); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: color .2s, background .2s;
}
.tool-btn:hover, .wish-btn.is-active { color: var(--store-primary); }
.wish-btn.is-active svg { fill: currentColor; }

/* صفّ السعر، وتحته زرّ السلّة: شريط القالب الداكن «أضف إلى السلّة» نفسه، كان يصعد فوق الغلاف عند التحويم فصار ظاهرًا دائمًا (البند 7) */
.price-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: auto; padding-top: 6px; }
.card-add { align-self: stretch; margin-top: 12px; min-height: 44px; padding-inline: 12px; font-size: 14px; }

/* نفدت الكمّيّة */
.stock-out {
  position: absolute; inset-inline: 0; top: 50%; z-index: 2;
  transform: translateY(-50%);
  background: rgba(43,36,38,.88); color: var(--white);
  text-align: center; font-weight: 700; font-size: 14px; letter-spacing: 1px;
  padding: 8px 0;
}
.book-card.is-out .book-media > a > img { filter: grayscale(.6) opacity(.75); }

.book-body { padding-top: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.book-author { font-size: 13px; color: var(--muted); letter-spacing: .3px; }
.book-author:hover { color: var(--store-primary); }
.book-title { font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--ink); }
.book-title a:hover { color: var(--store-primary); }

/* أشكال البطاقة: كلاسيكيّة (الافتراضيّة)، ومؤطَّرة، وبسيطة */
body[data-card-style="framed"] .book-card { border: 1px solid var(--line); padding: 12px 12px 18px; border-radius: var(--radius); transition: border-color .3s, box-shadow .3s; }
body[data-card-style="framed"] .book-card:hover { border-color: transparent; box-shadow: 0 14px 34px rgba(30,26,27,.09); }
body[data-card-style="minimal"] .book-body { text-align: start; align-items: stretch; }
body[data-card-style="minimal"] .price-row { justify-content: space-between; }
body[data-card-style="minimal"] .book-card .rating { display: none; }

/* ---------- ترقيم الصفحات ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px; padding-inline: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-weight: 500; transition: border-color .2s, color .2s, background .2s;
}
.pagination a:hover { border-color: var(--store-primary); color: var(--store-primary); }
.pagination .is-current { background: var(--store-text); border-color: var(--store-text); color: var(--white); }
.pagination .gap { border: 0; min-width: 20px; color: var(--muted); }

/* ---------- الاشتراك ---------- */
.newsletter { background: var(--store-accent); padding-block: 64px; text-align: center; }
.newsletter .section-title { font-size: 30px; }
.newsletter p { color: var(--muted); margin-top: 8px; }
.newsletter-form { display: flex; max-width: 560px; margin: 28px auto 0; background: var(--white); border-radius: var(--radius-sm); }
.newsletter-form input { flex: 1; min-width: 0; border: 0; padding: 0 18px; min-height: 54px; background: transparent; outline: none; }
.newsletter-form .btn { min-height: 54px; border-radius: 0; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--soft); border-top: 1px solid var(--line); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-block: 64px 48px; }
.footer-brand .brand { align-items: flex-start; text-align: start; flex-direction: row; gap: 12px; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); max-width: 320px; }
.footer-brand .social { margin-top: 20px; }
.footer-brand .social a {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%;
  align-items: center; justify-content: center; transition: border-color .2s, color .2s;
}
.footer-brand .social a:hover { border-color: var(--store-primary); color: var(--store-primary); }
.footer-col h4 { font-size: 16px; font-weight: 700; margin-bottom: 18px; color: var(--ink); }
.footer-col li + li { margin-top: 10px; }
.footer-col a { color: var(--muted); transition: color .2s; }
.footer-col a:hover { color: var(--store-primary); }
.footer-contact li { display: flex; gap: 10px; color: var(--muted); }
.footer-contact svg { margin-top: 3px; color: var(--store-primary); }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

/* ---------- صفحة المكوّنات ---------- */
.kit-hero { background: var(--store-accent); padding-block: 48px; text-align: center; }
.kit-hero h1 { font-size: 30px; font-weight: 300; }
.kit-hero h1 strong { font-weight: 800; }
.kit-hero p { color: var(--muted); margin-top: 8px; }
.kit-block { padding-block: 48px; border-bottom: 1px dashed var(--line); }
.kit-label {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 28px;
  font-size: 13px; color: var(--muted);
}
.kit-label b { font-size: 18px; color: var(--ink); }
.kit-label code { direction: ltr; unicode-bidi: isolate; background: var(--soft); padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.kit-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.kit-caption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
.kit-legend { display: flex; flex-wrap: wrap; gap: 20px; }
.kit-legend span { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; }
.kit-legend .type-dot { position: static; }

/* ---------- الاستجابة ---------- */
@media (max-width: 1199px) {
  .nav-split { gap: 20px; font-size: 14px; }
  .header-end { gap: 16px; }
  .books-grid { --per-row: 3 !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 991px) {
  :root { --header-h: 68px; }
  .topbar-info span:nth-child(3) { display: none; }
  .nav-split { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-row { grid-template-columns: auto auto 1fr; gap: 8px; }
  .header-start { display: flex; }
  .brand { flex-direction: row; gap: 10px; justify-content: flex-start; justify-self: start; }
  .brand img { width: 36px; height: 36px; }
  .brand-tag { display: none; }
  .search-cats ul { grid-template-columns: repeat(3, 1fr); }
  .search-cats li:nth-child(n+4) { display: none; }
  .section { padding-block: 56px; }
  .section-title { font-size: 28px; }
  .card-tools { opacity: 1; transform: none; }
}

@media (hover: none) {
  .card-tools { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
  body { padding-bottom: 64px; }
  .topbar { display: none; }
  .announce { font-size: 12px; }
  .header-wishlist, .header-account { display: none; }
  .books-grid { --per-row: 2 !important; gap: 28px 14px; }
  .book-title { font-size: 15px; }
  .type-dot { width: 30px; height: 30px; top: 8px; inset-inline-end: 8px; }
  .type-dot svg { width: 15px; height: 15px; }
  .card-tools { top: 44px; inset-inline-end: 8px; gap: 6px; }
  .tool-btn { width: 30px; height: 30px; }
  .badges { top: 8px; inset-inline-start: 8px; }
  .price-row { gap: 10px; }
  .card-add { min-height: 40px; margin-top: 10px; font-size: 13px; padding-inline: 8px; letter-spacing: 0; }
  .price { gap: 6px; justify-content: center; }
  .section-title { font-size: 24px; }
  .section-head { margin-bottom: 32px; }
  .search-form input { font-size: 17px; }
  .search-cats ul { gap: 12px; }
  .search-cats h4 { font-size: 13px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-block: 48px 32px; }
  .footer-bottom .container { justify-content: center; text-align: center; padding-block: 14px; }
  .newsletter-form { flex-direction: column; background: transparent; gap: 10px; }
  .newsletter-form input { background: var(--white); border-radius: var(--radius-sm); }
  .newsletter-form .btn { border-radius: var(--radius-sm); }

  .header-icons [data-search-toggle] { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    height: 64px; background: var(--store-bg);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(30,26,27,.05);
  }
  .bottom-nav a {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 11px; color: var(--muted);
  }
  .bottom-nav a[aria-current="page"] { color: var(--store-primary); }
  .bottom-nav .count {
    position: absolute; top: 8px; inset-inline-start: calc(50% + 4px);
    min-width: 17px; height: 17px; padding-inline: 4px; border-radius: 9px;
    background: var(--store-primary); color: var(--white); font-size: 10px; line-height: 17px; text-align: center;
  }
}

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

/* اسم المتجر ووصفه في سطرين */
.brand > span { display: flex; flex-direction: column; align-items: inherit; }
.footer-brand .brand > span { align-items: flex-start; }

/* ============================================================
   أقسام الصفحات
   ============================================================ */

/* ---------- السلايدر ---------- */
.hero { position: relative; overflow: hidden; background: var(--store-accent); }
.hero-track { position: relative; height: clamp(420px, 43vw, 620px); }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .8s var(--ease), visibility .8s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.hero-caption {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.hero-caption > * { max-width: 500px; }
.hero-caption .eyebrow { font-size: 15px; letter-spacing: 2px; }
.hero-title { font-size: clamp(32px, 4.4vw, 60px); font-weight: 300; line-height: 1.2; color: var(--ink); }
.hero-title strong { font-weight: 800; display: block; }
.hero-text { margin-top: 18px; font-size: 17px; color: var(--muted); max-width: 440px; }
.hero-text b { color: var(--store-primary); }
.hero-caption .btn { margin-top: 30px; }
.hero-slide.is-active .hero-caption > * { animation: rise .8s var(--ease) both; }
.hero-slide.is-active .hero-caption > *:nth-child(2) { animation-delay: .12s; }
.hero-slide.is-active .hero-caption > *:nth-child(3) { animation-delay: .24s; }
.hero-slide.is-active .hero-caption > *:nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero-dots { position: absolute; bottom: 28px; inset-inline: 0; z-index: 2; display: flex; justify-content: center; gap: 10px; }
.hero-dots button { width: 30px; height: 3px; background: rgba(43,36,38,.25); transition: background .3s, width .3s; }
.hero-dots button[aria-current="true"] { background: var(--store-primary); width: 46px; }
.hero-arrow {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--white); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(30,26,27,.1);
  opacity: 0; transition: opacity .3s, background .2s, color .2s;
}
.hero:hover .hero-arrow, .hero-arrow:focus-visible { opacity: 1; }
.hero-arrow:hover { background: var(--store-primary); color: var(--white); }
.hero-arrow.prev { inset-inline-start: 24px; }
.hero-arrow.next { inset-inline-end: 24px; }

/* ---------- شريط الثقة ---------- */
.trust { border-bottom: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item { display: flex; align-items: center; gap: 16px; padding: 30px 20px; }
.trust-item + .trust-item { border-inline-start: 1px solid var(--line); }
.trust-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--store-accent); color: var(--store-primary);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trust-icon svg { width: 26px; height: 26px; }
.trust-item h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.trust-item p { font-size: 13px; color: var(--muted); }

/* ---------- البانرات ---------- */
.banners { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.banner { position: relative; overflow: hidden; display: block; aspect-ratio: 9 / 5; border-radius: var(--radius); }
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: transform .8s var(--ease); }
.banner:hover > img { transform: scale(1.04); }
.banner-body {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding-inline: 44px; max-width: 62%;
}
.banner-body .eyebrow { margin-bottom: 4px; }
.banner-title { font-size: clamp(22px, 2.4vw, 32px); font-weight: 300; line-height: 1.3; color: var(--ink); margin-bottom: 18px; }
.banner-title strong { font-weight: 800; display: block; }
.banner.is-dark .banner-title, .banner.is-dark .link-arrow { color: var(--white); }
.banner.is-dark .eyebrow { color: #E9C3BC; }

/* ---------- المؤلّفون ---------- */
.authors-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.author-chip { text-align: center; display: block; }
.author-chip img {
  width: 100%; max-width: 150px; aspect-ratio: 1; margin: 0 auto 14px;
  border-radius: 50%; object-fit: cover;
  outline: 1px solid var(--line); outline-offset: 6px;
  transition: outline-color .3s, transform .4s var(--ease);
}
.author-chip:hover img { outline-color: var(--store-primary); transform: translateY(-4px); }
.author-chip h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.author-chip span { font-size: 13px; color: var(--muted); }

/* ---------- الدوّار العامّ ---------- */
.carousel { position: relative; }
.carousel-track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 28px) / 3);
  gap: 28px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; padding-bottom: 4px;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; }
.carousel-nav { display: flex; justify-content: center; gap: 10px; margin-top: 32px; }
.carousel-nav button {
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s, background .2s;
}
.carousel-nav button:hover { border-color: var(--store-primary); background: var(--store-primary); color: var(--white); }

/* ---------- آراء القرّاء ---------- */
.reviews-section { background: var(--soft); }
.review-card {
  margin: 0;
  background: var(--white); padding: 36px 30px 30px; text-align: center;
  border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.review-quote { color: var(--store-primary); width: 34px; height: 34px; }
.review-text { color: var(--store-text); font-size: 15px; line-height: 1.9; flex: 1; }
.review-person { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.review-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--store-accent); color: var(--store-primary-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
}
.review-name { font-weight: 700; color: var(--ink); text-align: start; }
.review-book { font-size: 13px; color: var(--muted); text-align: start; }

/* ---------- كتاب الأسبوع ---------- */
.spotlight-section { background: var(--store-accent); }
.spotlight .carousel-track { grid-auto-columns: 100%; }
.spot {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center;
  padding-inline: 8%;
}
.spot-cover { position: relative; max-width: 340px; margin-inline: auto; width: 100%; }
.spot-cover::before {
  content: ""; position: absolute; inset: 24px -24px -24px 24px;
  border: 1px solid var(--store-primary); z-index: 0; border-radius: var(--radius);
}
.spot-cover img { position: relative; z-index: 1; width: 100%; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 24px 50px rgba(43,36,38,.18); border-radius: var(--radius); }
.spot-cover .type-dot { z-index: 2; }
.spot-body .book-author { font-size: 15px; }
.spot-title { font-size: clamp(26px, 3vw, 40px); font-weight: 300; line-height: 1.2; margin: 4px 0 2px; color: var(--ink); }
.spot-title strong { font-weight: 800; }
.spot-desc { color: var(--muted); max-width: 480px; margin: 14px 0 0; }
.spot-body .price { margin-top: 10px; }
.spot-body .price-now { font-size: 26px; }
.spot-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- من نحن ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-media { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; }
.about-media img { width: 100%; aspect-ratio: 5/6; object-fit: cover; border-radius: var(--radius); }
.about-media img:last-child { margin-bottom: 48px; }
.about-body .section-title { font-size: 32px; }
.about-body p { color: var(--muted); margin-top: 16px; }
.about-stats { display: flex; flex-wrap: wrap; gap: 40px; margin: 30px 0; }
.about-stats:empty { display: none; }
.about-stats:empty + .link-arrow { margin-top: 26px; }
.about-stats b { display: block; font-size: 32px; font-weight: 800; color: var(--store-primary); line-height: 1.1; }
.about-stats span { font-size: 13px; color: var(--muted); }

/* ---------- رأس الصفحة الداخليّة ---------- */
.page-hero { background: var(--store-accent); padding-block: 44px; text-align: center; }
.page-hero h1 { font-size: 34px; font-weight: 300; color: var(--ink); }
.page-hero h1 strong { font-weight: 800; }
.page-hero p { color: var(--muted); margin-top: 6px; }
.breadcrumb { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.breadcrumb a:hover { color: var(--store-primary); }
.breadcrumb .sep { opacity: .6; }
.breadcrumb-bar { border-bottom: 1px solid var(--line); }
.breadcrumb-bar .breadcrumb { justify-content: flex-start; margin: 0; padding-block: 16px; }

/* ---------- صفحة التصنيف ---------- */
.shop-layout { display: grid; grid-template-columns: 270px 1fr; gap: 44px; padding-block: 56px 72px; }
.shop-layout .books-grid { --per-row: 3; }
body[data-books-per-row="5"] .shop-layout .books-grid,
body[data-books-per-row="6"] .shop-layout .books-grid { --per-row: 4; }
.filters { align-self: start; position: sticky; top: calc(var(--header-h) + 20px); }
.filters-toggle { display: none; }
.filter-block { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.filter-block h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--ink); }
.filter-list li + li { margin-top: 10px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary); margin: 0; }
.check .num { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.check .type-dot { position: static; width: 24px; height: 24px; box-shadow: none; }
.check .type-dot svg { width: 13px; height: 13px; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { width: 100%; min-width: 0; border: 1px solid var(--line); padding: 8px 10px; border-radius: var(--radius-sm); background: var(--white); }
.filter-actions { display: flex; gap: 10px; }
.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: 32px; border-bottom: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  padding: 9px 14px 9px 38px; min-height: 42px; font-size: 14px; color: var(--store-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236F6466' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center;
}
.toolbar-sort { display: flex; align-items: center; gap: 10px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: -16px 0 28px; }
.active-filters .chip { gap: 6px; background: var(--soft); }
.shop-layout .pagination { margin-top: 56px; }

/* ---------- صفحة الكتاب ---------- */
.product { display: grid; grid-template-columns: 1fr 1.05fr; gap: 64px; padding-block: 48px 64px; align-items: start; }
.gallery { display: grid; grid-template-columns: 84px 1fr; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.gallery-main { position: relative; background: var(--soft); padding: 36px; border-radius: var(--radius); }
.gallery-main img { width: 100%; max-width: 420px; margin-inline: auto; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 20px 44px rgba(43,36,38,.16); }
.gallery-main .type-dot { width: 42px; height: 42px; top: 18px; inset-inline-end: 18px; }
.gallery-main .type-dot svg { width: 20px; height: 20px; }
.gallery-main .badges { top: 18px; inset-inline-start: 18px; }
.gallery-thumbs { display: flex; flex-direction: column; gap: 12px; }
.gallery-thumbs button { border: 1px solid var(--line); padding: 4px; background: var(--white); transition: border-color .2s; border-radius: var(--radius-sm); }
.gallery-thumbs button[aria-current="true"], .gallery-thumbs button:hover { border-color: var(--store-primary); }
.gallery-thumbs img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }

.type-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.type-label .type-dot { position: static; width: 26px; height: 26px; box-shadow: none; }
.type-label .type-dot svg { width: 14px; height: 14px; }
.product-title { font-size: clamp(28px, 3vw, 38px); font-weight: 800; color: var(--ink); line-height: 1.3; }
.product-author { display: inline-block; margin-top: 8px; font-size: 16px; color: var(--muted); }
.product-author a { color: var(--store-primary); font-weight: 700; }
.product-rating { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 14px; }
.product-rating a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.product .price { margin-top: 22px; }
.product .price-now { font-size: 30px; }
.product .price-old { font-size: 18px; }
.save-tag { font-size: 13px; font-weight: 700; color: var(--store-primary); background: var(--store-accent); padding: 2px 10px; border-radius: var(--radius-sm); }
.product-excerpt { margin-top: 20px; color: var(--muted); padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.stock-line { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 14px; font-weight: 500; color: #2e6b50; }
.stock-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-line.is-out { color: var(--muted); }
.buy-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.buy-row .btn { flex: 1; min-width: 170px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); height: 48px; }
.qty button { width: 42px; height: 100%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: color .2s; }
.qty button:hover { color: var(--store-primary); }
.qty input { width: 46px; height: 100%; border: 0; text-align: center; font-weight: 700; background: transparent; -moz-appearance: textfield; outline: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wish-inline {
  width: 48px; height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; transition: border-color .2s, color .2s;
}
.wish-inline:hover, .wish-inline.is-active { border-color: var(--store-primary); color: var(--store-primary); }
.wish-inline.is-active svg { fill: currentColor; }
.sample-row { margin-top: 12px; }
.sample-row .btn { width: 100%; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 28px; border-radius: var(--radius-sm); overflow: hidden; }
.fact { background: var(--white); padding: 14px 16px; }
.fact > span { display: block; font-size: 12px; color: var(--muted); }
.fact b { font-size: 15px; color: var(--ink); }
.meta-list { margin-top: 24px; font-size: 14px; display: grid; gap: 8px; }
.meta-list li { display: flex; gap: 8px; }
.meta-list span { color: var(--muted); min-width: 90px; }
.meta-list a:hover { color: var(--store-primary); }
.info-list { margin-top: 24px; padding: 16px 18px; background: var(--soft); border-radius: var(--radius-sm); display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.info-list li { display: flex; gap: 10px; align-items: flex-start; }
.info-list svg { color: var(--store-primary); margin-top: 3px; }

/* التبويبات */
.tabs { border-top: 1px solid var(--line); padding-block: 0 72px; }
.tab-list { display: flex; justify-content: center; gap: 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; overflow-x: auto; }
.tab-list button { position: relative; padding-block: 22px; font-size: 17px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tab-list button::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--store-primary); transform: scaleX(0); transition: transform .3s var(--ease); }
.tab-list button[aria-selected="true"] { color: var(--ink); }
.tab-list button[aria-selected="true"]::after { transform: scaleX(1); }
.tab-panel { max-width: 860px; margin-inline: auto; }
.tab-panel[hidden] { display: none; }
.tab-panel p + p { margin-top: 14px; }
.tab-panel > p { color: var(--store-text); line-height: 2; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { text-align: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.spec-table th { width: 34%; color: var(--muted); font-weight: 500; background: var(--soft); }
.review-summary { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: center; padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.review-score { text-align: center; }
.review-score b { display: block; font-size: 52px; font-weight: 800; color: var(--ink); line-height: 1; }
.review-score .stars svg { width: 18px; height: 18px; }
.review-score p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.bars { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.bar { display: grid; grid-template-columns: 56px 1fr 34px; align-items: center; gap: 10px; }
.bar i { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i::before { content: ""; display: block; height: 100%; width: var(--w); background: var(--gold); }
.review-item { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.review-item header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-item time { font-size: 12px; color: var(--muted); }
.review-item p { color: var(--store-text); }
.related { padding-block: 72px; background: var(--soft); }

/* ---------- صفحة المؤلّف ---------- */
.author-hero { background: var(--store-accent); padding-block: 56px; }
.author-hero .container { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: center; }
.author-photo { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; outline: 1px solid var(--store-primary); outline-offset: 10px; }
.author-hero h1 { font-size: 38px; font-weight: 800; color: var(--ink); }
.author-hero .eyebrow { margin-bottom: 2px; }
.author-bio { color: var(--muted); margin-top: 14px; max-width: 720px; line-height: 1.9; }
.author-stats { display: flex; gap: 36px; margin-top: 24px; }
.author-stats b { display: block; font-size: 24px; color: var(--store-primary); font-weight: 800; line-height: 1.2; }
.author-stats span { font-size: 13px; color: var(--muted); }

/* ---------- السلّة ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 44px; padding-block: 56px 72px; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table thead th { text-align: start; font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 12px 14px; border-bottom: 1px solid var(--line); }
.cart-table td { padding: 22px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-product { display: flex; align-items: center; gap: 18px; }
.cart-product img { width: 76px; aspect-ratio: 2/3; object-fit: cover; flex-shrink: 0; border-radius: var(--radius-sm); }
.cart-product .type-label { margin-bottom: 4px; }
.cart-product h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.cart-product h3 a:hover { color: var(--store-primary); }
.cart-product .book-author { display: block; }
.cart-table .qty { height: 42px; }
.cart-table .qty button { width: 36px; }
.cart-table .qty input { width: 40px; }
.remove-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: background .2s, color .2s; }
.remove-btn:hover { background: var(--store-accent); color: var(--store-primary); }
.cart-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.coupon { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.coupon input { border: 0; padding: 0 14px; min-height: 46px; min-width: 0; flex: 1; outline: none; background: transparent; }
.coupon .btn { min-height: 46px; border-radius: 0; }
.applied-coupon { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.applied-coupon .chip { gap: 8px; background: var(--soft); }
.summary { background: var(--soft); padding: 30px; border-radius: var(--radius); position: sticky; top: calc(var(--header-h) + 20px); }
.summary h2 { font-size: 20px; font-weight: 800; margin-bottom: 18px; color: var(--ink); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
.summary-row span:first-child { color: var(--muted); }
.summary-row.discount span:last-child { color: var(--store-primary); font-weight: 700; }
.summary-row.total { border-bottom: 0; padding-top: 18px; font-size: 18px; font-weight: 800; color: var(--ink); }
.summary-row.total span:first-child { color: var(--ink); }
.summary .btn { margin-top: 18px; }
.summary-note { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.free-ship { margin-bottom: 26px; padding: 16px 18px; background: var(--store-accent); font-size: 14px; border-radius: var(--radius-sm); }
.free-ship b { color: var(--store-primary-dark); }
.free-ship i { display: block; height: 4px; background: rgba(155,74,88,.18); margin-top: 10px; border-radius: 2px; overflow: hidden; }
.free-ship i::before { content: ""; display: block; height: 100%; width: var(--w, 0%); background: var(--store-primary); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: 96px 72px; }
.notfound-code { font-size: clamp(110px, 18vw, 200px); font-weight: 300; line-height: 1; color: var(--store-accent); letter-spacing: 8px; -webkit-text-stroke: 1px var(--store-primary); }
.notfound h1 { font-size: 30px; font-weight: 300; color: var(--ink); margin-top: 10px; }
.notfound h1 strong { font-weight: 800; }
.notfound p { color: var(--muted); max-width: 480px; margin: 12px auto 0; }
.notfound .search-form { margin-top: 32px; max-width: 520px; }
.notfound-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- استجابة الأقسام ---------- */
@media (max-width: 1199px) {
  .authors-row { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .shop-layout { grid-template-columns: 240px 1fr; gap: 32px; }
  .shop-layout .books-grid { --per-row: 2 !important; }
  .product, .about-grid { gap: 40px; }
  .spot { padding-inline: 0; gap: 40px; }
  .cart-layout { grid-template-columns: 1fr 320px; gap: 28px; }
}

@media (max-width: 991px) {
  .trust-grid { 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); }
  .carousel-track { grid-auto-columns: calc((100% - 20px) / 2); gap: 20px; }
  .spotlight .carousel-track { grid-auto-columns: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; padding-top: 32px; }
  .shop-layout .books-grid { --per-row: 3 !important; }
  .filters { position: static; }
  .filters-toggle { display: inline-flex; }
  .filters-body { display: none; padding: 24px 0 0; }
  .filters.is-open .filters-body { display: block; }
  .filters-body { column-count: 2; column-gap: 28px; }
  .filter-block { break-inside: avoid; }
  .product { grid-template-columns: 1fr; padding-top: 28px; }
  .gallery { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .author-hero .container { grid-template-columns: 160px 1fr; gap: 32px; }
  .author-photo { width: 160px; height: 160px; }
  .hero-arrow { display: none; }
}

@media (max-width: 767px) {
  .hero-track { height: auto; display: grid; }
  .hero-slide { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; }
  .hero-slide > img { position: static; width: 100%; height: auto; aspect-ratio: 16 / 10; object-position: left center; }
  .hero-caption { height: auto; justify-content: flex-start; padding-block: 18px 52px; max-width: none; }
  .hero-caption .eyebrow { font-size: 13px; margin-bottom: 4px; }
  .hero-title { font-size: 30px; }
  .hero-title strong { display: inline; }
  .hero-text { font-size: 15px; margin-top: 8px; }
  .hero-caption .btn { margin-top: 16px; min-height: 44px; }
  .hero-dots { bottom: 20px; }
  .trust-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-inline: 0; }
  .trust-grid::-webkit-scrollbar { display: none; }
  .trust-item { flex: 0 0 auto; scroll-snap-align: start; gap: 10px; padding: 14px 16px; border-top: 0 !important; }
  .trust-item:nth-child(3) { border-inline-start: 1px solid var(--line); }
  .trust-icon { width: 40px; height: 40px; }
  .trust-icon svg { width: 20px; height: 20px; }
  .trust-item h3 { font-size: 14px; white-space: nowrap; }
  .trust-item p { font-size: 12px; white-space: nowrap; }
  .banners { grid-template-columns: 1fr; gap: 16px; }
  .banner-body { padding-inline: 24px; max-width: 70%; }
  .authors-row { grid-template-columns: repeat(3, 1fr); gap: 24px 14px; }
  .author-chip h3 { font-size: 14px; }
  .author-chip span { font-size: 12px; }
  .carousel-track { grid-auto-columns: 86%; gap: 14px; }
  .review-card { padding: 28px 20px 24px; }
  .spot { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .spot-cover { max-width: 230px; }
  .spot-cover::before { inset: 14px -14px -14px 14px; }
  .spot-desc { margin-inline: auto; }
  .spot .price, .spot-actions { justify-content: center; }
  .about-stats { gap: 24px; }
  .about-body .section-title { font-size: 26px; }
  .page-hero { padding-block: 32px; }
  .page-hero h1 { font-size: 26px; }
  .shop-layout .books-grid { --per-row: 2 !important; }
  .filters-body { column-count: 1; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-sort .select { flex: 1; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-thumbs { flex-direction: row; order: 2; justify-content: center; }
  .gallery-thumbs button { width: 64px; }
  .gallery-main { padding: 24px; }
  .gallery-main img { max-width: 240px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts .fact:nth-child(2n+1):last-child { grid-column: 1 / -1; }
  .buy-row .btn { min-width: 0; }
  .tab-list { justify-content: flex-start; gap: 24px; }
  .tab-list button { font-size: 15px; padding-block: 16px; }
  .review-summary { grid-template-columns: 1fr; gap: 20px; }
  .author-hero .container { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 24px; }
  .author-photo { width: 140px; height: 140px; }
  .author-hero h1 { font-size: 28px; }
  .author-stats { justify-content: center; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; }
  .cart-table tr { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding-block: 18px; border-bottom: 1px solid var(--line); }
  .cart-table td { padding: 0; border: 0; }
  .cart-table td.cell-product { grid-column: 1 / -1; padding-inline-end: 36px; }
  .cart-table td.cell-price { display: none; }
  .cart-table td.cell-total { align-self: center; font-weight: 700; }
  .cart-table td.cell-remove { position: absolute; top: 14px; inset-inline-end: 0; }
  .cart-foot { flex-direction: column; }
  .coupon { width: 100%; }
  .notfound { padding-block: 56px 48px; }
}

/* منع تمدّد أعمدة الشبكة بمحتواها */
.cart-layout > *, .shop-layout > *, .product > *, .about-grid > *, .spot > * { min-width: 0; }
.coupon input { width: 100%; }
@media (max-width: 767px) { .cart-foot > div { width: 100%; } }

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

/* ==== ميزات المنصّة (الملحق 8) ==== */
/* بانرٌ واحد يمتدّ عرض الصفّ */
.banners > .banner:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 5; }
@media (max-width: 760px) { .banners > .banner:only-child { aspect-ratio: 9 / 5; } }

/* الباقات */
.bundles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.bundle-card { display: flex; flex-direction: column; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.bundle-covers { display: flex; justify-content: center; align-items: flex-end; padding: 34px 24px 26px; background: var(--store-accent); }
.bundle-covers img { width: 30%; max-width: 120px; height: auto; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 14px 24px -12px rgba(30, 26, 27, .55); }
.bundle-covers img + img { margin-inline-start: -8%; }
.bundle-covers img:nth-child(2) { transform: translateY(-10px); position: relative; z-index: 1; }
.bundle-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px 24px 24px; flex: 1; }
.bundle-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.bundle-price { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.bundle-now { font-size: 22px; font-weight: 800; color: var(--store-primary); }
.bundle-old { font-size: 15px; color: var(--muted); }
.bundle-saving { display: inline-block; padding: 3px 10px; background: var(--store-primary); color: var(--white); font-size: 13px; font-weight: 700; border-radius: var(--radius-sm); }
.bundle-body .btn { margin-top: auto; width: 100%; }
.bundle-saving + .btn { margin-top: 16px; }
@media (max-width: 991px) { .bundles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .bundles-grid { grid-template-columns: minmax(0, 1fr); } }
body[data-corners="rounded"] .bundle-card { border-radius: 14px; overflow: hidden; }

/* «اشترِ أكثر ووفّر» قرب السعر في صفحة الكتاب */
.qty-deal { display: flex; width: fit-content; align-items: center; gap: 8px; margin: 10px 0 0; padding: 6px 12px; background: var(--store-accent); color: var(--store-primary-dark); font-size: 14px; font-weight: 700; }
.qty-deal .icon { width: 16px; height: 16px; }

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

/* ==== الإصدار الثاني: أقسامٌ جديدة في الرئيسيّة وصفحتا المدوّنة ==== */
/* خلفيّات الأقسام تتناوب، فلا يتجاور قسمان بالمظهر نفسه */
.cats-section, .new-section, .about-section { background: var(--soft); }
.section-more { text-align: center; margin-top: 40px; }

/* تبويبات «الأكثر مبيعًا» (القاعدة 16) */
.row-tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: -16px 0 36px; }
.row-tab {
  min-height: 40px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--store-text); transition: border-color .2s, color .2s, background .2s;
}
.row-tab:hover { border-color: var(--store-primary); color: var(--store-primary); }
.row-tab[aria-selected="true"] { background: var(--store-text); border-color: var(--store-text); color: var(--white); }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* تسوّق حسب التصنيف */
.cat-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.cat-tile img { width: 100%; max-width: 168px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin-bottom: 10px; outline: 1px solid var(--line); outline-offset: 5px; transition: outline-color .3s, transform .4s var(--ease); }
.cat-tile:hover img { outline-color: var(--store-primary); transform: translateY(-4px); }
.cat-tile b { font-size: 16px; color: var(--ink); }
.cat-tile small { font-size: 13px; color: var(--muted); }

/* عروض الموسم بعدّادٍ واحد (offer.ends_at) */
.deal-box { border: 1px solid var(--store-primary); padding: 40px; border-radius: var(--radius); position: relative; }
.deal-box::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); pointer-events: none; border-radius: var(--radius); }
.deal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; position: relative; }
.deal-head .section-desc { margin-top: 6px; }
.countdown { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.countdown[hidden] { display: none; }
.cd-label { font-size: 14px; color: var(--muted); }
.cd-units { display: flex; gap: 8px; }
.cd-unit { min-width: 62px; padding: 8px 6px; text-align: center; background: var(--store-primary-dark); color: var(--white); border-radius: var(--radius-sm); }
.cd-unit b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 11px; opacity: .9; }
.deal-grid { position: relative; }
.deal-box .books-grid.deal-grid { --per-row: 4; }

/* وصل حديثًا: دوّارٌ أفقيّ */
.section-head.is-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; text-align: start; }
.section-head.is-split::after { display: none; }
.carousel-nav.is-head { margin: 0; }
.books-carousel .carousel-track { grid-auto-columns: calc((100% - 3 * 28px) / 4); gap: 28px; padding-bottom: 6px; }
.books-carousel .book-card { min-width: 0; }

/* المدوّنة: البطاقات */
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.post-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post-media { display: block; overflow: hidden; }
.post-media img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-media img { transform: scale(1.04); }
.post-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px 24px 26px; flex: 1; }
.post-date { font-size: 13px; color: var(--store-primary); font-weight: 500; }
.post-title { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.post-title a:hover { color: var(--store-primary); }
.post-excerpt { color: var(--muted); font-size: 15px; }
.post-body .link-arrow { margin-top: auto; padding-top: 8px; font-size: 14px; }

/* صفحة المدوّنة */
.blog-list .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
.post-card.is-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
.post-card.is-lead .post-media img { height: 100%; }
.post-card.is-lead .post-body { justify-content: center; padding: 40px; }
.post-card.is-lead .post-title { font-size: 28px; font-weight: 300; }

/* صفحة المقال */
.article { max-width: 820px; margin-inline: auto; padding-block: 48px 72px; }
.article-head { text-align: center; margin-bottom: 32px; }
.article-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 300; color: var(--ink); margin-top: 8px; }
.article-title strong { font-weight: 800; }
.article-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.article-body { margin-top: 36px; font-size: 17px; line-height: 2; }
.article-body p + p, .article-body h2 + p { margin-top: 14px; }
.article-body h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 36px; }
.article-body blockquote { margin: 32px 0; padding: 8px 24px; border-inline-start: 2px solid var(--store-primary); font-size: 20px; font-weight: 300; color: var(--ink); }
.article-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }

/* اختيار الصيغة (book.formats) */
.formats-box { margin-top: 18px; }
.formats-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.formats { display: flex; flex-wrap: wrap; gap: 10px; }
.format-opt { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; min-width: 150px; padding: 8px 16px 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); transition: border-color .2s, background .2s; }
.format-opt .type-dot { position: static; grid-row: span 2; width: 28px; height: 28px; box-shadow: none; }
.format-opt .type-dot svg { width: 14px; height: 14px; }
.format-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.format-price { font-size: 13px; color: var(--muted); }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt.is-current { border-color: var(--store-primary); background: var(--store-accent); box-shadow: inset 0 0 0 1px var(--store-primary); }
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ [data-preview-copy])) { display: none; }

/* شبكة أو قائمة في صفحة التصنيف */
.view-toggle { display: flex; gap: 6px; }
.view-toggle button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.view-toggle button[aria-pressed="true"] { border-color: var(--store-text); color: var(--ink); }
.shop-main .books-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.books-grid.is-list .book-card { flex-direction: row; gap: 24px; align-items: center; padding-block: 20px; border-bottom: 1px solid var(--line); }
.books-grid.is-list .book-media { width: 120px; flex-shrink: 0; }
.books-grid.is-list .book-body { padding-top: 0; text-align: start; align-items: flex-start; }
.books-grid.is-list .price-row { margin-top: 8px; }
.books-grid.is-list .card-add { align-self: flex-start; padding-inline: 30px; }

.posts-section.is-related { background: var(--soft); }
.is-related .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 880px; margin-inline: auto; }
/* استجابة الأقسام الجديدة */
@media (max-width: 1199px) {
  .cat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 32px; }
  .books-carousel .carousel-track { grid-auto-columns: calc((100% - 2 * 24px) / 3); gap: 24px; }
  .deal-box .books-grid.deal-grid { --per-row: 2 !important; }
}
@media (max-width: 991px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posts-grid > :nth-child(3):last-child { display: none; }
  .blog-list .posts-grid > :nth-child(3):last-child { display: flex; }
  .post-card.is-lead { grid-template-columns: 1fr; }
  .post-card.is-lead .post-body { padding: 24px; }
  .deal-box { padding: 28px; }
}
@media (max-width: 767px) {
  .row-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: -8px calc(var(--gutter) * -1) 24px; padding-inline: var(--gutter); }
  .row-tabs::-webkit-scrollbar { display: none; }
  .row-tab { flex-shrink: 0; min-height: 40px; padding: 0 16px; }
  .cat-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 16px; margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter); }
  .cat-row::-webkit-scrollbar { display: none; }
  .cat-tile { flex: 0 0 104px; scroll-snap-align: start; }
  .cat-tile b { font-size: 14px; }
  .cat-tile small { font-size: 12px; }
  .deal-box { padding: 20px 14px; }
  .deal-box::before { inset: 5px; }
  .deal-head { margin-bottom: 24px; }
  .countdown { gap: 8px; }
  .cd-unit { min-width: 54px; }
  .cd-unit b { font-size: 19px; }
  .section-head.is-split { align-items: center; }
  .section-head.is-split .section-desc { display: none; }
  .books-carousel .carousel-track { grid-auto-columns: calc((100% - 14px) / 2.15); gap: 14px; }
  .bundles-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .bundles-grid::-webkit-scrollbar { display: none; }
  .bundle-card { flex: 0 0 82%; scroll-snap-align: start; }
  .bundle-covers { padding: 24px 16px 18px; }
  .posts-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .posts-grid::-webkit-scrollbar { display: none; }
  .posts-grid > * { flex: 0 0 84%; scroll-snap-align: start; }
  .posts-grid > :nth-child(3):last-child { display: flex; }
  .blog-list .posts-grid { display: grid; grid-template-columns: minmax(0, 1fr); margin-inline: 0; padding-inline: 0; }
  .post-body { padding: 18px 18px 20px; }
  .post-title { font-size: 17px; }
  .post-card.is-lead .post-title { font-size: 22px; }
  .article { padding-block: 28px 48px; }
  .article-body { font-size: 16px; margin-top: 24px; }
  .format-opt { min-width: 0; flex: 1 1 40%; }
  .view-toggle { display: none; }
  .banners > .banner, .banners > .banner:only-child { aspect-ratio: auto; display: flex; flex-direction: column; background: var(--store-accent); }
  .banner > img { position: static; height: auto; aspect-ratio: 16 / 9; }
  .banner-body { max-width: none; padding: 18px 20px 22px; }
}

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