/* ============================================================
   قالب «زعفران» (zafaran) — منصّة ناشر
   طابعٌ دافئ ترابيّ: خلفيّةٌ كريميّة، وأحمر بابريكا، ووسومٌ زعفرانيّة،
   وعناوين ثقيلة. كلّ التنسيق هنا، بلا مكتبات.
   ============================================================ */

:root {
  /* ألوان الهويّة (قيم تجريبيّة) */
  --store-primary: #A63D24;
  --store-primary-dark: #6E2A18;
  --store-accent: #E9A23B;
  --store-bg: #FBF6EE;
  --store-text: #2A1C14;

  /* ألوان محايدة */
  --white: #FFFFFF;
  --sand: #F3E9DA;
  --muted: #6E5D50;
  --line: #E8DCCB;
  --line-strong: #D6C5AE;
  --gold: #D99000;
  --ok: #3F7A2E;
  --on-dark-muted: #CDBBA8;

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

  --container: 1320px;
  --gutter: 16px;
  --radius: 14px;
  --radius-sm: 8px;
  --pill: 999px;
  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --shadow: 0 10px 30px rgba(42,28,20,.08);
}

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

/* ---------- أساسيّات ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 160px; }
body { margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.7; color: var(--store-text); background: var(--store-bg); overflow-x: clip; }
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.3; font-weight: 800; }
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.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ---------- الشريط العلويّ ---------- */
.topbar { background: var(--store-primary); color: var(--white); font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar-info { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar-info > span { display: inline-flex; align-items: center; gap: 6px; }
.topbar-links { display: flex; gap: 18px; }
.topbar-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- الرأس ---------- */
/* الرأس ثابتٌ أعلى الشاشة (صفّ الشعار وشريط التصنيفات معًا)؛ الشريط العلويّ يمرّ */
.site-header { background: var(--store-bg); position: sticky; top: 0; z-index: 40; }
.header-main .container { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; min-height: 90px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 50px; height: 50px; }
.brand > span { display: flex; flex-direction: column; }
.brand-name { font-size: 23px; font-weight: 800; line-height: 1.1; color: var(--store-primary-dark); }
.brand-tag { font-size: 12px; color: var(--muted); }
.search-bar { display: flex; align-items: stretch; height: 52px; max-width: 700px; width: 100%; justify-self: center; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--pill); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.search-bar:focus-within { border-color: var(--store-primary); box-shadow: 0 0 0 4px rgba(166,61,36,.1); }
.search-cat { position: relative; flex-shrink: 0; border-inline-end: 1px solid var(--line); }
.search-cat select { appearance: none; -webkit-appearance: none; height: 100%; border: 0; background: transparent; padding: 0 20px 0 34px; font-size: 14px; font-weight: 700; cursor: pointer; outline: none; color: var(--store-primary-dark); }
.search-cat svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.search-bar input { flex: 1; min-width: 0; border: 0; padding: 0 18px; outline: none; background: transparent; }
.search-bar .btn { border-radius: var(--pill); margin: 5px; min-height: 0; padding-inline: 20px; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.header-tools { display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--sand); color: var(--store-primary); }
.badge-count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 19px; height: 19px; padding-inline: 4px; border-radius: 10px; background: var(--store-accent); color: var(--store-text); font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; }
.cart-pill { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: var(--pill); background: var(--store-primary); color: var(--white); font-weight: 800; transition: background .2s; }
.cart-pill:hover { background: var(--store-primary-dark); }
.cart-pill .cart-ico { position: relative; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.16); display: inline-flex; align-items: center; justify-content: center; }
.cart-pill .badge-count { top: -5px; inset-inline-end: -5px; }
.menu-toggle { display: none; }

