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

:root {
	--store-primary: #CF3425;
	--store-primary-dark: #A3281C;
	--store-accent: #212E47;
	--store-bg: #FFFFFF;
	--store-text: #111827;

	--ink: #111827;          /* التذييل والطبقات الداكنة (محايد) */
	--muted: #4E5561;
	--line: #E4EBF1;
	--soft: #F4F6F9;
	--white: #FFFFFF;
	--gold: #F5B301;
	--on-dark: #FFFFFF;
	--on-dark-muted: rgba(255, 255, 255, .78);

	--type-print: #DB7056;
	--type-ebook: #5675A3;
	--type-audio: #986AB0;
	--type-edu: #3f8f6b;

	--r: 12px;
	--r-lg: 20px;
	--r-sm: 8px;
	--pill: 999px;
	--shadow: 0 6px 24px rgba(17, 24, 39, .08);
	--shadow-lg: 0 18px 40px rgba(17, 24, 39, .14);
	--per-row: 4;
	--container: 1200px;
	--font: "Tajawal", system-ui, sans-serif;
	--tint: color-mix(in srgb, var(--store-primary) 8%, #fff);
}

body[data-corners="sharp"] { --r: 2px; --r-lg: 3px; --r-sm: 2px; --pill: 3px; }
body[data-books-per-row="3"] { --per-row: 3; }
body[data-books-per-row="4"] { --per-row: 4; }
body[data-books-per-row="5"] { --per-row: 5; }
body[data-books-per-row="6"] { --per-row: 6; }

/* ---------- أساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.7;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.container { width: 100%; max-width: calc(var(--container) + 48px); margin-inline: auto; padding-inline: 24px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--store-primary); outline-offset: 2px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }

/* ---------- الأزرار ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 8px 22px; border-radius: var(--pill);
	border: 1.5px solid transparent; font-weight: 700; font-size: 14px; line-height: 1.2;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--store-primary); color: #fff; }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-dark { background: var(--store-accent); color: #fff; }
.btn-dark:hover { background: var(--ink); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--store-text); }
.btn-outline:hover { border-color: var(--store-text); }
.btn-light { background: #fff; color: var(--ink); }
.btn-glass { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); color: #fff; backdrop-filter: blur(8px); }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 10px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { background: #E5E7EB; color: #4B5563; border-color: transparent; cursor: not-allowed; transform: none; }
.btn .icon-arrow { width: 16px; height: 16px; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
	border: 0; background: var(--soft); color: var(--store-text); position: relative; transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--line); }
[data-action="wishlist"][aria-pressed="true"] { color: var(--store-primary); }
[data-action="wishlist"][aria-pressed="true"] .icon { fill: currentColor; }

/* ---------- الرأس الزجاجيّ ---------- */
/* الرأس مثبّت أعلى الشاشة دائمًا */
.masthead { background: var(--ink); padding: 14px 0; position: sticky; top: 0; z-index: 50; transition: background-color .25s; }
.masthead::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 140% at 85% 0%, color-mix(in srgb, var(--store-primary) 35%, transparent), transparent 70%); pointer-events: none; }
/* إن بدأت الصفحة بصورةٍ (الواجهة أو رأس صفحة) طفا الرأس فوقها؛ وإلّا بقي على شريطٍ داكن */
body:has(main > .hero-first:first-child) .masthead { position: fixed; inset-inline: 0; top: 0; background: transparent; }
body:has(main > .hero-first:first-child) .masthead:not(.is-scrolled)::after { display: none; }
/* بعد النزول عن الصورة يعود إليه شريطه الداكن حتّى يُقرأ فوق المحتوى */
body:has(main > .hero-first:first-child) .masthead.is-scrolled { background: var(--ink); }
.site-header {
	position: relative; z-index: 2;
	display: flex; align-items: center; gap: 18px;
	min-height: 64px; padding: 8px 10px 8px 14px;
	border-radius: var(--r-lg);
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .32);
	backdrop-filter: blur(16px) saturate(1.2);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; flex: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.nav-list { display: flex; align-items: center; gap: 4px; margin-inline: auto; }
.nav-list > li { position: relative; }
.nav-list > li > a, .nav-list > li > button {
	display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: var(--pill);
	font-weight: 500; font-size: 14px; background: none; border: 0; color: #fff; transition: background .2s;
}
.nav-list > li > a:hover, .nav-list > li > button:hover { background: rgba(255,255,255,.16); }
.nav-list > li > [aria-current="page"] { background: var(--store-primary); font-weight: 700; }
.nav-list .icon { width: 15px; height: 15px; }
.dropdown {
	position: absolute; top: calc(100% + 12px); inset-inline-start: 0; min-width: 230px;
	background: #fff; color: var(--store-text); border-radius: var(--r); box-shadow: var(--shadow-lg);
	padding: 10px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown, .has-drop.open .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; }
.dropdown a:hover { background: var(--soft); color: var(--store-primary-dark); }
.dropdown a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--store-primary); }
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.site-header .icon-btn { background: rgba(255,255,255,.14); color: #fff; }
.site-header .icon-btn:hover { background: rgba(255,255,255,.26); }
.count {
	position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px;
	border-radius: 10px; background: var(--store-primary); color: #fff; font-size: 11px; font-weight: 700;
	display: grid; place-items: center; line-height: 1;
}
.site-header .account { min-height: 40px; }
.menu-toggle { display: none !important; }
.search-pop {
	position: absolute; top: calc(100% + 10px); inset-inline: 0; display: flex; gap: 8px;
	background: #fff; padding: 8px; border-radius: var(--pill); box-shadow: var(--shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s;
}
.search-open .search-pop { opacity: 1; visibility: visible; transform: none; }
.search-pop input { flex: 1; min-width: 0; border: 0; padding: 0 16px; background: transparent; color: var(--store-text); outline: none; }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.5); opacity: 0; visibility: hidden; transition: .25s; z-index: 90; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(330px, 86vw); background: #fff; z-index: 100;
	transform: translateX(100%); transition: transform .3s; padding: 18px; overflow-y: auto; visibility: hidden;
	display: flex; flex-direction: column; gap: 16px;
}
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-nav a { display: block; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 500; }
.drawer-nav a:hover, .drawer-nav a[aria-current="page"] { background: var(--tint); color: var(--store-primary-dark); }
.drawer-nav .sub { padding-inline-start: 14px; border-inline-start: 2px solid var(--line); margin-inline-start: 12px; }
.drawer-nav .sub a { font-size: 14px; padding: 6px 12px; }
.drawer-search { display: flex; gap: 6px; background: var(--soft); border-radius: var(--pill); padding: 5px; }
.drawer-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; outline: none; }

