/* ==========================================================================
   قالب «مُزن» — متجر كتب على منصّة ناشر
   رأسٌ من ثلاثة صفوف، ولوحاتٌ رماديّة مستديرة، وبطاقاتٌ مؤطَّرة بزرّ سلّة مربّع.
   ألوان الهويّة في المتغيّرات الخمسة أدناه وحدها؛ كلّ ما عداها محايد.
   ========================================================================== */

:root {
	/* ألوان الهويّة (قيمٌ تجريبيّة يغيّرها الناشر) */
	--store-primary: #2D82FF;
	--store-primary-dark: #1A66D9;
	--store-accent: #232323;
	--store-bg: #FFFFFF;
	--store-text: #232323;

	/* ألوان محايدة */
	--panel: #F5F5F5;
	--panel-2: #EFEFEF;
	--line: #E6E6E6;
	--muted: #666666;
	--white: #FFFFFF;
	--sale: #D42424;
	--gold: #FFB400;
	--on-dark: #FFFFFF;
	--on-dark-muted: #BDBDBD;
	--tint: color-mix(in srgb, var(--store-primary) 9%, #FFFFFF);
	--tint-strong: color-mix(in srgb, var(--store-primary) 16%, #FFFFFF);
	--on-dark-accent: color-mix(in srgb, var(--store-primary) 45%, #FFFFFF);

	/* ألوان أنواع الكتب (ثابتة في كلّ القوالب) */
	--type-print: #DB7056;
	--type-ebook: #5675A3;
	--type-audio: #986AB0;
	--type-educational: #3f8f6b;

	--font: "Tajawal", system-ui, sans-serif;
	--r-xl: 22px;
	--r-lg: 13px;
	--r-md: 9px;
	--r-sm: 7px;
	--pill: 999px;
	--shadow: 0 10px 30px rgba(20, 20, 20, .08);
	--shadow-sm: 0 3px 12px rgba(20, 20, 20, .06);
	--gutter: 16px;
	--container: 1296px;
	--per-row: 4;
	--gap: 22px;
}

body[data-corners="sharp"] {
	--r-xl: 3px;
	--r-lg: 3px;
	--r-md: 2px;
	--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 { --head-h: 142px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 70px); }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.65;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: clip;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--store-primary-dark); outline-offset: 2px; }
.visually-hidden {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-arrow { width: 18px; height: 18px; }
.icon.star { fill: var(--gold); stroke: var(--gold); stroke-width: 1; }
.icon.star.off { fill: var(--line); stroke: var(--line); }
.muted { color: var(--muted); }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

.section { padding-block: 44px; }
.section-tight { padding-block: 22px; }
.section-top { padding-top: 22px; padding-bottom: 8px; }
.section-flush { padding-top: 8px; }

/* ------------------------------------------------------------------ أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 9px 22px; border: 1px solid transparent; border-radius: var(--pill);
	font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn .icon { width: 19px; height: 19px; }
.btn-lg { min-height: 50px; padding-inline: 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--store-primary-dark); color: var(--white); }
.btn-primary:hover { background: color-mix(in srgb, var(--store-primary-dark) 82%, #000); }
.btn-dark { background: var(--store-accent); color: var(--white); }
.btn-dark:hover { background: color-mix(in srgb, var(--store-accent) 85%, #FFF); }
.btn-ghost { background: var(--white); color: var(--store-text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--store-primary); color: var(--store-primary-dark); }
.btn-link { background: none; border: 0; padding: 6px 0; min-height: 0; color: var(--store-text); font-weight: 500; }
.btn-link[aria-pressed="true"] .icon { fill: var(--sale); stroke: var(--sale); }

.icon-btn {
	position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
	border: 0; border-radius: var(--r-md); background: transparent; color: var(--store-text);
}
.icon-btn:hover { background: var(--panel); }
.count {
	position: absolute; top: 1px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px;
	display: grid; place-items: center; border-radius: var(--pill);
	background: var(--store-primary-dark); color: var(--white); font-size: 11px; font-weight: 700; line-height: 1;
}
.sq-ico {
	display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
	border-radius: var(--r-md); background: var(--store-primary); color: var(--white);
}
.sq-ico .icon { width: 22px; height: 22px; }
.sq-ico-lg { width: 64px; height: 64px; border-radius: var(--r-lg); }
.sq-ico-lg .icon { width: 30px; height: 30px; }

.eyebrow { display: inline-block; color: var(--store-primary-dark); font-weight: 700; font-size: 14px; letter-spacing: .01em; }
.view-all { display: inline-flex; align-items: center; gap: 6px; color: var(--store-primary-dark); font-weight: 700; white-space: nowrap; }
.view-all:hover .icon-arrow { transform: translateX(-3px); }
.view-all .icon-arrow { transition: transform .2s; }

/* ------------------------------------------------------------------ شريط الإعلان */
.topbar { background: var(--store-accent); color: var(--on-dark-muted); font-size: 13.5px; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar-msg { flex: 1; text-align: center; color: var(--on-dark-muted); }
.topbar-msg:empty { display: none; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; color: var(--on-dark); white-space: nowrap; }
.topbar-link .icon { width: 17px; height: 17px; color: var(--on-dark-accent); }
.topbar-link:hover { color: var(--on-dark-accent); }

/* ------------------------------------------------------------------ الرأس */
/* الرأس مثبّت أعلى الشاشة، وارتفاعه (--head-h في html) يحسب له لسان صفحة الكتاب والروابط الداخليّة */
.site-header { background: var(--white); position: sticky; top: 0; z-index: 40; box-shadow: 0 6px 18px rgba(20, 20, 20, .04); }
.head-main { border-bottom: 1px solid var(--line); }
.head-main-in { display: flex; align-items: center; gap: 28px; min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 42px; height: 42px; border-radius: var(--r-md); }
.brand-name { font-weight: 800; font-size: 23px; letter-spacing: -.01em; color: var(--store-text); }
.menu-toggle, .head-cart-sm { display: none; }

.head-search {
	flex: 1; max-width: 640px; margin-inline: auto; display: flex; align-items: center;
	min-height: 46px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--white);
	transition: border-color .2s, box-shadow .2s;
}
.head-search:focus-within { border-color: var(--store-primary); box-shadow: 0 0 0 3px var(--tint); }
.head-search select {
	border: 0; background: transparent; padding: 0 22px 0 12px; height: 44px; font-weight: 500; max-width: 150px;
	border-inline-end: 1px solid var(--line); border-radius: 0; outline-offset: -2px;
}
.head-search input { flex: 1; min-width: 0; border: 0; background: transparent; height: 44px; padding: 0 16px; outline: none; }
.head-search input::placeholder { color: #767676; }
.head-search button { border: 0; background: none; width: 48px; height: 44px; display: grid; place-items: center; color: var(--store-primary-dark); }

.head-contact { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.head-contact b { display: block; font-size: 15px; line-height: 1.3; }
.head-contact small { display: block; color: var(--muted); font-size: 13px; }

.head-nav-in { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.cat-menu { position: relative; flex: none; }
.cat-btn {
	display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 0;
	font-weight: 700; font-size: 16px;
}
.cat-btn > .icon:first-child { color: var(--store-primary); width: 24px; height: 24px; stroke-width: 2.2; }
.cat-btn .chev { width: 16px; height: 16px; transition: transform .2s; }
.cat-menu.open .chev { transform: rotate(180deg); }
.cat-panel {
	position: absolute; top: calc(100% + 10px); inset-inline-start: 0; min-width: 250px; padding: 8px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
	display: none; z-index: 30;
}
.cat-menu.open .cat-panel, .cat-menu:hover .cat-panel { display: block; }
.cat-panel a { display: block; padding: 9px 14px; border-radius: var(--r-sm); font-weight: 500; }
.cat-panel a:hover { background: var(--tint); color: var(--store-primary-dark); }

.nav-links { flex: 1; display: flex; justify-content: center; gap: 30px; }
.nav-links a { display: block; padding: 6px 0; font-weight: 500; font-size: 15.5px; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--store-primary-dark); border-bottom-color: var(--store-primary); }
.head-icons { display: flex; gap: 4px; flex: none; }

/* الدرج الجانبيّ */
.drawer-backdrop {
	position: fixed; inset: 0; background: rgba(15, 15, 15, .45); z-index: 80;
	opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(330px, 86vw); z-index: 90;
	background: var(--white); padding: 16px 18px 28px; overflow-y: auto;
	transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
}
.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; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer-head .brand-name { font-size: 20px; }
.drawer-nav { padding-block: 10px; }
.drawer-nav a { display: block; padding: 11px 4px; font-weight: 500; border-bottom: 1px solid var(--panel-2); }
.drawer-label { margin-top: 14px; font-weight: 700; color: var(--muted); font-size: 13.5px; }
.drawer-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 18px; }
.drawer-cats a { padding: 6px 14px; border-radius: var(--pill); background: var(--panel); font-size: 14px; }

/* ------------------------------------------------------------------ عناوين الأقسام */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title { font-size: 30px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.section-sub { margin-top: 6px; color: var(--muted); }
.block-title { font-size: 22px; font-weight: 800; margin-bottom: 16px; }

/* ------------------------------------------------------------------ الواجهة: لوحتان */
.hero-wrap { padding-top: 32px; padding-bottom: 12px; }
.hero-box { position: relative; }
.hero { position: relative; }
.hero-slides { display: grid; }
.hero-slide {
	grid-area: 1 / 1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
	opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-media, .hero-text { background: var(--panel); border-radius: var(--r-xl); overflow: hidden; }
.hero-media { display: grid; place-items: center; min-height: 520px; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-text { padding: 54px 44px 210px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hero-title { font-size: 46px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; max-width: 14ch; }
.hero-text p { color: var(--muted); font-size: 16.5px; max-width: 46ch; }
.hero-text .btn { margin-top: 12px; }
.hero-dots {
	position: absolute; bottom: 22px; inset-inline-start: 0; width: calc(50% - 12px);
	display: flex; justify-content: center; gap: 8px;
}
.hero-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: var(--pill); background: #C4C4C4; transition: width .25s, background-color .25s; }
.hero-dots button[aria-current="true"] { width: 26px; background: var(--store-primary); }

/* صفّ الكتب المصغّر داخل لوحة النصّ */
.hero-books { margin-top: 20px; padding: 18px; background: var(--panel); border-radius: var(--r-xl); }
.hero + .hero-books {
	position: absolute; margin: 0; padding: 0; background: none; z-index: 2;
	bottom: 34px; inset-inline-end: calc(var(--gutter) + 34px); width: calc((100% - 2 * var(--gutter) - 24px) / 2 - 68px);
}
.mini-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
.mini-track::-webkit-scrollbar { display: none; }
.mini-track .mini-card { flex: 0 0 245px; scroll-snap-align: start; }

/* البطاقة المصغّرة */
.mini-card {
	display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 12px; padding: 8px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.mini-thumb { position: relative; display: grid; place-items: center; height: 82px; border-radius: var(--r-md); background: var(--panel); }
.mini-thumb img { height: 68px; width: auto; border-radius: 3px; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.mini-title { font-size: 15px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-body .price { margin-top: 4px; font-size: 15.5px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ------------------------------------------------------------------ التصنيفات: دوائر */
.cat-row { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; justify-content: space-between; padding-bottom: 4px; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-row > li { flex: 0 0 auto; }
.cat-row a { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 132px; text-align: center; }
.cat-img {
	display: block; width: 116px; height: 116px; border-radius: 50%; overflow: hidden; background: var(--panel);
	border: 1px solid var(--line); transition: border-color .2s, transform .2s;
}
.cat-img img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: filter .2s; }
.cat-row a:hover .cat-img { border-color: var(--store-primary); transform: translateY(-3px); }
.cat-row a:hover .cat-img img { filter: none; }
.cat-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.cat-count { color: var(--muted); font-size: 13px; }
.cat-row-sm a { width: 112px; }
.cat-row-sm .cat-img { width: 92px; height: 92px; }
.cat-row-sm { justify-content: flex-start; }

/* ------------------------------------------------------------------ شريط الثقة */
.trust-list {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
	background: var(--panel); border-radius: var(--r-xl); padding: 22px 8px;
}
.trust-list li { display: flex; align-items: center; gap: 14px; padding: 4px 22px; }
.trust-list li + li { border-inline-start: 1px solid #DCDCDC; }
.trust-list b { display: block; font-size: 16px; }
.trust-list small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
body[data-show-trust-bar="false"] .trust-bar { display: none; }

/* ------------------------------------------------------------------ بطاقة الكتاب */
.book-row { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: var(--gap); }
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: var(--gap); }
.listing .book-grid { grid-template-columns: repeat(min(var(--per-row), 4), minmax(0, 1fr)); }
.book-grid-kit { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 992px) {
	body[data-books-per-row="3"] .book-row > :nth-child(n+4),
	body[data-books-per-row="4"] .book-row > :nth-child(n+5),
	body[data-books-per-row="5"] .book-row > :nth-child(n+6),
	body[data-books-per-row="6"] .book-row > :nth-child(n+7) { display: none; }
	body[data-books-per-row="5"], body[data-books-per-row="6"] { --gap: 16px; }
}

.book-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--white); transition: box-shadow .25s, border-color .25s; }
.book-media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.06; background: var(--panel); border-radius: var(--r-md); overflow: hidden; }
.book-media > a { display: grid; place-items: center; width: 100%; height: 100%; }
.book-media img { height: 82%; width: auto; max-width: 78%; object-fit: cover; border-radius: 3px; box-shadow: 0 10px 22px rgba(0, 0, 0, .2); transition: transform .3s; }
.book-card:hover .book-media img { transform: translateY(-4px) scale(1.02); }
.book-body { display: flex; flex-direction: column; gap: 3px; padding-top: 12px; flex: 1; }
.book-author { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.book-title { font-size: 16px; font-weight: 500; line-height: 1.4; min-width: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.book-title a:hover { color: var(--store-primary-dark); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; font-weight: 500; white-space: nowrap; flex: none; }
.rating .icon { width: 16px; height: 16px; }
.rating-count { color: var(--muted); font-size: 12.5px; }
.stars { display: inline-flex; gap: 1px; }
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; color: var(--store-primary-dark); font-weight: 700; font-size: 17px; }
.price del { color: var(--muted); font-weight: 400; font-size: 14px; }
.price-lg { font-size: 28px; font-weight: 800; }
.price-lg del { font-size: 17px; }

.cart-btn {
	display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-md);
	background: var(--tint); color: var(--store-primary-dark); transition: background-color .2s, color .2s;
}
.cart-btn .icon { width: 20px; height: 20px; }
.cart-btn:hover { background: var(--store-primary-dark); color: var(--white); }
.cart-btn:disabled { background: var(--panel); color: #9A9A9A; cursor: not-allowed; }

.type-dot {
	position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; display: grid; place-items: center;
	width: 30px; height: 30px; border-radius: 50%; color: var(--white); box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.type-dot .icon { width: 16px; height: 16px; stroke-width: 2; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-educational); }
.type-dot-xs { position: static; width: 22px; height: 22px; box-shadow: none; }
.type-dot-xs .icon { width: 12px; height: 12px; }
.mini-thumb .type-dot-xs { position: absolute; top: 5px; inset-inline-end: 5px; width: 20px; height: 20px; }

.book-badges { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.badge { display: inline-flex; align-items: center; gap: 2px; padding: 3px 9px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.badge-sale { background: var(--sale); color: var(--white); }
.badge-new { background: var(--store-accent); color: var(--white); }

.wish-btn {
	position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 2; display: grid; place-items: center;
	width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--white); color: var(--store-text);
	box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
}
.wish-btn .icon { width: 18px; height: 18px; }
.book-card:hover .wish-btn, .wish-btn:focus-visible, .wish-btn[aria-pressed="true"] { opacity: 1; transform: none; }
.wish-btn[aria-pressed="true"] .icon { fill: var(--sale); stroke: var(--sale); }
@media (hover: none) { .wish-btn { opacity: 1; transform: none; } }

.stock-band {
	position: absolute; inset-inline: 0; bottom: 0; z-index: 1; padding: 7px; text-align: center;
	background: rgba(35, 35, 35, .88); color: var(--white); font-weight: 700; font-size: 13.5px;
}
.book-card.is-out .book-media img { filter: grayscale(.7); opacity: .75; }
.book-card.is-out .wish-btn { bottom: 44px; }

/* شكل البطاقة */
body[data-card-style="framed"] .book-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); }
body[data-card-style="framed"] .book-card:hover { border-color: color-mix(in srgb, var(--store-primary) 35%, var(--line)); box-shadow: var(--shadow); }
body[data-card-style="classic"] .book-media { border-radius: var(--r-lg); }
body[data-card-style="classic"] .book-card:hover .book-media { background: var(--panel-2); }
body[data-card-style="minimal"] .book-media { aspect-ratio: 2 / 3; background: none; overflow: visible; }
body[data-card-style="minimal"] .book-media img { height: 100%; width: 100%; max-width: none; border-radius: var(--r-md); box-shadow: 0 8px 18px rgba(0, 0, 0, .16); }
body[data-card-style="minimal"] .stock-band { border-radius: 0 0 var(--r-md) var(--r-md); }

/* عرض القائمة في صفحة التصنيف */
.book-grid.is-list { grid-template-columns: 1fr !important; }
.book-grid.is-list .book-card { flex-direction: row; gap: 18px; }
.book-grid.is-list .book-media { width: 150px; flex: none; aspect-ratio: 5 / 6; }
.book-grid.is-list .book-body { padding-top: 4px; }

/* ------------------------------------------------------------------ عروض اليوم + بانر عموديّ */
.deals-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 44px; align-items: stretch; }
.side-banner, .wide-banner, .pair-banner { position: relative; overflow: hidden; isolation: isolate; }
.banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.side-banner { min-height: 520px; border-radius: var(--r-xl); background: var(--panel); }
.side-banner::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(to bottom, var(--panel) 38%, color-mix(in srgb, var(--panel) 0%, transparent) 66%);
}
.banner-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.side-banner .banner-copy { padding: 30px 28px; }
.banner-title { display: block; font-size: 26px; font-weight: 800; line-height: 1.3; }
.side-banner p, .pair-banner .banner-text { color: var(--muted); }
.banner-copy .btn { margin-top: 6px; }

.deals { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.track-wrap { position: relative; }
.book-track { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
.book-track::-webkit-scrollbar { display: none; }
.book-track > .book-card { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); scroll-snap-align: start; }
.track-btn {
	position: absolute; top: 38%; z-index: 3; display: grid; place-items: center; width: 44px; height: 44px;
	border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--store-text); box-shadow: var(--shadow-sm);
}
.track-btn:hover { color: var(--store-primary-dark); border-color: var(--store-primary); }
.track-prev { inset-inline-start: -20px; }
.track-next { inset-inline-end: -20px; }

/* ------------------------------------------------------------------ البانر العريض الداكن */
.wide-banner { min-height: 270px; border-radius: var(--r-xl); background: var(--store-accent); color: var(--on-dark); display: flex; align-items: center; }
.wide-banner .banner-bg { inset-inline-end: 0; inset-inline-start: auto; width: 100%; object-position: left center; }
.wide-banner::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(to left, var(--store-accent) 40%, color-mix(in srgb, var(--store-accent) 0%, transparent) 72%);
}
.wide-banner .banner-copy { padding: 40px 44px; max-width: 600px; }
.wide-banner .eyebrow { color: var(--on-dark-accent); }
.wide-banner .banner-title { font-size: 30px; color: var(--on-dark); }
.wide-banner p { color: var(--on-dark-muted); }

/* ------------------------------------------------------------------ بانران فاتحان */
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pair-banner { --pair-bg: var(--panel); display: flex; align-items: center; min-height: 290px; border-radius: var(--r-xl); background: var(--pair-bg); }
.pair-banner.is-tint { --pair-bg: var(--tint); }
.pair-banner .banner-bg { object-position: left center; }
.pair-banner::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(to left, var(--pair-bg) 46%, color-mix(in srgb, var(--pair-bg) 0%, transparent) 78%);
}
.pair-banner .banner-copy { padding: 34px 36px; max-width: 62%; }
.pair-banner .banner-title { font-size: 24px; }
.pair-banner:hover .btn-primary { background: color-mix(in srgb, var(--store-primary-dark) 82%, #000); }

/* ------------------------------------------------------------------ المؤلّفون */
.author-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.author-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.author-photo { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--r-xl); overflow: hidden; background: var(--panel); margin-bottom: 10px; }
.author-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.author-card:hover .author-photo img { transform: scale(1.04); }
.author-count { color: var(--muted); font-size: 13.5px; }
.author-name { font-size: 19px; font-weight: 700; }
.author-name a:hover { color: var(--store-primary-dark); }
.author-bio { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--store-primary-dark); font-weight: 700; }

/* ------------------------------------------------------------------ التذييل الداكن */
.site-footer { margin-top: 44px; background: var(--store-accent); color: var(--on-dark-muted); padding-top: 60px; }
.foot-grid {
	display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px 48px;
	grid-template-areas: "about c1 c2 c3" "news contact contact contact";
}
.foot-about { grid-area: about; }
.foot-grid > .foot-col:nth-of-type(2) { grid-area: c1; }
.foot-grid > .foot-col:nth-of-type(3) { grid-area: c2; }
.foot-grid > .foot-col:nth-of-type(4) { grid-area: c3; }
.foot-news { grid-area: news; }
.foot-contact { grid-area: contact; }
.site-footer .brand-name { color: var(--on-dark); }
.foot-about p { margin-top: 16px; max-width: 46ch; }
.social { display: flex; gap: 10px; margin-top: 20px; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #444; border-radius: var(--r-md); color: var(--on-dark); background: rgba(255, 255, 255, .04); }
.social a:hover { border-color: var(--on-dark-accent); color: var(--on-dark-accent); }
.social .icon { width: 18px; height: 18px; }
.site-footer h3 { color: var(--on-dark); font-size: 19px; font-weight: 700; margin-bottom: 16px; }
.foot-col li + li { margin-top: 10px; }
.foot-col a:hover { color: var(--on-dark); }
.foot-news h3 { font-size: 22px; margin-bottom: 6px; }
.newsletter { display: flex; gap: 6px; margin-top: 14px; padding: 5px; background: var(--white); border-radius: var(--r-md); }
.newsletter input { flex: 1; min-width: 0; border: 0; padding: 0 12px; background: transparent; color: #232323; outline: none; }
.newsletter input::placeholder { color: #707070; }
.newsletter .btn { border-radius: var(--r-sm); min-height: 42px; padding-inline: 18px; }
.foot-contact ul { display: flex; flex-wrap: wrap; gap: 12px 30px; }
.foot-contact li { display: inline-flex; align-items: center; gap: 8px; }
.foot-contact .icon { color: var(--on-dark-accent); width: 18px; height: 18px; }
.foot-bottom {
	display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px;
	margin-top: 44px; padding-block: 22px; border-top: 1px solid #3A3A3A; font-size: 14px;
}

/* ------------------------------------------------------------------ شريط التبويب السفليّ */
.tabbar { display: none; }
.tabbar a, .tabbar button {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px;
	border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 500; border-radius: var(--r-md);
}
.tab-ico { position: relative; display: grid; place-items: center; }
.tab-ico .icon { width: 22px; height: 22px; }
.tab-ico .count { top: -5px; inset-inline-end: -11px; }
.tabbar [aria-current="page"] { background: var(--tint); color: var(--store-primary-dark); font-weight: 700; }
.tabbar.is-demo { display: flex; max-width: 420px; padding: 6px; gap: 4px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); }

/* ------------------------------------------------------------------ رأس الصفحات الداخليّة */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 4px; color: #A0A0A0; }
.breadcrumb a:hover { color: var(--store-primary-dark); }
.breadcrumb [aria-current] { color: var(--store-text); font-weight: 500; }
.page-head { background: var(--panel); border-radius: var(--r-xl); padding: 28px 34px 30px; }
.page-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 34px; font-weight: 800; line-height: 1.25; }
.count-pill { display: inline-flex; gap: 4px; padding: 4px 12px; border-radius: var(--pill); background: var(--white); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.page-lead { margin-top: 8px; color: var(--muted); max-width: 70ch; }

/* ------------------------------------------------------------------ صفحة التصنيف */
.listing { padding-top: 18px; }
.listing-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 30px; align-items: start; }
.filters { display: flex; flex-direction: column; gap: 14px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters-head h2 { font-size: 20px; font-weight: 800; }
.filters-head .icon-btn { display: none; }
.filter-box { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.filter-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--panel-2); }
.check-list li + li { margin-top: 8px; }
.check-list label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14.5px; }
.check-list input { width: 17px; height: 17px; accent-color: var(--store-primary-dark); margin: 0; flex: none; }
.check-list small { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.check-list .stars .icon { width: 15px; height: 15px; }
.range { width: 100%; accent-color: var(--store-primary-dark); }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.price-inputs label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 10px; }
.price-inputs small { color: var(--muted); }
.price-inputs input { width: 100%; min-width: 0; border: 0; outline: none; background: none; }
.filters-backdrop { display: none; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.filters-toggle { display: none; min-height: 40px; padding-inline: 16px; }
.listing-count { color: var(--muted); font-size: 14.5px; margin-inline-end: auto; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--muted); }
.view-toggle button[aria-pressed="true"] { background: var(--tint); border-color: var(--store-primary); color: var(--store-primary-dark); }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; }
.sort span { color: var(--muted); white-space: nowrap; }
.sort select { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 20px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; padding-inline: 12px 6px; border-radius: var(--pill); background: var(--tint); color: var(--store-primary-dark); font-size: 14px; font-weight: 500; }
.chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--white); color: var(--store-text); padding: 0; }
.chip .icon { width: 13px; height: 13px; }
.chips-clear { color: var(--store-primary-dark); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; }
.page-btn { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-md); font-weight: 700; }
.page-btn:hover { border-color: var(--store-primary); color: var(--store-primary-dark); }
.page-btn[aria-current="page"] { background: var(--store-primary-dark); border-color: var(--store-primary-dark); color: var(--white); }
.page-gap { color: var(--muted); padding: 0 4px; }