.nav-bar { background: var(--white); border-block: 1px solid var(--line); position: relative; z-index: 35; transition: box-shadow .3s; }
.nav-bar.is-scrolled { box-shadow: 0 8px 22px rgba(42,28,20,.08); }
.nav-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 54px; }
.cat-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { position: relative; padding: 14px 14px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: color .2s; }
.cat-nav a::after { content: ""; position: absolute; inset-inline: 14px; bottom: 8px; height: 2px; background: var(--store-accent); transform: scaleX(0); transition: transform .25s var(--ease); }
.cat-nav a:hover, .cat-nav a[aria-current="page"] { color: var(--store-primary); }
.cat-nav a:hover::after, .cat-nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-offers { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--pill); background: var(--store-accent); color: var(--store-text); font-weight: 800; font-size: 14px; white-space: nowrap; }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(42,28,20,.5); 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: 14px 16px; background: var(--store-primary); color: var(--white); }
.drawer-head .brand-name { color: var(--white); font-size: 19px; }
.drawer-head .brand img { width: 38px; height: 38px; }
.drawer-head .icon-btn:hover { background: rgba(255,255,255,.15); color: var(--white); }
.drawer-title { padding: 16px 18px 6px; font-size: 13px; font-weight: 800; color: var(--store-primary); }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer-nav a:hover { background: var(--sand); }
.drawer-nav img { width: 34px; height: 34px; border-radius: var(--radius-sm); object-fit: cover; }
.drawer-foot { margin-top: auto; padding: 16px 18px; display: grid; gap: 10px; font-size: 14px; background: var(--sand); }
.drawer-foot span { display: inline-flex; gap: 8px; align-items: center; }
.bottom-nav { display: none; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; font-weight: 800; font-size: 15px; border: 2px solid transparent; border-radius: var(--pill); transition: background .2s, color .2s, border-color .2s; white-space: nowrap; }
.btn-primary { background: var(--store-primary); color: var(--white); }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-dark { background: var(--store-text); color: var(--white); }
.btn-dark:hover { background: var(--store-primary); }
.btn-saffron { background: var(--store-accent); color: var(--store-text); }
.btn-saffron:hover { background: var(--store-text); color: var(--white); }
.btn-outline { border-color: var(--store-primary); color: var(--store-primary); background: transparent; }
.btn-outline:hover { background: var(--store-primary); color: var(--white); }
.btn-light { background: var(--white); color: var(--store-primary-dark); }
.btn-light:hover { background: var(--store-accent); color: var(--store-text); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { background: var(--sand); color: var(--muted); border-color: var(--sand); cursor: not-allowed; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14.5px; color: var(--store-primary); white-space: nowrap; border-bottom: 2px solid var(--store-accent); padding-bottom: 2px; transition: gap .2s; }
.link-more:hover { gap: 10px; }

/* ---------- عنوان القسم ---------- */
.section { padding-block: 60px; }
.section.is-sand { background: var(--sand); }
.section.is-white { background: var(--white); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-kicker { display: block; font-size: 14px; font-weight: 800; color: var(--store-primary); margin-bottom: 4px; }
.section-title { font-size: 32px; letter-spacing: -.3px; }
.section-desc { color: var(--muted); margin-top: 6px; max-width: 560px; }

/* ---------- التقييم والسعر ---------- */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; }
.stars svg { width: 14px; height: 14px; }
.stars .on { fill: var(--gold); }
.stars .off { fill: #E2D6C6; }
.stars .half { fill: url(#half-gold); }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-now { font-weight: 800; font-size: 18px; color: var(--store-text); }
.price-old { font-size: 13px; 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: 22px; }
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; background: var(--white); border-radius: var(--radius); padding: 12px 12px 16px; transition: box-shadow .3s; }
.book-card:hover { box-shadow: var(--shadow); }
.book-media { position: relative; aspect-ratio: 2 / 3; background: var(--sand); border-radius: calc(var(--radius) - 4px); overflow: hidden; }
.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; bottom: 10px; inset-inline-end: 10px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--white); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.type-dot svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; 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: 10px; inset-inline-start: 10px; z-index: 2; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 800; line-height: 1.7; }
.badge-sale { background: var(--store-primary); color: var(--white); }
.badge-new { background: var(--store-accent); color: var(--store-text); }
.stock-out { position: absolute; inset-inline: 0; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(42,28,20,.88); color: var(--white); text-align: center; font-size: 13px; font-weight: 800; padding: 7px 0; }
.book-card.is-out .book-media > a > img { filter: grayscale(.7); opacity: .7; }
/* المفضّلة والنظرة السريعة تطفوان فوق الغلاف ولا تحجزان مكانًا (البند 7) */
.card-tools { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.wish-btn, .qv-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--white); color: var(--store-text); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: color .2s, transform .2s, opacity .25s; }
.wish-btn::after, .qv-btn::after { content: ""; position: absolute; inset: -4px; }
.wish-btn:hover, .qv-btn:hover { transform: scale(1.08); }
.wish-btn:hover, .wish-btn.is-active, .qv-btn:hover { color: var(--store-primary); }
@media (hover: hover) {
  .qv-btn { opacity: 0; transform: translateY(-4px); }
  .book-card:hover .qv-btn, .book-card:focus-within .qv-btn { opacity: 1; transform: none; }
}
.wish-btn.is-active svg { fill: currentColor; }
.book-body { display: flex; flex-direction: column; gap: 3px; padding-top: 12px; flex: 1; }
.book-author { font-size: 12.5px; color: var(--muted); }
.book-author:hover { color: var(--store-primary); }
.book-title { font-size: 16px; font-weight: 800; line-height: 1.4; }
.book-title a:hover { color: var(--store-primary); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; margin-top: auto; }
.card-foot .price { flex-direction: column; gap: 0; align-items: flex-start; }
.add-btn { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: var(--sand); color: var(--store-primary); display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.add-btn:hover { background: var(--store-primary); color: var(--white); }
.add-btn:disabled { background: var(--sand); color: var(--line-strong); cursor: not-allowed; }
body[data-card-style="framed"] .book-card { border: 1px solid var(--line-strong); }
body[data-card-style="framed"] .book-card:hover { border-color: var(--store-primary); box-shadow: none; }
body[data-card-style="minimal"] .book-card { background: transparent; padding: 0; }
body[data-card-style="minimal"] .book-card:hover { box-shadow: 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; border-radius: var(--pill); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--white); border: 1px solid var(--line); transition: border-color .2s, color .2s; }
.pagination a:hover { border-color: var(--store-primary); color: var(--store-primary); }
.pagination .is-current { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
.pagination .gap { background: transparent; border: 0; min-width: 18px; color: var(--muted); }

/* ---------- الاشتراك ---------- */
.newsletter { background: var(--store-text); color: var(--white); position: relative; overflow: hidden; }
.newsletter::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(233,162,59,.12); inset-inline-end: -140px; top: -180px; }
.newsletter .container { position: relative; display: grid; grid-template-columns: 1fr minmax(320px, 500px); gap: 28px; align-items: center; padding-block: 50px; }
.newsletter small { color: var(--store-accent); font-weight: 800; font-size: 14px; }
.newsletter h2 { font-size: 30px; margin-top: 4px; }
.newsletter p { color: var(--on-dark-muted); margin-top: 6px; }
.newsletter-form { display: flex; align-items: center; height: 58px; padding-inline: 20px 5px; background: var(--white); border-radius: var(--pill); }
.newsletter-form input { flex: 1; min-width: 0; border: 0; outline: none; color: var(--store-text); background: transparent; }
.newsletter-form .btn { min-height: 48px; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--sand); font-size: 14.5px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; padding-block: 56px 40px; }
.footer-brand p { margin-top: 16px; max-width: 340px; color: var(--muted); }
.social { display: flex; gap: 8px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 50%; background: var(--white); color: var(--store-primary); display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.social a:hover { background: var(--store-primary); color: var(--white); }
.footer-col h4 { font-size: 17px; margin-bottom: 16px; color: var(--store-primary-dark); }
.footer-col li + li { margin-top: 9px; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--store-primary); }
.footer-contact li { display: flex; gap: 10px; color: var(--muted); }
.footer-contact svg { color: var(--store-primary); margin-top: 3px; }
.footer-bottom { border-top: 1px solid var(--line-strong); }
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

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

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