/* ---------- عناوين الأقسام ---------- */
.section { padding: 80px 0; }
.section-sm { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-title { font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.01em; }
.section-title .line { display: block; }
.title-pill {
	display: inline-block; vertical-align: middle; width: 76px; height: 36px; margin-inline-end: 10px; border-radius: var(--pill);
	background:
		radial-gradient(circle at 70% 45%, #fff 0 7px, transparent 8px),
		radial-gradient(circle at 63% 40%, var(--store-primary) 0 8px, transparent 9px),
		linear-gradient(120deg, var(--store-primary), var(--store-accent));
	box-shadow: inset 0 0 0 3px rgba(255,255,255,.25);
}
.section-sub { color: var(--muted); max-width: 560px; margin: 10px auto 0; }
.section-more { text-align: center; margin-top: 36px; }

/* ---------- نوع الكتاب، التقييم، السعر ---------- */
.type-dot { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; box-shadow: 0 0 0 3px #fff; flex: none; }
.type-dot .icon { width: 17px; height: 17px; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-edu); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.rating b { color: var(--store-text); font-weight: 700; }
.rating .icon { width: 16px; height: 16px; color: var(--gold); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 16px; height: 16px; }
.stars .off { color: #D9DEE5; }
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; font-weight: 800; color: var(--store-primary-dark); font-size: 16px; }
.price del { color: var(--muted); font-weight: 500; font-size: 13px; }
.price-lg { font-size: 30px; }
.price-lg del { font-size: 17px; }

/* ---------- بطاقة الكتاب ---------- */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 24px; }
.book-card {
	position: relative; display: flex; flex-direction: column; background: #fff;
	border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .25s, transform .25s;
}
.book-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.book-media { position: relative; aspect-ratio: 2 / 3; background: var(--soft); }
.book-media > a { position: absolute; inset: 0; }
.book-media img { width: 100%; height: 100%; object-fit: cover; }
.book-media .type-dot { position: absolute; bottom: -17px; inset-inline-start: 16px; z-index: 2; }
.badge { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; padding: 3px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; background: #fff; color: var(--ink); }
.badge-sale { background: var(--store-primary); color: #fff; }
.badge-new { background: var(--store-accent); color: #fff; }
.fav { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; width: 36px; height: 36px; background: rgba(255,255,255,.92); }
.fav .icon { width: 18px; height: 18px; }
/* أدوات الغلاف: المفضّلة ظاهرة، والنظرة السريعة تطفو تحتها عند التحويم (ودائمًا في اللمس) بلا مكانٍ محجوز */
.card-tools { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3; display: grid; gap: 6px; }
.card-tools .fav { position: static; }
.card-tools .icon-btn { width: 36px; height: 36px; background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(17,24,39,.12); }
.card-tools .icon-btn:hover { background: #fff; color: var(--store-primary-dark); }
.card-tools .icon { width: 18px; height: 18px; }
.card-tools .qv { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
.book-card:hover .qv, .book-card:focus-within .qv { opacity: 1; transform: none; }
@media (hover: none) { .card-tools .qv { opacity: 1; transform: none; } }
/* زرّ السلّة: كبسولة القالب الأصليّة «أضف إلى السلّة» كانت تطفو فوق الغلاف عند التحويم فقط، فصارت ظاهرةً دائمًا بعرض البطاقة تحت السعر (البند 7) */
.card-cart { width: 100%; margin-top: 4px; }
.stock-band { position: absolute; inset-inline: 0; top: 46%; z-index: 2; text-align: center; padding: 8px; background: rgba(17,24,39,.86); color: #fff; font-weight: 700; font-size: 14px; }
.book-card.is-out .book-media img { filter: grayscale(.7); opacity: .8; }
.book-body { padding: 26px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.book-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.book-title a:hover { color: var(--store-primary-dark); }
.book-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.book-meta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--store-primary); flex: none; }
.book-body > .rating { margin-top: 2px; }
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 7px; border-top: 1px dashed var(--line); }
.book-foot .price { min-width: 0; }

body[data-card-style="framed"] .book-card { box-shadow: none; border: 1.5px solid var(--line); padding: 10px; }
body[data-card-style="framed"] .book-card .book-media { border-radius: calc(var(--r) - 4px); overflow: visible; }
body[data-card-style="framed"] .book-card .book-media img { border-radius: calc(var(--r) - 4px); }
body[data-card-style="framed"] .book-body { padding: 26px 6px 4px; }
body[data-card-style="minimal"] .book-card { box-shadow: none; background: transparent; overflow: visible; }
body[data-card-style="minimal"] .book-card .book-media { border-radius: var(--r); }
body[data-card-style="minimal"] .book-card .book-media img { border-radius: var(--r); }
body[data-card-style="minimal"] .book-body { padding: 24px 2px 0; }
body[data-card-style="minimal"] .book-foot { border-top: 0; }

/* نسخة «مختارات المحرّر» */
.pick-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; position: relative; }
.pick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pick-media { position: relative; aspect-ratio: 2 / 3; }
.pick-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(17,24,39,.88), rgba(17,24,39,0) 50%); }
.pick-media .type-dot { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; }
.pick-media .fav { z-index: 2; }
.pick-price { position: absolute; inset-inline: 16px; bottom: 8px; z-index: 2; color: #fff; }
.pick-price small { display: block; font-size: 12px; opacity: .9; }
.pick-price .price { color: #fff; font-size: 20px; }
.pick-price .price del { color: rgba(255,255,255,.85); }
.pick-body { padding: 10px 16px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.pick-body .book-title { font-size: 17px; }
.pick-body .book-author { color: var(--muted); font-size: 13px; }

/* ---------- الواجهة (السلايدر) ---------- */
.hero { position: relative; min-height: 760px; color: #fff; overflow: hidden; background: var(--ink); }
.hero .slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; visibility: hidden; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 7s ease; }
.slide.is-active > img { transform: scale(1); }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(17,24,39,.35), rgba(17,24,39,.15) 40%, rgba(17,24,39,.65)); }
.slide-inner { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; padding-top: 136px; }
.slide-title {
	font-size: clamp(84px, 22vw, 250px); font-weight: 800; line-height: 1; letter-spacing: -.01em;
	text-align: center; white-space: nowrap; text-shadow: 0 6px 40px rgba(0,0,0,.25);
}
.slide-text { max-width: 560px; text-align: center; font-size: 17px; margin-top: 10px; color: rgba(255,255,255,.92); padding-inline: 24px; }
.spin-badge {
	position: absolute; z-index: 3; inset-inline-end: 7%; top: 40%; width: 128px; height: 128px; border-radius: 50%;
	background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(8px);
	display: grid; place-items: center; color: #fff;
}
.spin-badge svg.ring { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); animation: spin 14s linear infinite; }
/* اتّجاه ltr للمسار فقط: Chrome لا يرسم النصّ العربيّ على مسارٍ دائريّ باتّجاه rtl، والكلمات تبقى بترتيبها الصحيح */
.spin-badge svg.ring text { fill: #fff; font-size: 13px; font-weight: 700; font-family: var(--font); direction: ltr; }
.spin-badge .core { width: 54px; height: 54px; border-radius: 50%; background: var(--store-primary); display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(207,52,37,.25); }
.spin-badge .core .icon { width: 22px; height: 22px; }
@keyframes spin { to { transform: rotate(-360deg); } }
.hero-search-wrap { position: absolute; z-index: 4; inset-inline: 0; bottom: 56px; }
.hero-search {
	max-width: 1080px; margin-inline: auto; padding: 18px; border-radius: var(--r-lg);
	background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3);
	backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.type-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.type-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: var(--pill); font-weight: 500; font-size: 14px; background: rgba(255,255,255,.12); color: #fff; transition: background .2s; }
.type-pill:hover { background: rgba(255,255,255,.24); }
.type-pill .type-dot { width: 28px; height: 28px; box-shadow: none; }
.type-pill .type-dot .icon { width: 15px; height: 15px; }
.search-field { display: flex; gap: 10px; background: #fff; border-radius: var(--r); padding: 8px; }
.search-field label { display: flex; align-items: center; gap: 10px; flex: 1; padding-inline: 12px; color: var(--muted); min-width: 0; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--store-text); font-size: 16px; padding: 10px 0; }
.search-field .btn { border-radius: var(--r-sm); padding-inline: 34px; }
.hero-dots { position: absolute; z-index: 4; inset-inline-start: 3%; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.45); }
.hero-dots button[aria-current="true"] { background: #fff; height: 26px; border-radius: 6px; }

/* ---------- شريطا الثقة المتقاطعان ---------- */
.ribbons { position: relative; height: 170px; overflow: hidden; margin-block: 8px; }
.ribbon { position: absolute; inset-inline: -40px; top: 50%; padding: 14px 0; overflow: hidden; white-space: nowrap; }
.ribbon-a { background: var(--store-accent); transform: translateY(-70%) rotate(-3deg); }
.ribbon-b { background: var(--store-primary); transform: translateY(-30%) rotate(2.4deg); box-shadow: 0 10px 30px rgba(17,24,39,.18); }
.ribbon-track { display: inline-flex; gap: 0; animation: marquee 36s linear infinite; }
.ribbon-b .ribbon-track { animation-direction: reverse; animation-duration: 30s; }
.ribbon-item { display: inline-flex; align-items: center; gap: 12px; padding-inline: 26px; color: #fff; font-weight: 700; font-size: 19px; }
.ribbon-item .icon { width: 22px; height: 22px; }
.ribbon-item::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.7); margin-inline-start: 26px; }
@keyframes marquee { to { transform: translateX(50%); } }
body[data-show-trust-bar="false"] .trust-section { display: none; }

/* ---------- فسيفساء التصنيفات ---------- */
.mosaic { display: grid; grid-template-columns: 1fr 1.35fr 1fr 1fr; grid-template-rows: 230px 230px; gap: 18px; }
.mosaic-item { position: relative; border-radius: var(--r-lg); overflow: hidden; display: block; background: var(--soft); }
.mosaic-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.mosaic-item:hover img { transform: scale(1.06); }
.mosaic-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(17,24,39,.4), transparent 45%); }
.mosaic-tag { position: absolute; z-index: 2; bottom: 14px; inset-inline-start: 14px; background: #fff; color: var(--ink); border-radius: var(--r-sm); padding: 3px 12px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: baseline; }
.mosaic-tag small { color: var(--muted); font-weight: 500; font-size: 12px; }
.mosaic-item:nth-child(2) { grid-row: span 2; }
.mosaic-item:nth-child(3) { grid-column: span 2; }
.mosaic-item:nth-child(n+7) { display: none; }

/* ---------- مختارات المحرّر (شريط ملوّن) ---------- */
.tint-band {
	background-color: var(--tint);
	background-image: repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--store-primary) 5%, transparent) 22px 24px);
}