/* ------------------------------------------------------------------ صفحة الكتاب */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 330px; gap: 34px; align-items: start; margin-top: 6px; }
.pdp-gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery-main { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.08; background: var(--panel); border-radius: var(--r-xl); }
.gallery-main img { height: 82%; width: auto; border-radius: 4px; box-shadow: 0 16px 34px rgba(0, 0, 0, .22); }
.gallery-main .type-dot { top: 16px; inset-inline-end: 16px; width: 38px; height: 38px; }
.gallery-main .type-dot .icon { width: 20px; height: 20px; }
.thumbs { display: flex; gap: 10px; }
.thumbs button { display: grid; place-items: center; width: 82px; height: 92px; padding: 0; border: 2px solid transparent; border-radius: var(--r-md); background: var(--panel); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.thumbs img { height: 72px; width: auto; border-radius: 2px; }

.pdp-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pdp-type { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); }
.pdp-title { font-size: 34px; line-height: 1.25; font-weight: 800; }
.pdp-author { color: var(--muted); }
.pdp-author a { color: var(--store-primary-dark); font-weight: 700; }
.pdp-rating { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; }
.pdp-rating .rating { color: var(--store-text); }
.pdp-rating .rating b { margin-inline-start: 4px; }
.pdp-lead { color: #4A4A4A; font-size: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; margin: 6px 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.facts div { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.facts div:nth-last-child(-n+2):nth-child(odd), .facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 700; font-size: 15px; }
.edu-facts { display: flex; flex-wrap: wrap; gap: 10px; }
.edu-facts li { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: var(--r-lg); background: var(--tint); }
.edu-facts .icon { color: var(--store-primary-dark); width: 24px; height: 24px; }
.edu-facts small { display: block; color: #4A4A4A; font-size: 12.5px; }
.edu-facts b { display: block; }
.audio-sample { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; border-radius: var(--r-lg); background: var(--panel); }
.play-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--store-primary-dark); color: var(--white); }
.play-btn .icon { fill: currentColor; width: 18px; height: 18px; }
.wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; min-width: 0; overflow: hidden; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--store-primary) 55%, #FFFFFF); }
.wave i:nth-child(-n+8) { background: var(--store-primary); }