/* ---------- البطل ---------- */
.hero { padding-top: 24px; }
.hero-box { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 10px); background: var(--sand); }
.hero-track { position: relative; height: clamp(420px, 42vw, 580px); }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s, 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; max-width: 600px; padding-inline: 60px; }
.hero-kicker { display: inline-flex; padding: 4px 14px; border-radius: var(--pill); background: var(--store-accent); color: var(--store-text); font-weight: 800; font-size: 13px; }
.hero-title { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.12; margin-top: 16px; letter-spacing: -.5px; }
.hero-title em { font-style: normal; color: var(--store-primary); }
.hero-text { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 460px; }
.hero-caption .btn { margin-top: 26px; }
.hero-dots { position: absolute; bottom: 22px; inset-inline-start: 60px; z-index: 2; display: flex; gap: 8px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 5px; background: rgba(166,61,36,.25); transition: width .3s, background .3s; }
.hero-dots button[aria-current="true"] { width: 30px; background: var(--store-primary); }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.quick { display: flex; align-items: center; gap: 16px; padding: 18px 22px; background: var(--white); border-radius: var(--radius); transition: box-shadow .25s, transform .25s var(--ease); }
.quick:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.quick-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--sand); color: var(--store-primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s, color .2s; }
.quick:hover .quick-icon { background: var(--store-primary); color: var(--white); }
.quick b { display: block; font-size: 17px; }
.quick small { color: var(--muted); font-size: 13.5px; }
.quick .chev { margin-inline-start: auto; color: var(--store-primary); }

/* ---------- شريط الثقة ---------- */
.trust-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border: 2px dashed var(--store-accent); border-radius: var(--radius); }
.trust-item { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 16px; font-size: 14.5px; font-weight: 800; text-align: start; }
.trust-item + .trust-item { border-inline-start: 1px solid var(--line-strong); }
.trust-item svg { color: var(--store-primary); }