/* ---------- قصّة المتجر ---------- */
.story-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.story-head h2 { font-size: clamp(30px, 4.2vw, 50px); font-weight: 800; line-height: 1.2; }
.story-head p { color: var(--muted); font-size: 16px; }
.readers { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-weight: 500; font-size: 14px; color: var(--muted); }
.readers .faces { display: flex; }
.readers:has([data-slot="store.reviews_count"]:empty) { display: none; }
.readers .faces span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; margin-inline-start: -10px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--store-accent); }
.readers .faces span:first-child { margin-inline-start: 0; }
.readers .faces span:nth-child(2) { background: var(--type-print); }
.readers .faces span:nth-child(3) { background: var(--type-ebook); }
.readers .faces span:nth-child(4) { background: var(--type-audio); }
.story-visual { position: relative; margin-top: 44px; }
.story-visual::before { content: ""; position: absolute; inset-inline: 0; top: 30%; bottom: 0; background: var(--store-accent); }
.story-media { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; height: 380px; }
.story-media > * { border-radius: var(--r-lg); overflow: hidden; position: relative; }
.story-media > a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-tile { display: grid; place-items: center; align-content: center; gap: 10px; color: #fff; text-align: center; padding: 20px; }
.story-tile .icon { width: 64px; height: 64px; stroke-width: 1.2; }
.story-tile-a { background: linear-gradient(160deg, var(--store-primary), var(--store-primary-dark)); }
.story-tile-b { background: radial-gradient(circle at 58% 22%, #26324D 0 30px, transparent 31px), radial-gradient(circle at 50% 26%, #FFF3E6 0 32px, transparent 33px), linear-gradient(160deg, #26324D, var(--ink)); }
.story-tile-b .icon { color: #fff; }
.story-types { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 44px 24px 54px; text-align: center; color: #fff; }
.story-types a { display: grid; justify-items: center; gap: 6px; }
.story-types small { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--on-dark-muted); }
.story-types .type-dot { width: 26px; height: 26px; box-shadow: none; }
.story-types .type-dot .icon { width: 14px; height: 14px; }
.outline-word { font-size: clamp(34px, 4.4vw, 56px); font-weight: 800; line-height: 1.1; color: transparent; -webkit-text-stroke: 1.5px #fff; }

/* ---------- المؤلّفون ---------- */
.author-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.author-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; text-align: center; transition: transform .25s, box-shadow .25s; display: block; }
.author-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.author-photo { aspect-ratio: 1; background: color-mix(in srgb, var(--store-primary) 70%, #fff); display: block; }
.author-card:nth-child(4n+2) .author-photo { background: var(--store-accent); }
.author-card:nth-child(4n+3) .author-photo { background: color-mix(in srgb, var(--store-primary) 35%, #fff); }
.author-card:nth-child(4n+4) .author-photo { background: color-mix(in srgb, var(--store-accent) 55%, #fff); }
.author-photo img { width: 100%; height: 100%; object-fit: cover; }
.author-card h3 { font-size: 17px; margin-top: 14px; }
.author-card p { color: var(--muted); font-size: 13px; padding-bottom: 16px; }

/* ---------- آراء القرّاء (أعمدة متحرّكة) ---------- */
.reviews-viewport {
	height: 560px; overflow: hidden; position: relative;
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
	mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
.reviews-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; animation: rise 40s linear infinite; }
.reviews-viewport:hover .reviews-track { animation-play-state: paused; }
.reviews-track > :nth-child(3n+2) { margin-top: 48px; }
@keyframes rise { to { transform: translateY(-50%); } }
.review-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: 0 2px 10px rgba(17,24,39,.04); }
.review-card p { color: var(--muted); font-size: 14px; }
.review-who { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-who b { display: block; font-size: 15px; }
.review-who small { color: var(--muted); font-size: 12px; }
body[data-show-reviews="false"] .reviews-section { display: none; }

/* ---------- البانر العريض الداكن ---------- */
.dark-banner { position: relative; color: #fff; overflow: hidden; padding: 84px 0 0; background: var(--ink); }
.dark-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dark-banner::before { content: ""; position: absolute; inset: 0; background: rgba(10,14,26,.55); z-index: 1; }
.dark-banner > .container, .dark-banner > .mega-marquee { position: relative; z-index: 2; }
.dark-banner h2 { text-align: center; font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; }
.dark-banner .lead { text-align: center; color: rgba(255,255,255,.88); max-width: 560px; margin: 10px auto 0; }
.glass-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.glass-card {
	display: grid; justify-items: center; gap: 10px; text-align: center; padding: 26px 18px; border-radius: var(--r);
	background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(10px); transition: background .2s, transform .2s;
}
.glass-card:hover { background: rgba(255,255,255,.2); transform: translateY(-3px); }
.glass-card .type-dot { width: 52px; height: 52px; box-shadow: 0 0 0 6px rgba(255,255,255,.12); }
.glass-card .type-dot .icon { width: 24px; height: 24px; }
.glass-card h3 { font-size: 17px; }
.glass-card p { font-size: 13px; color: rgba(255,255,255,.88); }
.mega-marquee { display: block; overflow: hidden; white-space: nowrap; padding: 50px 0 60px; }
.mega-track { display: inline-flex; align-items: center; animation: marquee 30s linear infinite; }
.mega-word { font-size: clamp(54px, 8vw, 120px); font-weight: 800; line-height: 1; padding-inline: 30px; }
.mega-arrow { width: clamp(60px, 7vw, 96px); height: clamp(60px, 7vw, 96px); border-radius: 50%; background: var(--store-primary); display: inline-grid; place-items: center; flex: none; }
.mega-arrow .icon { width: 40%; height: 40%; stroke-width: 1.4; }

/* ---------- شاهدتَه مؤخّرًا ---------- */
.recent-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 5 * 18px) / 6); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.recent-row > * { scroll-snap-align: start; }
.recent-row .book-body { padding: 22px 12px 12px; }
.recent-row .book-title { font-size: 14px; }
.recent-row .price { font-size: 14px; }

/* ---------- التذييل ---------- */
.site-footer { background: var(--ink); color: #fff; position: relative; overflow: hidden; padding-top: 64px; }
.site-footer::before { content: ""; position: absolute; width: 420px; height: 420px; inset-inline-end: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--store-primary) 45%, transparent), transparent 70%); pointer-events: none; }
.site-footer > .container { position: relative; }
.newsletter {
	display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 34px; border-radius: var(--r-lg);
	background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
}
.newsletter h2 { font-size: 26px; font-weight: 800; }
.newsletter p { color: var(--on-dark-muted); font-size: 14px; }
.nl-field { display: flex; gap: 6px; background: #fff; border-radius: var(--pill); padding: 6px; width: min(440px, 100%); }
.nl-field input { flex: 1; min-width: 0; border: 0; outline: none; padding: 0 16px; background: transparent; color: var(--store-text); }
.footer-mid { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 44px 0 34px; border-bottom: 1px solid rgba(255,255,255,.12); flex-wrap: wrap; }
.footer-about { max-width: 380px; }
.footer-about p { color: var(--on-dark-muted); font-size: 14px; margin-top: 12px; }
.contact-cards { display: flex; gap: 32px; flex-wrap: wrap; }
.contact-card { display: flex; align-items: center; gap: 12px; }
.contact-card .ci { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--store-primary); color: #fff; flex: none; }
.contact-card:nth-child(2) .ci { background: rgba(255,255,255,.14); }
.contact-card:nth-child(3) .ci { background: rgba(255,255,255,.14); }
.contact-card small { display: block; color: var(--on-dark-muted); font-size: 12px; }
.contact-card b { font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding: 26px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.dot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.dot-links li { display: inline-flex; align-items: center; }
.dot-links li + li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--store-primary); margin-inline: 14px; }
.dot-links a { font-size: 14px; color: rgba(255,255,255,.88); }
.dot-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 0 26px; font-size: 13px; color: var(--on-dark-muted); }
.social { display: flex; gap: 8px; }
.social a { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; }
.social a:hover { background: var(--store-primary); }
.social .icon { width: 17px; height: 17px; }

/* ---------- رأس الصفحات الداخليّة بصورة ---------- */
.page-hero { position: relative; color: #fff; padding: 140px 0 56px; overflow: hidden; background: var(--ink); text-align: center; }
.page-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px); transform: scale(1.04); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, rgba(17,24,39,.55), rgba(17,24,39,.75)); }
.page-hero.no-img { background: radial-gradient(circle at 7% 74%, #fff3e6 0 30px, transparent 31px), radial-gradient(70% 120% at 80% 0%, color-mix(in srgb, var(--store-primary) 55%, var(--ink)), var(--ink) 70%); }
.page-hero.no-img::before { background: rgba(17,24,39,.2); }
.page-hero > .container { position: relative; z-index: 2; }
.page-word { font-size: clamp(54px, 11vw, 150px); font-weight: 800; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 14px; margin-top: 12px; color: rgba(255,255,255,.9); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; opacity: .7; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb.on-light { justify-content: flex-start; color: var(--muted); margin: 0 0 16px; }
.breadcrumb.on-light [aria-current] { color: var(--store-text); font-weight: 500; }

/* ---------- صفحة التصنيف ---------- */
.cat-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.cat-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: var(--pill); border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 14px; white-space: nowrap; scroll-snap-align: start; transition: border-color .2s; }
.cat-chip:hover { border-color: var(--store-primary); }
.cat-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.cat-chip small { color: var(--muted); font-size: 12px; }
.listing { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 28px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px; position: sticky; top: 108px; }
.filters-head { display: none; }
.filter-group { border-bottom: 1px solid var(--line); padding: 14px 0; }
.filter-group:last-of-type { border-bottom: 0; }
.filter-group summary { display: flex; justify-content: space-between; align-items: center; font-weight: 700; cursor: pointer; list-style: none; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary .icon { width: 16px; height: 16px; transition: transform .2s; }
.filter-group[open] summary .icon { transform: rotate(180deg); }
.filter-body { display: grid; gap: 8px; padding-top: 12px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary); }
.check .type-dot { width: 22px; height: 22px; box-shadow: none; }
.check .type-dot .icon { width: 12px; height: 12px; }
.check .n { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.range input { width: 100%; accent-color: var(--store-primary); }
.range-vals { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; padding: 10px 14px; background: var(--soft); border-radius: var(--r); }
.toolbar .tools { display: flex; align-items: center; gap: 10px; }
.select { min-height: 40px; border: 1px solid var(--line); border-radius: var(--pill); padding: 0 14px; background: #fff; }
.view-toggle { display: inline-flex; background: #fff; border-radius: var(--pill); padding: 3px; border: 1px solid var(--line); }
.view-toggle button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.view-toggle button[aria-pressed="true"] { background: var(--store-primary); color: #fff; }
.filter-open-btn { display: none !important; }
.listing .book-grid { --per-row: 3; }
.listing.is-list .book-grid { grid-template-columns: 1fr; }
.listing.is-list .book-card { flex-direction: row; }
.listing.is-list .book-media { width: 150px; flex: none; }
.listing.is-list .card-cart { width: auto; align-self: flex-start; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pagination a:hover { border-color: var(--store-primary); color: var(--store-primary-dark); }
.pagination [aria-current="page"] { background: var(--store-primary); color: #fff; border-color: var(--store-primary); }
.pagination .gap { border: 0; }
.pagination .icon { width: 18px; height: 18px; }

/* ---------- صفحة الكتاب ---------- */
.pdp-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.pdp-top h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.pdp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.pdp-sub a { color: var(--store-text); font-weight: 700; }
.pdp-sub a:hover { color: var(--store-primary-dark); }
.type-tag { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 5px; border-radius: var(--pill); background: var(--soft); font-weight: 700; font-size: 13px; color: var(--store-text); }
.type-tag .type-dot { width: 26px; height: 26px; box-shadow: none; }
.type-tag .type-dot .icon { width: 14px; height: 14px; }
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 30px; align-items: start; }
.gallery { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; }
.thumbs { display: grid; gap: 12px; align-content: start; }
.thumbs button { border: 2px solid transparent; border-radius: var(--r-sm); padding: 0; overflow: hidden; background: none; aspect-ratio: 2 / 3; }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main { position: relative; border-radius: var(--r-lg); background: radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--store-primary) 18%, #fff) 0 90px, transparent 91px), var(--soft); display: grid; place-items: center; padding: 40px; min-height: 520px; }
.gallery-main img { width: min(320px, 100%); border-radius: var(--r-sm); box-shadow: 0 30px 50px rgba(17,24,39,.25); aspect-ratio: 2 / 3; object-fit: cover; }
.gallery-main .type-dot { position: absolute; top: 18px; inset-inline-start: 18px; width: 42px; height: 42px; }
.gallery-main .type-dot .icon { width: 20px; height: 20px; }
.box { background: var(--soft); border-radius: var(--r-lg); padding: 26px; margin-top: 24px; }
.box > h2 { font-size: 21px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.box > h2::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--store-primary); }
.prose p + p { margin-top: 10px; }
.prose { color: #374151; }
.spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.spec { background: #fff; border-radius: var(--r); padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.spec .icon { color: var(--store-primary-dark); }
.spec small { display: block; font-size: 12px; color: var(--muted); }
.spec b { font-size: 14px; }
.buy-box { position: sticky; top: 108px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 24px; border: 1px solid var(--line); }
.buy-box .lbl { color: var(--muted); font-size: 13px; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: #166534; background: #E8F6EE; font-weight: 700; font-size: 13px; padding: 3px 12px; border-radius: var(--pill); margin: 10px 0 16px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #16A34A; }
.buy-actions { display: grid; gap: 10px; }
.buy-row { display: flex; gap: 10px; }
.buy-row .btn { flex: 1; }
.buy-row .icon-btn { width: 52px; height: 52px; border: 1px solid var(--line); background: #fff; }
.buy-facts { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 14px; }
.buy-facts li { display: flex; justify-content: space-between; gap: 10px; }
.buy-facts span { color: var(--muted); }
.why-box { background: var(--store-accent); color: #fff; border-radius: var(--r-lg); padding: 22px; margin-top: 18px; }
.why-box h3 { font-size: 17px; margin-bottom: 12px; }
.why-box li { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 6px 0; color: rgba(255,255,255,.92); }
.why-box .icon { color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; padding: 6px; width: 32px; height: 32px; }
.reviews-summary { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: #fff; border-radius: var(--r); padding: 16px 18px; }
.reviews-summary strong { font-size: 40px; font-weight: 800; line-height: 1; }
.review-list { display: grid; gap: 14px; margin-top: 16px; }
.review-form { background: #fff; border-radius: var(--r); padding: 18px; margin-top: 16px; display: grid; gap: 12px; }
.review-form h3 { font-size: 16px; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { color: #D9DEE5; cursor: pointer; }
.star-input label .icon { width: 26px; height: 26px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--gold); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-primary); border-radius: 4px; }
.textarea, .input { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: #fff; min-height: 46px; }
.textarea { min-height: 110px; resize: vertical; }
.review-note { color: var(--muted); font-size: 13px; }

/* ---------- صفحة المؤلّف ---------- */
.author-profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; align-items: center; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 26px; margin-top: -80px; position: relative; z-index: 3; }
.author-profile .author-photo { border-radius: var(--r); overflow: hidden; }
.author-profile h2 { font-size: 30px; font-weight: 800; }
.author-stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 14px; }
.author-stats span { background: var(--soft); border-radius: var(--pill); padding: 4px 14px; font-size: 13px; color: var(--muted); }
.author-stats b { color: var(--store-text); }

/* ---------- السلّة ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 30px; align-items: start; }
.cart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cart-head h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; }
.link-btn { background: none; border: 0; color: var(--store-primary-dark); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.cart-items { display: grid; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.cart-item .ci-cover { position: relative; }
.cart-item .ci-cover img { border-radius: var(--r-sm); aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.cart-item .ci-cover .type-dot { position: absolute; bottom: -8px; inset-inline-start: -8px; width: 28px; height: 28px; }
.cart-item .ci-cover .type-dot .icon { width: 14px; height: 14px; }
.cart-item h3 { font-size: 16px; }
.cart-item .book-meta { margin-top: 4px; }
.ci-end { display: grid; justify-items: end; gap: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--soft); display: grid; place-items: center; }
.qty input { width: 40px; border: 0; text-align: center; background: transparent; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty .icon { width: 16px; height: 16px; }
.ci-remove { background: none; border: 0; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.ci-remove:hover { color: var(--store-primary-dark); }
.ci-remove .icon { width: 16px; height: 16px; }
.summary { position: sticky; top: 108px; background: var(--soft); border-radius: var(--r-lg); padding: 24px; }
.summary h2 { font-size: 20px; margin-bottom: 14px; }
.coupon { display: flex; gap: 6px; background: #fff; border-radius: var(--pill); padding: 5px; border: 1px solid var(--line); }
.coupon input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0 14px; }
.sum-rows { display: grid; gap: 10px; margin: 18px 0; font-size: 15px; }
.sum-rows li { display: flex; justify-content: space-between; gap: 10px; }
.sum-rows li span:first-child { color: var(--muted); }
.sum-rows .total { padding-top: 12px; border-top: 1px dashed #CBD5E1; font-weight: 800; font-size: 19px; }
.sum-rows .total span:first-child { color: var(--store-text); }
.sum-rows .total span:last-child { color: var(--store-primary-dark); }
.applied { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 8px; color: var(--muted); }
.applied b { color: var(--store-text); }
.applied button { background: none; border: 0; color: var(--store-primary-dark); font-weight: 700; padding: 0; font-size: 13px; }
.cart-empty { text-align: center; padding: 60px 20px; background: var(--soft); border-radius: var(--r-lg); }
.cart-empty[hidden] { display: none; }
.secure-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 12px; justify-content: center; }
.secure-note .icon { width: 16px; height: 16px; }

/* ---------- 404 ---------- */
.nf { background: var(--tint); text-align: center; padding: 70px 0 80px; position: relative; overflow: hidden; }
.nf .nf-num { font-size: clamp(110px, 22vw, 260px); font-weight: 800; line-height: .9; color: var(--store-primary-dark); letter-spacing: -.02em; position: relative; z-index: 2; }
.open-book { width: min(340px, 80%); height: 90px; margin: -10px auto 26px; position: relative; }
.open-book::before, .open-book::after { content: ""; position: absolute; bottom: 0; width: 50%; height: 80px; background: #fff; border: 3px solid var(--store-accent); box-shadow: 0 14px 24px rgba(17,24,39,.12); }
.open-book::before { inset-inline-start: 0; border-radius: 0 40px 4px 4px / 0 18px 4px 4px; transform: skewY(-6deg); transform-origin: left bottom; }
.open-book::after { inset-inline-end: 0; border-radius: 40px 0 4px 4px / 18px 0 4px 4px; transform: skewY(6deg); transform-origin: right bottom; }
.nf h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
.nf p { color: var(--muted); max-width: 520px; margin: 10px auto 24px; }
.nf .search-field { max-width: 560px; margin: 0 auto 18px; box-shadow: var(--shadow); }

/* ---------- صفحة المكوّنات ---------- */
.kit-block { padding: 46px 0; border-bottom: 1px solid var(--line); }
.kit-block > .container > h2 { font-size: 22px; margin-bottom: 6px; }
.kit-note { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.kit-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.kit-label { font-weight: 700; font-size: 14px; min-width: 110px; }
.kit-dark { background: var(--ink); padding: 18px; border-radius: var(--r); }
.kit-types { display: flex; gap: 24px; flex-wrap: wrap; }
.kit-types figure { margin: 0; display: grid; justify-items: center; gap: 6px; font-size: 13px; }
.kit-intro { padding: 40px 0 10px; }
.kit-intro h1 { font-size: 34px; font-weight: 800; }
.kit-intro p { color: var(--muted); max-width: 680px; margin-top: 8px; }
.eyebrow { color: var(--store-primary-dark); font-weight: 700; font-size: 14px; }
code { background: var(--soft); padding: 1px 6px; border-radius: 4px; font-size: 13px; direction: ltr; unicode-bidi: embed; }

/* ---------- حركة الظهور ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   العروض
   ========================================================================== */
@media (max-width: 1180px) {
	.nav-list > li > a, .nav-list > li > button { padding: 7px 10px; }
	.nav-list .hide-md { display: none; }
}
@media (max-width: 1024px) {
	.book-grid { grid-template-columns: repeat(min(var(--per-row), 4), minmax(0, 1fr)); gap: 18px; }
	.nav-list, .site-header .account { display: none; }
	.menu-toggle { display: inline-grid !important; }
	.header-actions { margin-inline-start: auto; }
	.pdp { grid-template-columns: 1fr; gap: 0; }
	/* صندوق الشراء بعد المعرض مباشرةً، لا بعد الآراء */
	.pdp > div:first-child { display: contents; }
	.pdp .gallery { order: 0; }
	.pdp > aside { order: 1; margin-top: 24px; }
	.pdp .box { order: 2; }
	.buy-box { position: static; }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.listing { grid-template-columns: 1fr; }
	.filter-open-btn { display: inline-flex !important; }
	.filters { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(330px, 88vw); z-index: 100; border-radius: 0; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .3s; padding-top: 14px; }
	.filters-open .filters { transform: none; visibility: visible; }
	.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
	.filters-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
	.glass-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.recent-row { grid-auto-columns: calc((100% - 3 * 18px) / 4); }
	.spin-badge { display: none; }
	.mosaic { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 200px 200px 200px; }
	.mosaic-item:nth-child(3) { grid-column: span 1; }
	.mosaic-item:nth-child(6) { grid-column: span 2; }
}
@media (max-width: 767px) {
	body { font-size: 14.5px; }
	.container { padding-inline: 16px; }
	.section { padding: 56px 0; }
	.section-sm { padding: 40px 0; }
	.masthead { padding: 10px 0; }
	.site-header { gap: 8px; padding: 6px 6px 6px 10px; min-height: 58px; border-radius: var(--r); }
	.brand { font-size: 17px; gap: 8px; }
	.brand img { width: 34px; height: 34px; }
	.header-actions { gap: 6px; }
	.site-header .icon-btn { width: 38px; height: 38px; }
	.header-actions .hide-sm { display: none; }
	.book-grid, .listing .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.book-body { padding: 24px 10px 12px; }
	.book-title { font-size: 14.5px; }
	.price { font-size: 14.5px; }
	.fav, .card-tools .icon-btn { width: 40px; height: 40px; }
	.card-tools { top: 8px; inset-inline-end: 8px; }
	.badge { font-size: 11px; padding: 2px 8px; top: 8px; inset-inline-start: 8px; }
	.hero { min-height: 640px; }
	.slide-inner { padding-top: 108px; }
	.slide-text { font-size: 15px; }
	.hero-search-wrap { bottom: 24px; }
	.slide > img { object-position: 64% center; }
	.slide-text { text-shadow: 0 1px 12px rgba(10, 14, 26, .9); }
	.hero-search { padding: 12px; margin-inline: 0; }
	.type-pills { gap: 6px; }
	.type-pill { font-size: 13px; padding: 4px 10px 4px 4px; }
	.type-pill .type-dot { width: 24px; height: 24px; }
	.search-field { flex-direction: column; }
	.search-field .btn { width: 100%; }
	.hero-dots { top: auto; bottom: auto; inset-inline-end: 50%; top: 84px; transform: translateX(-50%); flex-direction: row; display: none; }
	.ribbons { height: 130px; }
	.ribbon { padding: 10px 0; }
	.ribbon-item { font-size: 15px; padding-inline: 18px; }
	.mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 150px); gap: 12px; }
	.mosaic-item:nth-child(2) { grid-row: span 2; }
	.mosaic-item:nth-child(3) { grid-column: span 1; }
	.mosaic-item:nth-child(6) { grid-column: span 2; }
	.story-head { grid-template-columns: 1fr; gap: 14px; }
	.story-media { grid-template-columns: 1fr 1fr; grid-template-rows: 210px 150px; height: auto; gap: 12px; }
	.story-media > a { grid-column: span 2; }
	.story-types { grid-template-columns: repeat(2, 1fr); padding: 30px 8px 36px; gap: 24px 12px; }
	.author-grid { gap: 14px; }
	.author-card h3 { font-size: 15px; }
	.reviews-viewport { height: 520px; }
	.reviews-track { grid-template-columns: 1fr; }
	.reviews-track > :nth-child(3n+2) { margin-top: 0; }
	.dark-banner { padding-top: 56px; }
	.glass-cards { gap: 12px; }
	.glass-card { padding: 18px 10px; }
	.mega-marquee { padding: 36px 0 44px; }
	.recent-row { grid-auto-columns: 42%; gap: 12px; }
	.newsletter { flex-direction: column; align-items: stretch; padding: 22px 18px; }
	.newsletter h2 { font-size: 21px; }
	.nl-field { width: 100%; }
	.contact-cards { gap: 16px; flex-direction: column; }
	.footer-links { flex-direction: column; }
	.page-hero { padding: 112px 0 40px; }
	.gallery { grid-template-columns: 1fr; }
	.thumbs { grid-template-columns: repeat(4, 64px); order: 2; }
	.gallery-main { min-height: 0; padding: 26px; }
	.gallery-main img { width: min(240px, 100%); }
	.box { padding: 18px; }
	.spec-grid { grid-template-columns: 1fr 1fr; }
	.author-profile { grid-template-columns: 1fr; padding: 18px; gap: 18px; margin-top: -50px; }
	.author-profile .author-photo { max-width: 240px; }
	.cart-item { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
	.ci-end { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
	.toolbar .tools { width: 100%; justify-content: space-between; }
	.listing.is-list .book-media { width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
	.reviews-viewport { height: auto; -webkit-mask-image: none; mask-image: none; }
	.ribbon-track, .mega-track { transform: none; }
}

/* ==================================================================
   ميزات المنصّة المعتمدة: تبويبات «الأكثر رواجًا»، والمدوّنة
   ================================================================== */
.cat-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cat-tabs { margin-top: 22px; }
.cat-tabs button {
	min-height: 40px; padding: 6px 18px; border: 1px solid var(--line); border-radius: var(--pill);
	background: #fff; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--store-text); cursor: pointer;
	transition: border-color .2s, background .2s, color .2s;
}
.cat-tabs button:hover { border-color: var(--store-primary); }
.cat-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { min-width: 0; }
.post-link { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-lg); background: var(--ink); color: #fff; }
.post-link > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.post-link:hover > img { transform: scale(1.05); }
.post-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(17, 24, 39, .92), rgba(17, 24, 39, .5) 42%, rgba(17, 24, 39, 0) 70%); }
.post-body { position: absolute; z-index: 1; inset-inline: 0; bottom: 0; display: grid; gap: 6px; padding: 24px; }
.post-date { justify-self: start; padding: 3px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .16); font-size: 12.5px; backdrop-filter: blur(6px); }
.post-title { font-size: 20px; font-weight: 700; line-height: 1.4; }
.post-excerpt { font-size: 14px; line-height: 1.7; color: rgba(255, 255, 255, .86); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-all { margin-top: 30px; text-align: center; }
.post-grid-page { margin-bottom: 40px; }
.post-head-date { display: inline-block; margin-bottom: 14px; padding: 4px 14px; border-radius: var(--pill); background: rgba(255, 255, 255, .16); font-size: 13.5px; position: relative; z-index: 2; }
.post-head-title { position: relative; z-index: 2; max-width: 860px; margin: 0 auto 14px; font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; line-height: 1.25; }
.post-article { max-width: 820px; margin-inline: auto; }
.post-hero { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); }
.post-content { margin-top: 30px; font-size: 17px; line-height: 2; }
.post-content p + p { margin-top: 16px; }
.post-back { margin-top: 30px; }

@media (max-width: 1024px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid > .post-card:nth-child(3):last-child { display: none; }
}
@media (max-width: 767px) {
	.post-grid { grid-template-columns: minmax(0, 1fr); }
	.post-grid > .post-card:nth-child(3):last-child { display: block; }
	.post-link { aspect-ratio: 4 / 3; }
	.cat-tabs { flex-wrap: nowrap; justify-content: flex-start; }
	.cat-tabs { overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-inline: calc(-1 * var(--gutter, 16px)); padding-inline: var(--gutter, 16px); }
	.cat-tabs button { flex: none; white-space: nowrap; }
	.post-content { font-size: 16px; }
}

/* ==================================================================
   الإصدار الثاني: دوّار «وصل حديثًا»، وعروض الليالي القمريّة بعدّاد، وخلفيّات متناوبة
   ================================================================== */
.soft-band { background: var(--soft); }
.soft-band .review-card { box-shadow: none; }

/* الدوّار الأفقيّ: يُمرَّر باللمس، وسهمان في الحاسوب */
.carousel { position: relative; }
.book-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per-row) - 1) * 24px) / var(--per-row)); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 4px 14px; margin: -6px -4px -14px; }
.book-row::-webkit-scrollbar { display: none; }
.book-row > * { scroll-snap-align: start; }
.carousel-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 36px; }
.carousel-btn { width: 44px; height: 44px; background: #fff; border: 1.5px solid var(--line); }
.carousel-btn:hover { border-color: var(--store-primary); color: var(--store-primary-dark); background: #fff; }
.carousel-btn[disabled] { opacity: .4; cursor: default; }
.carousel-nav.no-scroll .carousel-btn { display: none; }

/* عروض الليالي القمريّة: سماءٌ داكنة بقمرٍ ونجوم، وعدّادٌ واحد للقسم */
.night-band {
	position: relative; color: #fff; overflow: hidden;
	background:
		radial-gradient(1.5px 1.5px at 20% 70%, rgba(255,255,255,.8), transparent),
		radial-gradient(1.5px 1.5px at 42% 18%, rgba(255,255,255,.7), transparent),
		radial-gradient(1.5px 1.5px at 66% 40%, rgba(255,255,255,.6), transparent),
		radial-gradient(1.5px 1.5px at 84% 12%, rgba(255,255,255,.8), transparent),
		radial-gradient(1.5px 1.5px at 92% 64%, rgba(255,255,255,.6), transparent),
		radial-gradient(70% 120% at 90% 100%, color-mix(in srgb, var(--store-primary) 38%, transparent), transparent 70%),
		var(--ink);
}
.night-band::before { content: ""; position: absolute; top: 44px; inset-inline-end: 4%; width: 64px; height: 64px; border-radius: 50%; background: #FFF3E0; box-shadow: 0 0 0 8px rgba(255, 243, 224, .1), 0 0 70px rgba(255, 243, 224, .45); pointer-events: none; }
.night-band > .container { position: relative; }
.offer-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.offer-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 10px; border-radius: var(--pill); background: rgba(255,255,255,.12); font-size: 13px; font-weight: 700; }
.offer-kicker .icon { width: 16px; height: 16px; }
.offer-title { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; margin-top: 10px; }
.offer-sub { color: var(--on-dark-muted); margin-top: 4px; }
.countdown { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.countdown[hidden] { display: none; }
.cd-label { font-size: 14px; color: var(--on-dark-muted); margin-inline-end: 4px; }
.cd-unit { display: grid; justify-items: center; min-width: 64px; padding: 8px 6px; border-radius: var(--r); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); }
.cd-unit b { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 12px; color: var(--on-dark-muted); }
/* أوّل كتابٍ كبيرٌ بوصفه، وما بعده صفوفٌ مدمجة بجانبه */
.deal-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.deal-book { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-lg); padding: 14px; }
.deal-cover { position: relative; }
.deal-cover > a { display: block; border-radius: var(--r-sm); overflow: hidden; }
.deal-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.deal-cover .badge { top: 6px; inset-inline-start: 6px; font-size: 11px; padding: 2px 8px; }
.deal-cover .type-dot { position: absolute; bottom: -8px; inset-inline-end: -8px; width: 28px; height: 28px; box-shadow: 0 0 0 3px var(--ink); }
.deal-cover .type-dot .icon { width: 14px; height: 14px; }
.deal-info { display: grid; gap: 4px; min-width: 0; }
.deal-title { font-size: 17px; font-weight: 700; }
.deal-title a:hover { text-decoration: underline; }
.deal-info .book-meta { color: var(--on-dark-muted); }
.deal-info .rating { color: var(--on-dark-muted); }
.deal-info .rating b { color: #fff; }
.deal-desc { display: none; }
.deal-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.deal-buy .price { color: #fff; font-size: 18px; }
.deal-buy .price > * { white-space: nowrap; }
.deal-buy .price del { color: var(--on-dark-muted); }
.deal-book:not(:first-child) .deal-cart { width: 40px; min-height: 40px; height: 40px; padding: 0; flex: none; }
.deal-book:not(:first-child) .deal-cart span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.deal-book:first-child { grid-row: span 3; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 32px; padding: 28px; background: rgba(255,255,255,.1); }
.deal-book:first-child .deal-cover img { box-shadow: 0 24px 40px rgba(0,0,0,.35); }
.deal-book:first-child .deal-cover .badge { top: 10px; inset-inline-start: 10px; font-size: 13px; padding: 3px 12px; }
.deal-book:first-child .deal-cover .type-dot { width: 40px; height: 40px; bottom: -12px; inset-inline-end: -12px; }
.deal-book:first-child .deal-cover .type-dot .icon { width: 19px; height: 19px; }
.deal-book:first-child .deal-title { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; }
.deal-book:first-child .deal-desc { display: grid; gap: 8px; margin-top: 8px; color: rgba(255,255,255,.86); font-size: 14.5px; }
.deal-book:first-child .deal-buy { justify-content: flex-start; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.deal-book:first-child .deal-buy .price { font-size: 26px; }
.deal-book:only-child { grid-column: 1 / -1; }

@media (max-width: 1024px) {
	.book-row { grid-auto-columns: calc((100% - 2 * 24px) / 3); }
	.deal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.deal-book:first-child { grid-row: auto; grid-column: 1 / -1; }
	.deal-book:not(:first-child) { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
	.deal-book:not(:first-child) .deal-buy { flex-wrap: wrap; gap: 6px 10px; }
	/* الغلاف الكبير يتبع طول النصّ حين يصير العرض صفًّا كاملًا، فلا يبقى تحت النصّ فراغ */
	.deal-book:first-child { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
	.author-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
	.night-band::before { display: none; }
	.reviews-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.reviews-track > :nth-child(3n+2) { margin-top: 0; }
	.reviews-track > :nth-child(2n) { margin-top: 40px; }
}
@media (max-width: 767px) {
	.book-row { grid-auto-columns: 46%; gap: 14px; }
	.reviews-track { grid-template-columns: 1fr; }
	.reviews-track > :nth-child(2n) { margin-top: 0; }
	.pick-price { inset-inline: 12px; }
	.pick-price .price { flex-direction: column-reverse; align-items: flex-start; gap: 0; font-size: 18px; }
	.deal-grid { grid-template-columns: minmax(0, 1fr); }
	.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.carousel-nav { margin-top: 24px; }
	.offer-head { margin-bottom: 22px; }
	.cd-unit { min-width: 54px; padding: 6px 4px; }
	.cd-unit b { font-size: 21px; }
	.cd-label { width: 100%; }
	.deal-book:first-child { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px; align-items: start; }
	.deal-book:first-child .deal-desc { font-size: 14px; }
	.deal-book:first-child .deal-desc p + p { display: none; }
	.deal-book:first-child .deal-buy .price { font-size: 21px; }
	.deal-book:first-child .deal-cart { width: 100%; }
}

/* صفحة الكتاب: اختيار الصيغة (book.formats)، ويختفي إن لم تكن للعنوان غير صيغةٍ واحدة */
.formats-box { display: grid; gap: 8px; margin-top: 14px; }
.formats-box:not(:has([data-repeat="format"] ~ [data-preview-copy])) { display: none; }
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.format-opt { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: var(--r); text-align: center; transition: border-color .2s; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt[aria-current="page"] { border-color: var(--store-primary); background: var(--tint); }
.format-opt .type-dot { width: 28px; height: 28px; box-shadow: none; }
.format-opt .type-dot .icon { width: 14px; height: 14px; }
.format-name { font-weight: 700; font-size: 13.5px; }
.format-price { font-size: 13px; color: var(--muted); }
.format-opt[aria-current="page"] .format-price { color: var(--store-primary-dark); font-weight: 700; }
.qty-lg { flex: none; }
.qty-lg button { width: 40px; height: 40px; }
.buy-row .qty + .btn { min-width: 0; padding-inline: 14px; }

/* صفحة التصنيف: التصفية المطبّقة */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 20px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; padding-inline: 14px 4px; border-radius: var(--pill); background: var(--tint); color: var(--store-primary-dark); font-size: 13.5px; font-weight: 700; }
.chip button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: grid; place-items: center; }
.chip button:hover { background: #fff; }
.chip .icon { width: 14px; height: 14px; }
.active-filters .link-btn { font-size: 13.5px; }

/* الهاتف: إن بقيت بطاقةٌ وحدها في آخر الشبكة امتدّت بعرض الصفّ أفقيّة، فلا يبقى نصف صفٍّ فارغ */
@media (max-width: 767px) {
	.book-grid > .book-card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
	.book-grid > .book-card:last-child:nth-child(odd) .book-media { width: 42%; flex: none; }
	.book-grid > .book-card:last-child:nth-child(odd) .book-body { padding: 16px 14px 14px; }
	.card-cart { min-height: 40px; padding-inline: 8px; font-size: 12.5px; gap: 6px; }
}

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

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