.buy-box { position: sticky; top: calc(var(--head-h) + 16px); display: flex; flex-direction: column; gap: 12px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--white); box-shadow: var(--shadow-sm); }
.buy-price { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: #1E6B45; font-weight: 700; font-size: 14px; }
.stock .icon { width: 18px; height: 18px; }
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.buy-label { font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.qty button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--panel); }
.qty button:hover { background: var(--tint); color: var(--store-primary-dark); }
.qty .icon { width: 16px; height: 16px; }
.qty input { width: 46px; border: 0; text-align: center; font-weight: 700; background: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm button { width: 30px; height: 30px; }
.qty-sm input { width: 36px; }
.buy-box .btn-link { align-self: center; }
.buy-perks { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: #4A4A4A; }
.buy-perks li { display: flex; align-items: center; gap: 10px; }
.buy-perks .icon { color: var(--store-primary-dark); }

.pdp-tabs {
	position: sticky; top: calc(var(--head-h) + 8px); z-index: 20; display: flex; gap: 6px; margin-top: 26px; padding: 6px;
	background: var(--panel); border-radius: var(--pill); width: max-content; max-width: 100%; overflow-x: auto;
}
.pdp-tabs a { padding: 8px 20px; border-radius: var(--pill); font-weight: 700; white-space: nowrap; }
.pdp-tabs a:hover, .pdp-tabs a:first-child { background: var(--white); color: var(--store-primary-dark); box-shadow: var(--shadow-sm); }
.pdp-sections { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.pdp-block { border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px 28px; scroll-margin-top: 70px; }
.prose p + p { margin-top: 12px; }
.prose { color: #3D3D3D; font-size: 15.5px; line-height: 1.85; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 10px 4px; border-bottom: 1px solid var(--panel-2); text-align: start; font-size: 14.5px; }
.spec-table th { color: var(--muted); font-weight: 500; width: 42%; }
.spec-table td { font-weight: 700; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.reviews-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 34px; align-items: start; }
.reviews-summary { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px; background: var(--panel); border-radius: var(--r-lg); }
.reviews-summary strong { font-size: 48px; line-height: 1; font-weight: 800; }
.reviews-summary .stars .icon { width: 20px; height: 20px; }
.rating-bars { width: 100%; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.rating-bars li { display: grid; grid-template-columns: 12px 16px 1fr 38px; align-items: center; gap: 6px; font-size: 13.5px; }
.rating-bars .icon { width: 14px; height: 14px; }
.bar { height: 7px; border-radius: var(--pill); background: #E0E0E0; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.review-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.review-top > div { flex: 1; min-width: 0; }
.review-top b { display: block; }
.review-top small { color: var(--muted); font-size: 13px; }
.review-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--tint); color: var(--store-primary-dark); font-weight: 800; }
.review-card p { color: #3D3D3D; }
.verified { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; color: #1E6B45; font-size: 13px; font-weight: 500; }
.verified .icon { width: 15px; height: 15px; }
.review-form { margin-top: 18px; padding: 22px; border-radius: var(--r-lg); background: var(--panel); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.review-form h3 { font-size: 19px; font-weight: 800; }
.review-form label { font-weight: 700; font-size: 14.5px; }
.review-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); resize: vertical; }
.review-form textarea:focus { outline: none; border-color: var(--store-primary); box-shadow: 0 0 0 3px var(--tint); }
.star-pick { display: flex; gap: 4px; }
.star-pick button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; background: none; }
.star-pick .icon { width: 26px; height: 26px; }
.star-pick button[aria-checked="true"] ~ button .icon { fill: var(--line); stroke: var(--line); }

/* ------------------------------------------------------------------ صفحة المؤلّف */
.author-hero { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; }
.author-hero-photo { background: var(--panel); border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 1; }
.author-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.author-hero-info { background: var(--panel); border-radius: var(--r-xl); padding: 40px 42px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.author-hero-info .hero-title { max-width: none; font-size: 40px; }
.author-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.author-stats li { padding: 10px 18px; border-radius: var(--r-lg); background: var(--white); }
.author-stats b { display: block; font-size: 22px; font-weight: 800; color: var(--store-primary-dark); line-height: 1.2; }
.author-stats small { color: var(--muted); font-size: 13px; }
.book-grid-wide { grid-template-columns: repeat(min(var(--per-row), 5), minmax(0, 1fr)); }

/* ------------------------------------------------------------------ السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 30px; align-items: start; margin-top: 20px; }
.cart-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.cart-table th { padding: 14px 16px; background: var(--panel); text-align: start; font-size: 14.5px; font-weight: 700; }
.cart-table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.cart-book { display: flex; align-items: center; gap: 14px; }
.cart-thumb { display: grid; place-items: center; width: 78px; height: 90px; flex: none; border-radius: var(--r-md); background: var(--panel); }
.cart-thumb img { height: 72px; width: auto; border-radius: 2px; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); }
.cart-title { display: block; font-weight: 700; font-size: 16px; }
.cart-book small { display: block; color: var(--muted); font-size: 13.5px; }
.cart-type { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.item-total { font-size: 16px; }
.c-remove { width: 56px; }
.cart-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; background: var(--panel); border-radius: var(--r-xl); }
.cart-empty h2, .cart-empty h3 { font-size: 22px; font-weight: 800; }
.cart-empty p { color: var(--muted); }
.summary { position: sticky; top: calc(var(--head-h) + 16px); display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--panel); border-radius: var(--r-xl); }
.summary h2 { font-size: 21px; font-weight: 800; }
.coupon label { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.coupon-row { display: flex; gap: 6px; padding: 4px; background: var(--white); border: 1px solid var(--line); border-radius: var(--pill); }
.coupon-row input { flex: 1; min-width: 0; border: 0; background: none; padding: 0 12px; outline: none; }
.coupon-row .btn { min-height: 40px; padding-inline: 18px; }
.coupon-applied { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 8px 8px 12px; padding-inline: 12px 8px; border-radius: var(--r-md); background: var(--white); color: #1E6B45; font-size: 14px; }
.coupon-applied span { flex: 1; }
.coupon-applied button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--panel); color: var(--store-text); padding: 0; }
.coupon-applied .icon { width: 16px; height: 16px; }
.coupon-applied button .icon { width: 13px; height: 13px; }
.sum-rows { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sum-rows div { display: flex; justify-content: space-between; gap: 10px; }
.sum-rows dt { color: #4A4A4A; }
.sum-rows dd { margin: 0; font-weight: 700; }
.sum-rows .is-discount dd { color: #1E6B45; }
.sum-total { padding-top: 12px; border-top: 1px solid #DADADA; font-size: 19px; }
.sum-total dt { color: var(--store-text); font-weight: 800; }
.sum-total dd { color: var(--store-primary-dark); font-weight: 800; }
.summary .buy-perks { border-top-color: #DADADA; }

/* ------------------------------------------------------------------ 404 */
.nf-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px 24px 54px; text-align: center; background: var(--panel); border-radius: var(--r-xl); }
.nf-art { position: relative; display: grid; place-items: center; }
.nf-num { font-size: 170px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: #E3E3E3; }
.nf-book { position: absolute; display: flex; bottom: 20px; }
.nf-book i { display: block; width: 62px; height: 84px; background: var(--white); border: 2px solid var(--store-primary); }
.nf-book i:first-child { border-radius: 8px 2px 2px 8px; transform: skewY(8deg); border-inline-start-width: 6px; }
.nf-book i:last-child { border-radius: 2px 8px 8px 2px; transform: skewY(-8deg); border-inline-end-width: 6px; }
.nf-title { font-size: 32px; font-weight: 800; }
.nf-text { color: var(--muted); max-width: 52ch; }
.nf-search { width: 100%; max-width: 560px; flex: none; margin: 8px 0 4px; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ------------------------------------------------------------------ components.html */
.kit-block { padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--r-xl); margin-bottom: 20px; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.kit-row .pagination { margin: 0; }
.kit-controls { display: flex; flex-direction: column; gap: 10px; }
.kit-controls div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kit-controls b { min-width: 170px; }
.kit-controls button { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--white); font-size: 14px; }
.kit-controls button[aria-pressed="true"] { background: var(--store-primary-dark); border-color: var(--store-primary-dark); color: var(--white); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.swatches li { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.swatch { height: 64px; border-radius: var(--r-md); border: 1px solid var(--line); }
.swatches small { color: var(--muted); }
.kit-type { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.kit-dots { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.kit-dots li { display: inline-flex; align-items: center; gap: 8px; }
.kit-dots .type-dot { position: static; }
.kit-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 30px; align-items: start; }
.kit-split .cat-row { justify-content: flex-start; }
.author-grid-kit { grid-template-columns: 1fr; }

/* ==================================================================== العروض */
@media (max-width: 1199px) {
	.head-main-in { gap: 20px; }
	.nav-links { gap: 20px; }
	.hero-title { font-size: 38px; }
	.hero-text { padding: 40px 32px 200px; }
	.hero + .hero-books { inset-inline-end: calc(var(--gutter) + 22px); width: calc((100% - 2 * var(--gutter) - 24px) / 2 - 44px); }
	.pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.buy-box { grid-column: 1 / -1; position: static; }
	.deals-grid { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 30px; }
	.foot-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 36px 30px; }
}

@media (max-width: 991px) {
	html { --head-h: 122px; }
	.head-nav, .head-contact { display: none; }
	.drawer .head-contact { display: inline-flex; margin-top: 6px; }
	.menu-toggle, .head-cart-sm { display: inline-grid; }
	.head-main-in { flex-wrap: wrap; gap: 8px 12px; min-height: 0; padding-block: 12px; }
	.brand { margin-inline-end: auto; }
	.head-search { order: 5; flex-basis: 100%; max-width: none; }
	.topbar-link { display: none; }

	.hero-slide { grid-template-columns: 1fr; gap: 14px; }
	.hero-media { min-height: 0; aspect-ratio: 7 / 5; }
	.hero-text { padding: 30px 26px 180px; }
	.hero-dots { top: 14px; bottom: auto; width: 100%; }
	.hero + .hero-books { inset-inline: calc(var(--gutter) + 18px); width: auto; bottom: 26px; }

	.book-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.book-row > :nth-child(n+4) { display: none; }
	.book-grid, .listing .book-grid, .book-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.trust-list { grid-template-columns: 1fr 1fr; row-gap: 18px; }
	.trust-list li:nth-child(3) { border-inline-start: 0; }
	.deals-grid { grid-template-columns: 1fr; }
	.side-banner { min-height: 300px; }
	.side-banner::before { background: linear-gradient(to left, var(--panel) 45%, color-mix(in srgb, var(--panel) 0%, transparent) 80%); }
	.side-banner .banner-bg { object-position: left bottom; }
	.side-banner .banner-copy { max-width: 60%; }
	.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pair-grid { grid-template-columns: 1fr; }
	.mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.foot-grid { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "about about about" "c1 c2 c3" "news news news" "contact contact contact"; }

	.listing-grid { grid-template-columns: 1fr; }
	.filters {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 90; width: min(340px, 88vw);
		padding: 18px; overflow-y: auto; background: var(--white);
		transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
	}
	.filters-open .filters { transform: none; visibility: visible; }
	.filters-head .icon-btn { display: inline-grid; }
	.filters-backdrop { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(15, 15, 15, .45); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
	.filters-open .filters-backdrop { opacity: 1; visibility: visible; }
	.filters-toggle { display: inline-flex; }

	.pdp-sections { grid-template-columns: 1fr; }
	.reviews-layout { grid-template-columns: 1fr; }
	.author-hero { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }
	.author-hero-info { padding: 28px; }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.kit-split { grid-template-columns: 1fr; }
	.swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	body { font-size: 14.5px; }
	body[data-show-tab-bar="true"] { padding-bottom: 68px; }
	.tabbar {
		display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 70; gap: 2px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
		background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06);
	}
	.tabbar.is-demo { position: static; box-shadow: none; padding-bottom: 6px; }
	body[data-show-tab-bar="false"] .tabbar:not(.is-demo) { display: none; }

	.section { padding-block: 32px; }
	.section-title { font-size: 24px; }
	.section-head { margin-bottom: 16px; }
	.brand-name { font-size: 20px; }
	.brand img { width: 38px; height: 38px; }
	.topbar { font-size: 12.5px; }
	.topbar-in { min-height: 34px; }
	.topbar-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

	.hero-wrap { padding-top: 16px; }
	.hero-media { aspect-ratio: 1 / .78; border-radius: var(--r-lg); }
	.hero-text { border-radius: var(--r-lg); padding: 24px 20px 170px; gap: 10px; }
	.hero-title { font-size: 29px; }
	.hero-text p { font-size: 15px; }
	.hero + .hero-books { inset-inline: calc(var(--gutter) + 12px); bottom: 20px; }
	.mini-track .mini-card { flex-basis: 230px; }

	.cat-row { justify-content: flex-start; gap: 12px; }
	.cat-row a { width: 96px; }
	.cat-img { width: 86px; height: 86px; }
	.cat-name { font-size: 14px; }

	:root { --gap: 12px; }
	.book-row, .book-grid, .listing .book-grid, .book-grid-wide, .book-grid-kit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.book-row > :nth-child(n+4) { display: flex; }
	.book-row > :nth-child(n+5) { display: none; }
	body[data-card-style="framed"] .book-card { padding: 8px; }
	.book-title-row { flex-direction: column; gap: 0; }
	.book-title { -webkit-line-clamp: 2; font-size: 15px; }
	.price { font-size: 15.5px; }
	.price del { font-size: 12.5px; }
	.cart-btn { width: 36px; height: 36px; }
	.type-dot { width: 26px; height: 26px; top: 8px; inset-inline-end: 8px; }
	.type-dot .icon { width: 14px; height: 14px; }
	.book-badges { top: 8px; inset-inline-start: 8px; }
	.badge { font-size: 11.5px; padding: 2px 7px; }
	.book-grid.is-list .book-media { width: 110px; }

	.trust-list { grid-template-columns: 1fr; padding: 10px 6px; row-gap: 0; }
	.trust-list li { padding: 12px 14px; }
	.trust-list li + li { border-inline-start: 0; border-top: 1px solid #DCDCDC; }

	.book-track > .book-card { flex-basis: calc((100% - var(--gap)) / 2); }
	.track-btn { width: 38px; height: 38px; }
	.track-prev { inset-inline-start: -8px; }
	.track-next { inset-inline-end: -8px; }
	.side-banner .banner-copy { max-width: none; padding: 24px 20px; }
	.side-banner { min-height: 470px; }
	.side-banner::before { background: linear-gradient(to bottom, var(--panel) 46%, color-mix(in srgb, var(--panel) 0%, transparent) 78%); }
	.side-banner .banner-bg { object-position: center bottom; }
	.banner-title { font-size: 22px; }

	.wide-banner { min-height: 0; align-items: flex-end; }
	.wide-banner .banner-bg { height: 52%; top: 0; bottom: auto; object-position: 20% center; }
	.wide-banner::before { background: linear-gradient(to top, var(--store-accent) 52%, color-mix(in srgb, var(--store-accent) 0%, transparent) 80%); }
	.wide-banner .banner-copy { padding: 150px 22px 26px; }
	.wide-banner .banner-title { font-size: 23px; }

	.pair-banner { min-height: 0; align-items: flex-end; }
	.pair-banner .banner-bg { height: 55%; object-position: 15% center; }
	.pair-banner::before { background: linear-gradient(to top, var(--pair-bg) 50%, color-mix(in srgb, var(--pair-bg) 0%, transparent) 78%); }
	.pair-banner .banner-copy { max-width: none; padding: 140px 22px 26px; }
	.pair-banner .banner-title { font-size: 21px; }

	.author-grid { gap: 16px; }
	.author-name { font-size: 16.5px; }
	.author-photo { border-radius: var(--r-lg); }
	.mini-grid { grid-template-columns: 1fr; }

	.site-footer { padding-top: 40px; }
	.foot-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "about about" "c1 c2" "c3 c3" "news news" "contact contact"; gap: 28px 20px; }
	.foot-contact ul { flex-direction: column; gap: 10px; }
	.foot-bottom { margin-top: 30px; justify-content: center; text-align: center; }

	.page-head { padding: 20px 18px 22px; border-radius: var(--r-lg); }
	.page-title { font-size: 26px; }
	.toolbar { padding: 10px; gap: 10px; }
	.listing-count { flex-basis: 100%; order: -1; margin: 0; }
	.view-toggle { margin-inline-start: auto; }
	.sort span { display: none; }
	.sort select { max-width: 150px; }

	.pdp { grid-template-columns: 1fr; gap: 22px; }
	.pdp-title { font-size: 27px; }
	.gallery-main { aspect-ratio: 1 / .95; border-radius: var(--r-lg); }
	.pdp-block { padding: 20px 18px; border-radius: var(--r-lg); }
	.facts { grid-template-columns: 1fr 1fr; }
	.pdp-tabs { width: 100%; }
	.pdp-tabs a { padding: 8px 14px; flex: 1; text-align: center; }

	.author-hero { grid-template-columns: 1fr; }
	.author-hero-photo { max-width: 360px; width: 100%; }
	.author-hero-info .hero-title { font-size: 30px; }
	.author-hero-info { padding: 22px 20px; }

	.cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; }
	.cart-table { border: 0; border-radius: 0; overflow: visible; }
	.cart-table thead { display: none; }
	.cart-table tr { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; }
	.cart-table td { border: 0; padding: 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
	.cart-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13.5px; }
	.cart-table td.c-book { padding-inline-end: 44px; }
	.c-remove { position: absolute; top: 10px; inset-inline-end: 8px; width: auto; padding: 0 !important; }

	.nf-num { font-size: 110px; }
	.nf-book { bottom: 10px; }
	.nf-book i { width: 42px; height: 56px; }
	.nf-title { font-size: 24px; }
	.kit-block { padding: 18px 16px; }
	.kit-controls b { min-width: 100%; }
	.swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* ==================================================================
   ميزات المنصّة المعتمدة: عدّاد العروض، والنظرة السريعة، والمدوّنة
   ================================================================== */

/* عدّاد «عروض اليوم» بجانب العنوان */
.deals .section-head { flex-wrap: wrap; }
.deal-timer { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.deal-timer[hidden] { display: none; }
.deal-timer-label { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.countdown { display: flex; gap: 6px; }
.countdown span {
	display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 5px 4px;
	border-radius: var(--r-md); background: var(--store-primary-dark); color: var(--white); line-height: 1.2;
}
.countdown b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown small { font-size: 11px; opacity: .92; }

/* زرّ النظرة السريعة: فوق زرّ المفضّلة، ويظهر معه */
.qv-btn {
	position: absolute; bottom: 54px; inset-inline-end: 10px; z-index: 2; display: grid; place-items: center;
	width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--white); color: var(--store-text);
	box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s, color .2s;
}
.qv-btn .icon { width: 18px; height: 18px; }
.qv-btn:hover { color: var(--store-primary-dark); }
.book-card:hover .qv-btn, .qv-btn:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .qv-btn { opacity: 1; transform: none; } }
.book-card.is-out .qv-btn { bottom: 88px; }

/* المدوّنة: بطاقةٌ بصورةٍ مستديرة كبطاقة المؤلّف */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.post-photo { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-xl); overflow: hidden; background: var(--panel); margin-bottom: 10px; }
.post-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-photo img { transform: scale(1.04); }
.post-date { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.post-date .icon { width: 15px; height: 15px; }
.post-title { font-size: 19px; font-weight: 700; line-height: 1.4; }
.post-title a:hover { color: var(--store-primary-dark); }
.post-excerpt { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-grid-page { margin-bottom: 36px; }
.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-xl); }
.post-content { margin-top: 28px; font-size: 17px; line-height: 2; }
.post-content p + p { margin-top: 16px; }
.post-back { margin-top: 28px; }

@media (max-width: 991px) {
	.deal-timer { margin-inline-start: 0; flex-basis: 100%; order: 3; }
	.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: flex; }
	.deal-timer { flex-wrap: wrap; gap: 6px 10px; }
	.post-content { font-size: 16px; }
}

/* ==================================================================
   الإصدار الثاني: خلفيّات الأقسام، والتبويبات، وكتاب الأسبوع،
   والقائمة المرقّمة، وآراء القرّاء، واختيار الصيغة
   ================================================================== */

/* أقسامٌ بخلفيّةٍ بعرض الشاشة، تتناوب مع الأقسام البيضاء */
.band { margin-block: 8px; }
.band-tint { background: var(--tint); }
.band-panel { background: var(--panel); }
.band + .band { margin-top: 0; }

/* تبويبات صفّ الكتب (القاعدة 16): كبسولاتٌ كبحث الرأس */
.section-head.has-tabs { flex-wrap: wrap; align-items: center; }
.section-head.has-tabs > div:first-child { margin-inline-end: auto; }
.row-tabs { display: flex; gap: 6px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: var(--pill); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.row-tabs::-webkit-scrollbar { display: none; }
.row-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--pill); background: none; color: var(--store-text); font-weight: 700; font-size: 14.5px; white-space: nowrap; transition: background-color .2s, color .2s; }
.row-tab:hover { color: var(--store-primary-dark); }
.row-tab[aria-selected="true"] { background: var(--store-primary-dark); color: var(--white); }
.row-tab img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* كتاب الأسبوع: لوحتان رماديّتان كالواجهة */
.week-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; }
.week-media { position: relative; display: grid; place-items: center; padding: 34px; background: var(--panel); border-radius: var(--r-xl); }
.week-media > a { display: block; }
.week-media img { width: min(250px, 100%); height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 18px 36px rgba(0, 0, 0, .22); transform: rotate(-2deg); transition: transform .3s; }
.week-card:hover .week-media img { transform: rotate(0); }
.week-media .type-dot { top: 18px; inset-inline-end: 18px; width: 36px; height: 36px; }
.week-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 38px 40px; background: var(--panel); border-radius: var(--r-xl); }
.week-title { font-size: 34px; font-weight: 800; line-height: 1.25; }
.week-title a:hover { color: var(--store-primary-dark); }
.week-body .rating b { margin-inline-start: 4px; }
.week-desc { color: #4A4A4A; max-width: 62ch; }
.week-desc p + p { margin-top: 8px; }
.week-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.week-facts li { padding: 8px 16px; border-radius: var(--r-lg); background: var(--white); }
.week-facts small { display: block; color: var(--muted); font-size: 12.5px; }
.week-facts b { font-size: 15px; }
.week-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 8px; }
.icon-sq { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); color: var(--store-text); }
.icon-sq:hover { color: var(--store-primary-dark); border-color: var(--store-primary); }
.icon-sq[aria-pressed="true"] .icon { fill: var(--sale); stroke: var(--sale); }

/* القائمة المرقّمة المدمجة (الصفّ الثالث): ستّ بطاقاتٍ أفقيّة برقمٍ كبير */
.rank-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: rank; }
.rank-card { counter-increment: rank; position: relative; display: grid; grid-template-columns: 34px 92px minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px 16px; background: var(--white); border-radius: var(--r-lg); transition: box-shadow .25s; }
.rank-card:hover { box-shadow: var(--shadow); }
.rank-card::before { content: counter(rank, decimal-leading-zero); font-size: 26px; font-weight: 800; line-height: 1; color: var(--store-primary-dark); font-variant-numeric: tabular-nums; }
.rank-thumb { position: relative; display: block; }
.rank-thumb img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.rank-thumb .type-dot-xs { position: absolute; top: 6px; inset-inline-end: 6px; width: 22px; height: 22px; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); }
.rank-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.rank-body .book-title { -webkit-line-clamp: 2; font-weight: 700; }
.rank-body .book-author { max-width: 100%; }
.rank-body .book-foot { width: 100%; margin-top: 4px; }