/* ---------- التصنيفات ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cat-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); transition: transform .4s var(--ease), box-shadow .3s; }
.cat-tile:hover img { transform: translateY(-4px) rotate(-2deg); box-shadow: var(--shadow); }
.cat-tile b { font-size: 15px; }
.cat-tile:hover b { color: var(--store-primary); }

/* ---------- الدوّار (المؤلّفون) ---------- */
.carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 20px) / 5); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 6px; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { scroll-snap-align: start; }
.carousel-btns { display: flex; gap: 8px; }
.carousel-btns button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--white); display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s, border-color .2s; }
.carousel-btns button:hover { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
.head-end { display: flex; align-items: center; gap: 16px; }
.portrait { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--sand); }
.portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.portrait:hover img { transform: scale(1.05); }
.portrait-tag { position: absolute; top: 14px; inset-inline-start: 14px; padding: 3px 12px; border-radius: var(--pill); background: var(--store-accent); color: var(--store-text); font-size: 12.5px; font-weight: 800; }
.portrait-body { position: absolute; inset-inline: 0; bottom: 0; padding: 50px 16px 16px; background: linear-gradient(to top, rgba(42,28,20,.9), rgba(42,28,20,0)); color: var(--white); }
.portrait-body h3 { font-size: 18px; }
.portrait-body span { font-size: 13px; color: #EAD9BF; }

/* ---------- المقدّمة والتبويبات ---------- */
.intro-tabs { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: stretch; }
.intro { display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; padding: 30px 26px 0; border-radius: var(--radius); background: var(--store-primary); color: var(--white); }
.intro-img { flex: 1 1 200px; height: 0; min-height: 200px; width: calc(100% + 52px); max-width: none; margin: 26px -26px 0; object-fit: cover; object-position: center bottom; }
.intro .section-kicker { color: #F6DCC8; }
.intro h2 { font-size: 28px; }
.intro p { color: #F6DCC8; margin-top: 10px; }
.intro .btn { margin-top: 22px; }
.tabs-nav { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav button { position: relative; padding: 10px 16px 14px; font-weight: 800; font-size: 16px; color: var(--muted); white-space: nowrap; }
.tabs-nav button::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 3px; background: var(--store-primary); transform: scaleX(0); transition: transform .25s var(--ease); }
.tabs-nav button[aria-selected="true"] { color: var(--store-text); }
.tabs-nav button[aria-selected="true"]::after { transform: scaleX(1); }
.intro-tabs .books-grid { --per-row: 3 !important; }

/* ---------- الآراء ---------- */
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.review-card { background: var(--white); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; margin: 0; border-top: 4px solid var(--store-accent); }
.review-card blockquote { margin: 0; flex: 1; font-size: 16px; line-height: 1.9; }
.review-person { display: flex; align-items: center; gap: 12px; }
.review-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--store-primary); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.review-name { display: block; font-weight: 800; }
.review-book { font-size: 12.5px; color: var(--muted); }

/* ---------- رأس الصفحة الداخليّة ---------- */
.page-head { padding-block: 34px 10px; }
.page-head h1 { font-size: 36px; letter-spacing: -.3px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--store-primary); }
.breadcrumb .sep { opacity: .5; }

/* ---------- التصنيف ---------- */
.cat-strip { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-block: 16px 6px; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip a { flex-shrink: 0; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13.5px; font-weight: 700; }
.cat-strip img { width: 84px; height: 84px; object-fit: cover; border-radius: 50%; border: 3px solid transparent; transition: border-color .2s; }
.cat-strip a:hover img, .cat-strip a[aria-current="true"] img { border-color: var(--store-primary); }
.cat-strip a[aria-current="true"] { color: var(--store-primary); }
.shop-layout { display: grid; grid-template-columns: 270px 1fr; gap: 32px; padding-block: 24px 64px; align-items: start; }
.shop-layout > * { min-width: 0; }
.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 { position: sticky; top: 160px; }
.filters-toggle { display: none; }
.filters-body { background: var(--white); border-radius: var(--radius); padding: 6px 20px 20px; }
.filter-block { padding-block: 16px; border-bottom: 1px solid var(--line); }
.filter-block:last-of-type { border-bottom: 0; }
.filter-block h3 { font-size: 16px; margin-bottom: 12px; }
.filter-list li + li { margin-top: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--store-primary); }
.check .num { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.check .type-dot { position: static; width: 22px; height: 22px; box-shadow: none; }
.check .type-dot svg { width: 12px; height: 12px; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { width: 100%; min-width: 0; border: 1px solid var(--line-strong); padding: 9px 12px; border-radius: var(--radius-sm); background: var(--store-bg); }
.filters-actions { display: flex; gap: 8px; margin-top: 10px; }
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--white); padding: 8px 16px 8px 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='%236E5D50' stroke-width='2.4'%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: 8px; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: var(--pill); background: var(--white); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700; }
.chip:hover { border-color: var(--store-primary); color: var(--store-primary); }
.shop-layout .pagination { margin-top: 40px; }

/* ---------- صفحة الكتاب ---------- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-block: 16px 48px; align-items: start; }
.product > * { min-width: 0; }
.gallery { position: sticky; top: 160px; }
.gallery-main { position: relative; background: var(--sand); border-radius: calc(var(--radius) + 6px); padding: 44px; }
.gallery-main img { width: 100%; max-width: 380px; margin-inline: auto; aspect-ratio: 2/3; object-fit: cover; box-shadow: 0 24px 50px rgba(42,28,20,.22); }
.gallery-main .type-dot { width: 42px; height: 42px; bottom: auto; 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; justify-content: center; gap: 12px; margin-top: 14px; }
.gallery-thumbs button { width: 74px; border: 2px solid transparent; border-radius: var(--radius-sm); padding: 3px; background: var(--white); transition: border-color .2s; }
.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; border-radius: 4px; }
.type-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: var(--store-primary); }
.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, 3.2vw, 42px); line-height: 1.2; margin-top: 10px; letter-spacing: -.3px; }
.product-meta { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin-top: 12px; font-size: 14.5px; color: var(--muted); }
.product-meta a { color: var(--store-primary); font-weight: 800; }
.product-meta .sep { width: 5px; height: 5px; border-radius: 50%; background: var(--store-accent); }
.price-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding-block: 18px; border-block: 1px dashed var(--line-strong); }
.price-box .price-now { font-size: 34px; }
.price-box .price-old { font-size: 18px; }
.save-tag { padding: 3px 12px; border-radius: var(--pill); background: var(--store-accent); color: var(--store-text); font-size: 13px; font-weight: 800; }
.product-excerpt { margin-top: 18px; color: var(--muted); font-size: 16px; }
.stock-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; font-weight: 800; color: var(--ok); }
.stock-line::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.buy-row .btn { flex: 1; min-width: 160px; min-height: 54px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--pill); height: 54px; background: var(--white); padding-inline: 4px; }
.qty button { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--store-primary); }
.qty button:hover { background: var(--sand); }
.qty input { width: 40px; height: 100%; border: 0; text-align: center; font-weight: 800; background: transparent; outline: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wish-inline { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--white); display: inline-flex; align-items: center; justify-content: center; color: var(--store-primary); }
.wish-inline:hover, .wish-inline.is-active { border-color: var(--store-primary); }
.wish-inline.is-active svg { fill: currentColor; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.fact { padding: 14px; border-radius: var(--radius-sm); background: var(--white); text-align: center; }
.fact svg { color: var(--store-primary); margin: 0 auto 6px; }
.fact > span { display: block; font-size: 12px; color: var(--muted); }
.fact b { font-size: 14px; }
.accordion { margin-top: 24px; border-top: 1px solid var(--line-strong); }
.accordion details { border-bottom: 1px solid var(--line-strong); }
.accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 2px; font-size: 17px; font-weight: 800; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .acc-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--sand); color: var(--store-primary); display: inline-flex; align-items: center; justify-content: center; transition: transform .25s, background .2s, color .2s; }
.accordion details[open] summary .acc-icon { transform: rotate(45deg); background: var(--store-primary); color: var(--white); }
.acc-body { padding: 0 2px 22px; color: var(--store-text); }
.acc-body > p { line-height: 1.95; }
.acc-body > p + p { margin-top: 10px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec-table th, .spec-table td { text-align: start; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.spec-table th { width: 38%; color: var(--muted); font-weight: 700; }
.review-summary { display: flex; align-items: center; gap: 18px; padding: 16px; background: var(--white); border-radius: var(--radius-sm); }
.review-summary b { font-size: 40px; line-height: 1; color: var(--store-primary); }
.review-summary p { font-size: 13px; color: var(--muted); }
.review-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding-block: 16px; border-bottom: 1px dashed var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-item .review-avatar { width: 42px; height: 42px; font-size: 16px; }
.review-item header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.review-item time { font-size: 12px; color: var(--muted); }

/* ---------- المؤلّف ---------- */
.author-layout { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: center; padding-block: 20px 20px; }
.author-layout .portrait { aspect-ratio: 4 / 5; }
.author-layout small { color: var(--store-primary); font-weight: 800; font-size: 14px; }
.author-layout h1 { font-size: 40px; margin: 4px 0 14px; letter-spacing: -.3px; }
.author-bio { color: var(--muted); font-size: 16.5px; line-height: 1.95; max-width: 660px; }
.author-stats { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.author-stats div { padding: 12px 22px; border-radius: var(--radius-sm); background: var(--white); text-align: center; }
.author-stats b { display: block; font-size: 24px; color: var(--store-primary); line-height: 1.2; }
.author-stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- السلّة ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 370px; gap: 32px; padding-block: 24px 64px; align-items: start; }
.cart-layout > * { min-width: 0; }
.free-ship { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px 18px; border: 2px dashed var(--store-accent); border-radius: var(--radius); font-size: 14.5px; }
.free-ship > svg { color: var(--store-primary); }
.free-ship > div { flex: 1; }
.free-ship b { color: var(--store-primary); }
.free-ship i { display: block; height: 6px; margin-top: 8px; background: var(--sand); border-radius: 3px; overflow: hidden; }
.free-ship i::before { content: ""; display: block; height: 100%; width: var(--w, 0%); background: var(--store-primary); }
.cart-list { background: var(--white); border-radius: var(--radius); padding: 6px 22px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table thead th { text-align: start; font-size: 13px; color: var(--muted); font-weight: 700; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.cart-table td { padding: 18px 10px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: 0; }
.cart-product { display: flex; align-items: center; gap: 14px; }
.cart-product img { width: 72px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-product h3 { font-size: 16px; margin-top: 2px; }
.cart-product h3 a:hover { color: var(--store-primary); }
.cart-table .qty { height: 44px; }
.cart-table .qty button { width: 34px; height: 34px; }
.remove-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.remove-btn:hover { background: var(--sand); color: var(--store-primary); }
.cart-foot { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.coupon { display: flex; align-items: center; height: 50px; padding-inline: 18px 5px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: var(--white); }
.coupon input { border: 0; min-width: 0; width: 100%; outline: none; background: transparent; }
.coupon .btn { min-height: 40px; }
.applied-coupon { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.summary { background: var(--store-text); color: var(--white); border-radius: var(--radius); padding: 26px; position: sticky; top: 160px; }
.summary h2 { font-size: 20px; margin-bottom: 8px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding-block: 11px; font-size: 14.5px; border-bottom: 1px dashed rgba(255,255,255,.15); }
.summary-row span:first-child { color: var(--on-dark-muted); }
.summary-row.discount span:last-child { color: var(--store-accent); font-weight: 800; }
.summary-row.total { border-bottom: 0; padding-top: 16px; font-size: 20px; font-weight: 800; }
.summary-row.total span:first-child { color: var(--white); }
.summary .btn { margin-top: 14px; min-height: 54px; }
.summary-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--on-dark-muted); }

/* ---------- 404 ---------- */
.notfound { padding-block: 64px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.notfound-code { font-size: clamp(120px, 16vw, 220px); font-weight: 800; line-height: .9; color: var(--store-primary); letter-spacing: -6px; text-align: center; }
.notfound-code span { color: var(--store-accent); }
.notfound h1 { font-size: 34px; }
.notfound p { color: var(--muted); margin-top: 10px; max-width: 460px; }
.notfound .search-bar { margin-top: 24px; justify-self: start; }
.notfound-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ============================================================
   الاستجابة
   ============================================================ */
@media (max-width: 1279px) {
  .header-main .container { gap: 22px; }
  .cart-pill .cart-total { display: none; }
  .cart-pill { padding: 4px; }
  .books-grid { --per-row: 3 !important; }
  .cat-tiles { grid-template-columns: repeat(4, 1fr); row-gap: 22px; }
  .carousel-track { grid-auto-columns: calc((100% - 3 * 20px) / 4); }
  .intro-tabs { grid-template-columns: 250px 1fr; gap: 28px; }
  .intro-tabs .books-grid { --per-row: 2 !important; }
  .shop-layout .books-grid { --per-row: 2 !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 991px) {
  .topbar-links { display: none; }
  /* الهاتف واللوح: القائمة والشعار يمينًا، والسلّة يسارًا، والبحث تحتها */
  .header-main .container { grid-template-columns: auto 1fr auto; min-height: 70px; gap: 8px; }
  .menu-toggle { display: inline-flex; grid-column: 1; grid-row: 1; justify-self: start; }
  .brand { grid-column: 2; grid-row: 1; justify-self: start; }
  .brand img { width: 40px; height: 40px; }
  .brand-tag { display: none; }
  .brand-name { font-size: 20px; }
  .header-actions { display: contents; }
  .header-tools { grid-column: 3; grid-row: 1; justify-self: end; }
  .header-wish, .header-account { display: none; }
  .search-bar { grid-column: 1 / -1; grid-row: 2; max-width: none; margin-bottom: 12px; height: 48px; }
  .search-cat { display: none; }
  .nav-bar { display: none; }
  .site-header { box-shadow: 0 4px 14px rgba(42,28,20,.06); }
  .quick-links { gap: 10px; }
  .quick { padding: 12px 14px; gap: 10px; }
  .quick small, .quick .chev { display: none; }
  .quick-icon { width: 40px; height: 40px; }
  .quick b { font-size: 15px; }
  .trust-strip { 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-strong); }
  /* البطل: الصورة فوق النصّ لا خلفه */
  .hero-track { height: auto; display: grid; }
  .hero-slide { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; }
  .hero-slide > img { position: relative; inset: auto; height: 280px; object-position: 12% center; }
  .hero-caption { height: auto; max-width: none; padding: 24px 36px 58px; justify-content: flex-start; }
  .hero-dots { inset-inline-start: 36px; }
  .intro-tabs { grid-template-columns: 1fr; }
  .intro { padding-bottom: 26px; }
  .intro-img { display: none; }
  .intro-tabs .books-grid { --per-row: 3 !important; }
  .reviews-grid { grid-template-columns: 1fr; }
  .newsletter .container { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters-toggle { display: inline-flex; }
  .filters-body { display: none; margin-top: 12px; }
  .filters.is-open .filters-body { display: block; }
  .shop-layout .books-grid { --per-row: 3 !important; }
  .product { grid-template-columns: 1fr; gap: 28px; }
  .gallery { position: static; }
  .author-layout { grid-template-columns: 240px 1fr; gap: 28px; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .notfound { grid-template-columns: 1fr; text-align: center; gap: 12px; }
  .notfound p { margin-inline: auto; }
  .notfound .search-bar { justify-self: center; }
  .notfound-links { justify-content: center; }
}

@media (max-width: 767px) {
  body { padding-bottom: 64px; }
  .topbar-info > span:nth-child(n+2) { display: none; }
  .topbar .container { justify-content: center; }
  .section { padding-block: 44px; }
  .section-title { font-size: 24px; }
  .section-head { align-items: center; }
  .section-desc { display: none; }
  .hero { padding-top: 12px; }
  .hero-slide > img { height: 200px; }
  .hero-caption { padding: 18px 20px 50px; }
  .hero-title { margin-top: 10px; }
  .hero-text { font-size: 15px; margin-top: 8px; }
  .hero-caption .btn { margin-top: 16px; min-height: 44px; }
  .hero-dots { inset-inline-start: 20px; bottom: 22px; }
  /* الروابط السريعة وشريط الثقة: صفٌّ واحد يُمرَّر */
  .quick-links { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin-top: 12px; gap: 8px; }
  .quick-links::-webkit-scrollbar, .trust-strip::-webkit-scrollbar { display: none; }
  .quick { flex: 0 0 auto; scroll-snap-align: start; padding: 8px 14px 8px 10px; }
  .quick-icon { width: 36px; height: 36px; }
  .quick-icon .icon-lg { width: 20px; height: 20px; }
  .trust-strip { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin-top: 10px; }
  .trust-item { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; padding: 10px 14px; font-size: 13.5px; border-top: 0 !important; }
  .trust-item:nth-child(3) { border-inline-start: 1px solid var(--line-strong); }
  .cat-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 10px; padding-bottom: 4px; }
  .cat-tiles::-webkit-scrollbar { display: none; }
  .cat-tile { flex: 0 0 84px; scroll-snap-align: start; }
  .cat-tile b { font-size: 13px; }
  .books-grid { --per-row: 2 !important; gap: 12px; }
  .book-card { padding: 8px 8px 12px; }
  .book-title { font-size: 14.5px; }
  .price-now { font-size: 16px; }
  .add-btn { width: 40px; height: 40px; }
  .type-dot { width: 28px; height: 28px; bottom: 8px; inset-inline-end: 8px; }
  .type-dot svg { width: 14px; height: 14px; }
  .card-tools { top: 8px; inset-inline-end: 8px; }
  .wish-btn, .qv-btn { width: 34px; height: 34px; }
  .badges { top: 8px; inset-inline-start: 8px; }
  .carousel-track { grid-auto-columns: 62%; gap: 12px; }
  .carousel-btns { display: none; }
  .intro { padding: 24px 20px; }
  .intro h2 { font-size: 22px; }
  .intro-tabs .books-grid { --per-row: 2 !important; }
  .tabs-nav button { font-size: 15px; padding-inline: 12px; }
  .newsletter h2 { font-size: 23px; }
  .newsletter-form { height: auto; flex-direction: column; background: transparent; padding: 0; gap: 10px; }
  .newsletter-form input { flex: none; width: 100%; height: 50px; padding-inline: 18px; border-radius: var(--pill); background: var(--white); }
  .newsletter-form .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-block: 40px 28px; }
  .footer-bottom .container { justify-content: center; text-align: center; padding-block: 12px; }
  .page-head h1 { font-size: 26px; }
  .shop-layout .books-grid { --per-row: 2 !important; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-sort .select { flex: 1; }
  .gallery-main { padding: 26px; }
  .gallery-main img { max-width: 230px; }
  .buy-row .btn { min-width: 0; }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .fact { padding: 10px 6px; }
  .author-layout { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .author-layout .portrait { width: 220px; }
  .author-layout h1 { font-size: 28px; }
  .author-stats { justify-content: center; }
  .cart-list { padding: 4px 14px; }
  .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: 16px; border-bottom: 1px dashed var(--line); }
  .cart-table tr:last-child { border-bottom: 0; }
  .cart-table td { padding: 0; border: 0; }
  .cart-table td.cell-product { grid-column: 1 / -1; padding-inline-end: 40px; }
  .cart-table td.cell-price { display: none; }
  .cart-table td.cell-total { align-self: center; }
  .cart-table td.cell-remove { position: absolute; top: 12px; inset-inline-end: 0; }
  .cart-foot { flex-direction: column; }
  .cart-foot > div { width: 100%; }
  .notfound { padding-block: 40px 32px; }
  .notfound h1 { font-size: 26px; }

  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 60; height: 64px; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(42,28,20,.06); }
  .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); font-weight: 800; }
  .bottom-nav .badge-count { top: 7px; inset-inline-end: auto; inset-inline-start: calc(50% + 2px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
.hero-dots[hidden] { display: none; }
.fact > svg { display: block; }

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

/* ============ ميزات المنصّة ============ */
/* العدّاد التنازليّ في شريط «عروض الشهر» */
.countdown { display: flex; gap: 8px; margin-top: 14px; }
.countdown[hidden] { display: none; }
.countdown > span { min-width: 58px; padding: 6px 4px; border-radius: var(--radius-sm); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); text-align: center; line-height: 1.2; }
.countdown b { display: block; font-size: 22px; font-weight: 800; color: var(--store-accent); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 12px; color: var(--on-dark-muted); }

/* الباقات */
.bundle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.bundle { display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius); overflow: hidden; transition: box-shadow .3s; }
.bundle:hover { box-shadow: var(--shadow); }
body[data-card-style="framed"] .bundle { border: 1px solid var(--line-strong); }
.bundle-covers { display: flex; justify-content: center; align-items: center; padding: 22px 14px; background: var(--sand); }
.bundle-covers img { width: 28%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 10px 22px rgba(42,28,20,.22); }
.bundle-covers img + img { margin-inline-start: -6%; }
.bundle-covers img:nth-child(2) { transform: translateY(-8px); position: relative; z-index: 1; }
.bundle-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.bundle-saving { display: inline-block; padding: 2px 10px; border-radius: var(--pill); background: var(--store-accent); color: var(--store-text); font-size: 12.5px; font-weight: 800; }
.bundle-title { font-size: 18px; margin-top: 4px; }
.bundle-desc { color: var(--muted); font-size: 14px; }
.bundle .card-foot { width: 100%; margin-top: auto; }

/* اختيار الصيغة */
.formats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.formats-label { font-weight: 800; font-size: 14px; }
.formats-list { display: flex; flex-wrap: wrap; gap: 8px; }
.format-item { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding: 6px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--white); line-height: 1.35; transition: border-color .2s; }
.format-item span:first-child { font-weight: 800; font-size: 14px; }
.format-item span:last-child { font-size: 13px; color: var(--muted); }
.format-item:hover { border-color: var(--store-primary); }
.format-item[aria-current="page"] { border-color: var(--store-primary); background: var(--sand); }
.card-formats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.card-format-item { display: inline-flex; gap: 4px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--pill); font-size: 12px; line-height: 1.6; color: var(--muted); }
.card-format-item span:first-child { font-weight: 800; color: var(--store-text); }
.card-format-item:hover, .card-format-item[aria-current="page"] { border-color: var(--store-primary); }
.card-format-item[aria-current="page"] { background: var(--sand); }

/* الخصم حسب الكمّيّة */
.qty-deal { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 800; color: var(--store-primary); }

/* الأسئلة الشائعة */
.faq-list { display: grid; gap: 10px; max-width: 900px; }
.faq-item { background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 800; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .acc-icon { display: inline-grid; place-items: center; flex: none; color: var(--store-primary); transition: transform .2s; }
.faq-item[open] .acc-icon { transform: rotate(45deg); }
.faq-item p { padding: 0 18px 16px; color: var(--muted); font-size: 14.5px; }

@media (max-width: 991px) {
  .bundle-grid { gap: 14px; }
  .bundle-covers { padding: 16px 10px; }
}
@media (max-width: 700px) {
  .bundle-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .bundle { flex: 0 0 82%; scroll-snap-align: start; }
  .countdown > span { min-width: 52px; }
  .countdown b { font-size: 19px; }
}

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

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

/* ============ الإصدار الثاني ============ */
/* «وصل حديثًا»: دوّارٌ أفقيّ بسهمين */
.books-track { grid-auto-columns: calc((100% - 4 * 20px) / 5); align-items: stretch; }
.books-track > .book-card { min-width: 0; }

/* عرض الأسبوع: كتابٌ واحد كبير وعدّادٌ واحد للقسم */
.deal-band { background: var(--store-primary-dark); color: var(--white); position: relative; overflow: hidden; }
.deal-band::before { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; border: 56px solid rgba(233,162,59,.12); inset-inline-start: -150px; bottom: -190px; }
.deal { position: relative; display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 44px; align-items: center; }
.deal-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--pill); background: var(--store-accent); color: var(--store-text); font-size: 13px; font-weight: 800; }
.deal-head .section-title { margin-top: 12px; color: var(--white); }
.deal-sub { margin-top: 6px; color: #F6DCC8; }
.deal-head .countdown { margin-top: 20px; }
.deal-band .countdown > span { background: rgba(0,0,0,.2); border-color: rgba(255,255,255,.14); }
.deal-book { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: center; padding: 22px; border-radius: var(--radius); background: var(--white); color: var(--store-text); }
.deal-media { position: relative; }
.deal-media img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 16px 34px rgba(42,28,20,.25); }
.deal-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.deal-title { font-size: 28px; }
.deal-title a:hover { color: var(--store-primary); }
.deal-desc { width: 100%; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 15px; }
.deal-desc p + p { margin-top: 6px; }
.deal-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; margin-top: 12px; }
.deal-foot .price { margin-inline-end: auto; }
.deal-foot .price-now { font-size: 28px; }
.deal-foot .price-old { font-size: 15px; }
.deal-foot .wish-inline { width: 48px; height: 48px; }

/* المدوّنة */
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius); overflow: hidden; transition: box-shadow .3s; }
.post-card:hover { box-shadow: var(--shadow); }
body[data-card-style="framed"] .post-card { border: 1px solid var(--line-strong); }
.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: 6px; padding: 16px 18px 18px; flex: 1; }
.post-date { font-size: 12.5px; font-weight: 700; color: var(--store-primary); }
.post-title { font-size: 18px; line-height: 1.45; }
.post-title a:hover { color: var(--store-primary); }
.post-excerpt { color: var(--muted); font-size: 14.5px; }
.post-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-size: 14px; font-weight: 800; color: var(--store-primary); }
.posts-grid.is-blog .is-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.posts-grid.is-blog .is-lead .post-media img { height: 100%; }
.posts-grid.is-blog .is-lead .post-body { justify-content: center; padding: 28px 32px; gap: 10px; }
.posts-grid.is-blog .is-lead .post-title { font-size: 28px; }
.posts-grid.is-blog .is-lead .post-more { margin-top: 8px; }
.article { max-width: 800px; padding-block: 8px 56px; }
.article-head { text-align: center; }
.article-title { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.25; margin-top: 8px; letter-spacing: -.3px; }
.article-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-block: 26px 8px; }
.article-body > p { margin-top: 16px; font-size: 17px; line-height: 2; }
.article-body h2 { margin-top: 30px; font-size: 23px; color: var(--store-primary-dark); }
.article-body blockquote { margin: 26px 0; padding: 16px 22px; border-inline-start: 4px solid var(--store-accent); border-radius: var(--radius-sm); background: var(--sand); font-size: 18px; font-weight: 800; line-height: 1.8; }
.article-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 34px; padding-top: 20px; border-top: 1px dashed var(--line-strong); }