/* آراء القرّاء: ثلاث بطاقات، ورقم تقييم المتجر بجانب العنوان */
body[data-show-reviews="false"] .home-reviews { display: none; }
.store-score { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px 18px; background: var(--white); border-radius: var(--r-lg); }
.store-score-num { font-size: 30px; font-weight: 800; line-height: 1; }
.store-score .icon { width: 18px; height: 18px; }
.store-score small { color: var(--muted); font-size: 13.5px; }
.quote-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.quote-card { margin: 0; display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--white); border-radius: var(--r-xl); }
.quote-card .stars .icon { width: 18px; height: 18px; }
.quote-card blockquote { margin: 0; color: #3D3D3D; font-size: 15.5px; line-height: 1.8; }
.quote-card figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.quote-card figcaption b { display: block; }
.quote-card figcaption small { color: var(--muted); font-size: 13px; }

/* اختيار الصيغة في صفحة الكتاب (book.formats) */
.formats-box { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.formats-label { font-weight: 700; font-size: 14px; }
.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.format-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); transition: border-color .2s; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt.is-current { border: 2px solid var(--store-primary); background: var(--tint); padding: 9px 11px; }
.format-top { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.format-opt .type-dot-xs { width: 20px; height: 20px; }
.format-price { color: var(--store-primary-dark); font-weight: 700; font-size: 14.5px; }

/* عن المؤلّف تحت الوصف في صفحة الكتاب */
.pdp-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.author-mini { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 16px; }
.author-mini img { width: 84px; height: 84px; border-radius: var(--r-lg); object-fit: cover; }
.author-mini small { color: var(--muted); font-size: 13px; }
.author-mini b { display: block; font-size: 18px; }
.author-mini p { color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* أعمال المؤلّف: صفٌّ يُمرَّر بسهمين، فلا يبقى صفٌّ ناقص */
.works-track > .book-card { flex-basis: calc((100% - 3 * var(--gap)) / 4); }

@media (max-width: 1199px) {
	.rank-card { grid-template-columns: 28px 76px minmax(0, 1fr); gap: 12px; padding: 12px; }
	.rank-card::before { font-size: 22px; }
	.week-body { padding: 30px; }
	.week-title { font-size: 30px; }
}
@media (min-width: 768px) and (max-width: 991px) {
	/* الواجهة في الجهاز اللوحيّ: اللوحتان متجاورتان بدل صورةٍ تملأ الشاشة */
	.hero-slide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
	.hero-media { aspect-ratio: auto; min-height: 440px; }
	.hero-text { padding: 30px 24px 190px; }
	.hero-title { font-size: 31px; }
	.hero-dots { top: auto; bottom: 18px; width: calc(50% - 8px); }
	.hero + .hero-books { inset-inline: auto calc(var(--gutter) + 16px); inset-inline-start: auto; width: calc((100% - 2 * var(--gutter) - 16px) / 2 - 32px); }
	.mini-track .mini-card { flex-basis: 220px; }
	.side-banner { min-height: 280px; }
}
@media (max-width: 991px) {
	.rank-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.quote-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.quote-row::-webkit-scrollbar { display: none; }
	.quote-card { flex: 0 0 min(340px, 78%); scroll-snap-align: start; }
	.week-card { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; }
	.week-media { padding: 24px; }
	.works-track > .book-card { flex-basis: calc((100% - 2 * var(--gap)) / 3); }
}
@media (max-width: 767px) {
	.band { margin-block: 4px; }
	.section-head.has-tabs { gap: 12px; }
	.row-tabs { order: 3; flex-basis: 100%; border-radius: var(--r-lg); }
	.row-tab { min-height: 40px; padding: 0 14px; }

	/* الواجهة في الهاتف: صورةٌ أقصر، فيظهر أوّل صفّ كتبٍ أسرع */
	.hero-media { aspect-ratio: 16 / 10; }
	.hero-text { padding-bottom: 150px; }

	/* شريط الثقة: شريطٌ واحد يُمرَّر أفقيًّا */
	.trust-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; padding: 10px 4px; }
	.trust-list::-webkit-scrollbar { display: none; }
	.trust-list li { flex: 0 0 auto; padding: 4px 14px; gap: 10px; scroll-snap-align: start; }
	.trust-list li + li { border-top: 0; border-inline-start: 1px solid #DCDCDC; }
	.trust-list .sq-ico { width: 38px; height: 38px; }
	.trust-list b { font-size: 14.5px; white-space: nowrap; }
	.trust-list small { font-size: 12.5px; white-space: nowrap; }

	.side-banner { min-height: 380px; }

	.week-card { grid-template-columns: 1fr; gap: 12px; }
	.week-media { padding: 26px; border-radius: var(--r-lg); }
	.week-media img { width: 170px; }
	.week-body { padding: 22px 20px; border-radius: var(--r-lg); }
	.week-title { font-size: 25px; }
	.week-actions .btn { flex: 1; }

	.rank-list { grid-template-columns: 1fr; gap: 10px; }
	.rank-card { grid-template-columns: 26px 64px minmax(0, 1fr); padding: 10px 12px; }
	.rank-card::before { font-size: 20px; }

	.store-score { padding: 8px 14px; }
	.store-score-num { font-size: 24px; }
	.quote-card { padding: 20px; }

	.formats { gap: 6px; }
	.format-opt { padding: 8px; }
	.format-opt.is-current { padding: 7px; }
	.works-track > .book-card { flex-basis: calc((100% - var(--gap)) / 2); }
}

/* جدول الحقائق: الخانة الأخيرة المنفردة تأخذ السطر كلّه، فلا تبقى خانةٌ فارغة */
.facts div:last-child:nth-child(odd) { grid-column: 1 / -1; border-inline-end: 0; }
.box-list { margin-top: 6px; padding-inline-start: 20px; list-style: disc; }
.box-list li + li { margin-top: 4px; }
@media (max-width: 767px) {
	.hero-media img { object-position: center bottom; }
	/* المدوّنة في الهاتف: صفٌّ يُمرَّر بدل ثلاث بطاقاتٍ طويلة */
	.post-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; }
	.post-grid::-webkit-scrollbar { display: none; }
	.post-grid > .post-card { flex: 0 0 82%; scroll-snap-align: start; }
	.post-grid-page { display: grid; overflow: visible; }
	.post-grid-page > .post-card { flex: none; }
}

.kit-formats { max-width: 460px; }
.kit-block .rank-list, .kit-block .quote-row { margin-top: 4px; }

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