/* الأسئلة الشائعة بجانب بطاقة المساعدة */
.faq-wrap { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 48px; align-items: start; }
.faq-side { position: sticky; top: 170px; }
.faq-side .section-head { margin-bottom: 20px; }
.faq-help { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: var(--radius); background: var(--sand); }
.faq-help-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; background: var(--store-primary); color: var(--white); display: inline-flex; align-items: center; justify-content: center; }
.faq-help b { display: block; font-size: 17px; }
.faq-help p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.faq-help-num { display: inline-block; margin-top: 8px; font-weight: 800; color: var(--store-primary-dark); }
.faq-wrap .faq-list { max-width: none; }
.is-white .faq-item { background: var(--store-bg); }

/* صفحات المنتج: التوصيل والدفع في صندوقٍ واحد صغير */
.assure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--white); }
.assure li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45; }
.assure li + li { border-inline-start: 1px solid var(--line); }
.assure svg { color: var(--store-primary); flex-shrink: 0; }
.assure b { display: block; font-size: 14px; }
.assure small { display: block; color: var(--muted); font-size: 13px; }
.facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* التصنيف: شبكة أو قائمة */
.view-toggle { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--white); }
.view-toggle button { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.view-toggle button[aria-pressed="true"] { background: var(--store-primary); color: var(--white); }
.toolbar-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.books-grid.is-list { grid-template-columns: 1fr; gap: 14px; }
.books-grid.is-list .book-card { flex-direction: row; gap: 18px; align-items: stretch; }
.books-grid.is-list .book-media { width: 130px; flex-shrink: 0; }
.books-grid.is-list .book-body { padding-top: 4px; }
.books-grid.is-list .card-foot { justify-content: flex-start; gap: 18px; }

@media (max-width: 1279px) {
  .books-track { grid-auto-columns: calc((100% - 3 * 20px) / 4); }
  .deal { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 991px) {
  .books-track { grid-auto-columns: calc((100% - 2 * 20px) / 3); }
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posts-grid:not(.is-blog) > :nth-child(3) { display: none; }
  .faq-wrap { grid-template-columns: 1fr; gap: 20px; }
  .faq-side { position: static; }
  .assure { grid-template-columns: 1fr; }
  .assure li + li { border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 767px) {
  .books-track { grid-auto-columns: 46%; gap: 12px; }
  .deal-book { grid-template-columns: 112px 1fr; gap: 16px; padding: 14px; align-items: start; }
  .deal-title { font-size: 20px; }
  .deal-desc p + p { display: none; }
  .deal-desc { font-size: 14px; }
  .deal-foot { gap: 6px; }
  .deal-foot .price { width: 100%; }
  .deal-foot .price-now { font-size: 22px; }
  .deal-foot .btn { flex: 1 1 auto; min-height: 44px; padding-inline: 10px; font-size: 14px; }
  .deal-foot .wish-inline { width: 44px; height: 44px; }
  .posts-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding-bottom: 4px; }
  .posts-grid::-webkit-scrollbar { display: none; }
  .posts-grid > .post-card { flex: 0 0 82%; scroll-snap-align: start; }
  .posts-grid:not(.is-blog) > :nth-child(3) { display: flex; }
  .posts-grid.is-blog { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .posts-grid.is-blog .is-lead { display: flex; }
  .posts-grid.is-blog .is-lead .post-body { padding: 16px 18px 18px; }
  .posts-grid.is-blog .is-lead .post-title { font-size: 21px; }
  .article-body > p { font-size: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .books-grid.is-list .book-media { width: 96px; }
  .books-grid.is-list .book-card { gap: 12px; }
  .toolbar-end { width: 100%; }
  .toolbar-end .toolbar-sort { flex: 1; }
}

/* البطل بين 600 و1199: الصورة والنصّ متجاوران، والصورة مقصوصةٌ على المشهد فلا يبقى نصفٌ فارغ */
@media (min-width: 600px) and (max-width: 1199px) {
  .hero-track { height: auto; display: grid; }
  .hero-slide { position: relative; inset: auto; grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .hero-slide > img { position: relative; inset: auto; grid-column: 2; grid-row: 1; width: 100%; height: 100%; min-height: 360px; object-fit: cover; object-position: 6% center; }
  .hero-caption { grid-column: 1; grid-row: 1; height: auto; max-width: none; justify-content: center; padding: 36px 32px 64px; }
  .hero-dots { inset-inline-start: 32px; bottom: 24px; }
}

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