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

:root {
	/* ألوان المتجر (قيم تجريبيّة) */
	--store-primary: #456173;
	--store-primary-dark: #213440;
	--store-accent: #213440;
	--store-bg: #FFFFFF;
	--store-text: #232323;

	/* ألوان محايدة ومشتقّة */
	--muted: #6B6B6B;
	--line: #E3E6E9;
	--soft: #F6F7F8;
	--white: #FFFFFF;
	--sale: #C62828;
	--gold: #F5B301;
	--tint: color-mix(in srgb, var(--store-primary) 9%, #FFFFFF);
	--tint-2: color-mix(in srgb, var(--store-primary) 16%, #FFFFFF);

	--font: "Tajawal", system-ui, sans-serif;
	--radius: 16px;
	--radius-sm: 10px;
	--pill: 999px;
	--shadow: 0 18px 40px -22px rgba(20, 30, 40, .35);
	--container: 1296px;
	--gutter: 24px;
	--per-row: 4;
}

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

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; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.7;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: hidden;
}
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, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--store-primary); outline-offset: 2px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 26px;
	border: 1.5px solid transparent; border-radius: var(--pill);
	font-weight: 700; font-size: 15px; line-height: 1.2;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
	white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn-dark { background: var(--store-primary-dark); color: var(--white); }
.btn-dark:hover { background: var(--store-primary); }
.btn-outline { background: var(--white); color: var(--store-primary-dark); border-color: color-mix(in srgb, var(--store-primary-dark) 35%, #FFFFFF); }
.btn-outline:hover { border-color: var(--store-primary-dark); background: var(--tint); }
.btn-lg { min-height: 52px; padding-inline: 32px; font-size: 16px; }
.btn-sm { min-height: 38px; padding: 6px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-text { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--store-primary-dark); font-weight: 700; }
.btn-text .icon { width: 18px; height: 18px; }
.btn-text[aria-pressed="true"] .icon { fill: currentColor; }
.link-more { display: inline-flex; align-items: center; gap: 6px; color: var(--store-primary-dark); font-weight: 700; white-space: nowrap; }
.link-more .icon { width: 18px; height: 18px; transition: transform .2s; }
.link-more:hover .icon { transform: translateX(-4px); }
.icon-btn {
	position: relative; display: inline-grid; place-items: center;
	width: 42px; height: 42px; border: 0; border-radius: 50%;
	background: transparent; color: var(--store-text);
}
.icon-btn:hover { background: var(--soft); }
.icon-btn .icon { width: 22px; height: 22px; }
.count {
	position: absolute; top: 1px; inset-inline-end: 0;
	min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
	background: var(--store-primary-dark); color: var(--white);
	font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 14px; border-radius: var(--pill);
	background: var(--tint); color: var(--store-primary-dark);
	font-size: 13px; font-weight: 700;
}
.field {
	min-height: 44px; padding: 8px 14px; width: 100%;
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	background: var(--white);
}
.field:focus { border-color: var(--store-primary); outline: none; }

/* ---------------------------------------------------------------- شريط الإعلان */
.announce { background: var(--store-accent); color: var(--white); font-size: 14px; text-align: center; }
.announce p { padding-block: 9px; }
.announce a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-inline-start: 6px; }
.announce:empty, .announce p:empty { display: none; }

/* ---------------------------------------------------------------- الرأس */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: var(--store-primary-dark); }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav > ul { display: flex; align-items: center; gap: 6px; }
.main-nav > ul > li > a, .drop-btn {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 8px 12px; border: 0; background: none; border-radius: var(--pill);
	font-weight: 500; font-size: 16px;
}
.main-nav > ul > li > a:hover, .drop-btn:hover { color: var(--store-primary); }
.has-drop { position: relative; }
.drop {
	position: absolute; top: calc(100% + 10px); inset-inline-start: 50%; transform: translateX(50%);
	display: none; grid-template-columns: 1fr 1fr; gap: 24px;
	width: 440px; padding: 22px 24px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.has-drop.open .drop { display: grid; }
.drop a { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.drop a:hover { color: var(--store-primary); }
.drop-types { border-inline-start: 1px solid var(--line); padding-inline-start: 22px; }
.t-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.header-actions { display: flex; align-items: center; gap: 2px; }
.menu-toggle { display: none; }
.search-panel { display: none; border-top: 1px solid var(--line); background: var(--soft); }
.search-open .search-panel { display: block; }
.search-row { display: flex; gap: 10px; padding-block: 14px; }
.search-row input { flex: 1; min-height: 48px; padding: 8px 20px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--white); }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 22, 28, .45); opacity: 0; visibility: hidden; transition: .25s; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
	width: min(330px, 86vw); padding: 18px; overflow-y: auto;
	background: var(--white); display: none; box-shadow: var(--shadow);
}
.drawer-open .drawer { display: block; animation: drawer-in .25s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head .brand { font-size: 19px; }
.drawer-search { display: flex; border: 1px solid var(--line); border-radius: var(--pill); margin-bottom: 10px; }
.drawer-search input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 16px; }
.drawer-search button { border: 0; background: none; padding: 0 14px; color: var(--store-primary-dark); }
.drawer-nav > li > a, .drawer-nav summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); font-weight: 500; cursor: pointer; list-style: none; }
.drawer-nav summary::-webkit-details-marker { display: none; }
.drawer-nav details[open] summary .icon { transform: rotate(180deg); }
.drawer-nav .sub { display: grid; padding: 6px 14px 10px; }
.drawer-nav .sub a { padding: 7px 0; color: var(--muted); }
.drawer-help { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--store-primary-dark); font-weight: 700; }

/* ---------------------------------------------------------------- عناوين الأقسام */
.section { padding-block: 44px; }
.section-tight { padding-block: 20px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-title { font-size: clamp(26px, 3vw, 36px); font-weight: 700; line-height: 1.3; color: var(--store-primary); }
.section-sub { margin-top: 6px; color: var(--muted); }
.section-head.center { justify-content: center; text-align: center; }
.section-head.center .section-title::after { content: ""; display: block; width: 56px; height: 3px; margin: 12px auto 0; border-radius: 3px; background: var(--store-primary); }
.section-head.center .section-sub { max-width: 560px; margin-inline: auto; margin-top: 12px; }

/* ---------------------------------------------------------------- الواجهة */
.hero {
	position: relative; overflow: hidden;
	background: linear-gradient(180deg, color-mix(in srgb, var(--store-primary) 13%, #FFFFFF) 0%, #FFFFFF 100%);
	padding-block: 56px 30px;
}
.hero::before {
	content: ""; position: absolute; inset-inline-start: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--store-primary) 25%, transparent); pointer-events: none;
}
.slider { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slides > * { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 48px; }
.slide-copy { padding-bottom: 150px; padding-inline-start: 6px; } /* لا يطلّ حرفٌ من الشريحة المجاورة */
.slide-copy h1, .slide-copy h2 { font-size: clamp(34px, 4.6vw, 62px); font-weight: 800; line-height: 1.2; color: var(--store-primary); letter-spacing: -.5px; }
.slide-copy p { margin-block: 22px 30px; max-width: 520px; font-size: 17px; color: #4A4A4A; }
.slide-media { position: relative; padding-inline-end: 22%; padding-block: 40px 70px; }
.slide-img { width: 100%; aspect-ratio: 860 / 520; object-fit: cover; border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow); }
.slide-next {
	position: absolute; inset-inline-end: 0; bottom: 0; width: 34%; aspect-ratio: 5 / 4;
	padding: 0; border: 6px solid #FFFFFF; border-radius: calc(var(--radius) * 1.5); overflow: hidden;
	background: var(--soft); box-shadow: var(--shadow);
}
.slide-next img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.slide-next:hover img { transform: scale(1.05); }
.slide-next span {
	position: absolute; inset: auto auto 12px 12px; display: grid; place-items: center;
	width: 40px; height: 40px; border-radius: 50%; background: #FFFFFF; color: var(--store-primary-dark);
}
.dashes { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.dashes:empty { display: none; }
.dashes button { width: 16px; height: 4px; padding: 0; border: 0; border-radius: 4px; background: #CBD1D6; transition: width .25s, background .25s; }
.dashes button[aria-current="true"] { width: 40px; background: var(--store-primary); }
.hero .dashes { position: absolute; bottom: 12px; left: 0; width: 50%; margin: 0; }

/* شريط الثقة: صفّ أرقامٍ بفواصل تحت زرّ الواجهة */
.trust-section { position: relative; z-index: 2; padding-top: 28px; }
.trust-section .trust { margin-inline: auto; max-width: 900px; }
/* مع الواجهة: يجلس الشريط تحت زرّها في عمود النصّ */
.hero + .trust-section { margin-top: -110px; padding-top: 0; }
.hero + .trust-section .trust { margin-inline: 0; max-width: 600px; }
.trust {
	display: grid; grid-template-columns: repeat(3, 1fr);
	max-width: 600px; border-block: 1px solid var(--line);
}
.trust-item { padding: 18px 10px; text-align: center; }
.trust-item + .trust-item { border-inline-start: 1px solid var(--line); }
.trust-item b { display: block; font-size: 22px; font-weight: 700; color: var(--store-primary); }
.trust-item small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
body[data-show-trust-bar="false"] .trust-section { display: none; }

/* ---------------------------------------------------------------- شريط التصنيفات النصّيّ */
.cat-names-section { padding-block: 48px 8px; }
.cat-names { display: flex; justify-content: space-between; gap: 18px 36px; flex-wrap: wrap; }
.cat-name { font-size: clamp(18px, 1.7vw, 24px); font-weight: 800; color: var(--muted); transition: color .2s; white-space: nowrap; }
.cat-name:hover { color: var(--store-primary-dark); }

/* ---------------------------------------------------------------- بطاقة الكتاب */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 30px 24px; }
.book-grid.grid-small { --per-row: 6; gap: 24px 18px; }
.book-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.book-media {
	position: relative; padding: 26px 18% 30px;
	border-radius: var(--radius);
	background: linear-gradient(180deg, #EEF1F3 0%, #F6F7F8 70%, #FFFFFF 100%);
}
.book-cover { position: relative; display: block; }
.book-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 14px 22px -12px rgba(20, 30, 40, .55); transition: transform .3s; }
.book-card:hover .book-cover img { transform: translateY(-4px); }
.type-dot {
	position: absolute; bottom: -10px; inset-inline-start: -10px; z-index: 2;
	display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
	color: #FFFFFF; border: 2px solid #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.type-dot .icon { width: 15px; height: 15px; stroke-width: 2; }
[data-type="print"] { --type: #DB7056; }
[data-type="ebook"] { --type: #5675A3; }
[data-type="audio"] { --type: #986AB0; }
[data-type="educational"] { --type: #3f8f6b; }
.type-dot, .t-dot { background: var(--type); }
.fav {
	position: absolute; top: 12px; inset-inline-end: 12px; z-index: 3;
	display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
	border: 0; border-radius: 50%; background: #FFFFFF; color: var(--store-primary-dark);
	box-shadow: 0 2px 8px rgba(20, 30, 40, .12);
}
.fav .icon { width: 18px; height: 18px; }
.fav[aria-pressed="true"] .icon { fill: var(--sale); stroke: var(--sale); }
.badge {
	position: absolute; top: 14px; inset-inline-start: 14px; z-index: 3;
	padding: 2px 10px; border-radius: 6px; font-size: 13px; font-weight: 700; line-height: 1.6;
	background: var(--sale); color: #FFFFFF;
}
.badge-new { background: var(--sale); }
.add {
	position: absolute; bottom: 12px; inset-inline-end: 12px; z-index: 3;
	display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: 50%; background: var(--store-primary-dark); color: #FFFFFF;
	box-shadow: 0 6px 14px -6px rgba(20, 30, 40, .55); transition: background .2s, transform .2s;
}
.add .icon { width: 19px; height: 19px; }
.add:hover { background: var(--store-primary); transform: translateY(-2px); }
.add:disabled { background: #8A8F94; box-shadow: none; transform: none; cursor: not-allowed; }
.stock-band {
	position: absolute; inset-inline: 0; bottom: 18px; z-index: 2;
	padding: 4px; background: rgba(20, 26, 32, .82); color: #FFFFFF; text-align: center; font-size: 13px; font-weight: 700;
}
.is-out .book-cover img { filter: grayscale(.6); }
.book-body { padding-top: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.book-title { font-size: 17px; font-weight: 700; line-height: 1.45; color: var(--store-primary); }
.book-title a:hover { color: var(--store-primary-dark); }
.book-author { font-size: 14px; color: var(--muted); }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 15px; height: 15px; }
.stars .off { color: #D9DCE0; }
.price { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: center; font-weight: 800; font-size: 17px; color: var(--store-text); }
.price del { font-size: 14px; font-weight: 500; color: var(--muted); }
.price-lg { font-size: 28px; }
.price-lg del { font-size: 17px; }

/* أشكال البطاقة */
body[data-card-style="framed"] .book-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 16px; }
body[data-card-style="framed"] .book-media { border-radius: calc(var(--radius) - 4px); }
body[data-card-style="minimal"] .book-media { background: none; padding: 0 0 12px; }
body[data-card-style="minimal"] .type-dot { inset-inline-start: 8px; bottom: 8px; }
body[data-card-style="minimal"] .stock-band { bottom: 30px; }

/* ---------------------------------------------------------------- البانران */
.promo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.promo {
	position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 12px;
	min-height: 260px; padding: 30px 40px; overflow: hidden; border-radius: var(--radius);
	background:
		repeating-radial-gradient(circle at 0 120%, transparent 0 46px, rgba(255, 255, 255, .7) 47px 48px),
		linear-gradient(135deg, #EEF0F2, #F7F7F8);
}
.promo-kicker { display: block; color: var(--muted); font-size: 14px; }
.promo h3 { margin-block: 8px 20px; font-size: clamp(22px, 2.2vw, 30px); font-weight: 700; line-height: 1.3; color: var(--store-primary); }
.promo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); transition: transform .4s; }
.promo:hover img { transform: scale(1.04); }

/* ---------------------------------------------------------------- كتاب الأسبوع */
.spotlight { background: var(--soft); padding-block: 64px 48px; }
.spot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .9fr); align-items: center; gap: 40px; padding-block: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 20px; }
.fact { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.fact-ico {
	display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 8px;
	border-radius: calc(var(--radius) + 2px); background: var(--tint-2); color: var(--store-primary-dark);
}
.fact-ico .icon { width: 32px; height: 32px; stroke-width: 1.4; }
.fact b { font-size: 16px; font-weight: 700; color: var(--store-primary); }
.fact small { font-size: 14px; color: var(--muted); }
.spot-cover { display: block; width: 62%; margin-inline: auto; }
.spot-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 40px 50px -26px rgba(20, 30, 40, .6); transform: rotate(-3deg); }
.spot-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.spot-card .book-media { width: 100%; margin-bottom: 10px; padding-inline: 26%; background: linear-gradient(180deg, #E8ECEF, #FFFFFF); }
.spot-card .book-media .type-dot { pointer-events: none; }
.spot-desc { margin-block: 6px; font-size: 14px; color: var(--muted); max-width: 300px; }
.spot-card .btn { margin-top: 12px; }

/* ---------------------------------------------------------------- البانر الملتصق بالحافّة وصفّه */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 150px; padding-block: 56px; }
.feature-banner {
	position: relative; display: block; overflow: visible;
	border-start-end-radius: calc(var(--radius) * 1.5); border-end-end-radius: calc(var(--radius) * 1.5);
}
.feature-banner img { width: 100%; aspect-ratio: 9 / 7; object-fit: cover; border-radius: inherit; }
.feature-banner::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	background: linear-gradient(270deg, transparent 30%, rgba(10, 18, 24, .62) 100%);
}
.feature-title {
	position: absolute; z-index: 2; top: 16%; inset-inline-end: -120px; width: 500px;
	font-size: clamp(32px, 3.6vw, 52px); font-weight: 800; line-height: 1.3;
}
.feature-title b {
	display: block; font-weight: 800;
	/* أبيض فوق الصورة، وبلون الهويّة خارجها */
	background: linear-gradient(270deg, #FFFFFF 0 380px, var(--store-primary-dark) 380px);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.feature-books { padding-inline-end: var(--gutter); min-width: 0; max-width: 620px; }
.feature > :only-child { grid-column: 1 / -1; max-width: var(--container); width: 100%; margin-inline: auto; padding-inline: var(--gutter); }
.carousel .track { display: grid; grid-auto-flow: column; grid-auto-columns: calc(50% - 12px); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.carousel .track::-webkit-scrollbar { display: none; }
.carousel .track > * { scroll-snap-align: start; }

/* ---------------------------------------------------------------- آراء القرّاء */
.reviews-section { background: var(--soft); }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.review-card {
	position: relative; overflow: hidden; padding: 26px; border: 1px solid #D5DADE; border-radius: var(--radius);
	background: linear-gradient(180deg, #FFFFFF, #FBFBFC);
}
.review-card:nth-child(2) { box-shadow: inset 0 -5px 0 var(--store-primary); }
.rq { position: absolute; top: 12px; inset-inline-end: 14px; width: 64px; height: 64px; color: #E8EBEE; stroke-width: 2.4; }
.review-who { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-who b { display: block; font-size: 17px; }
.review-who small { color: var(--muted); font-size: 13px; }
.avatar {
	display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 12px;
	background: var(--tint-2); color: var(--store-primary-dark); font-weight: 800; font-size: 22px;
}
.review-card p { margin-top: 10px; color: #555; }
body[data-show-reviews="false"] .reviews-section { display: none; }

/* ---------------------------------------------------------------- المؤلّفون: شبكة شطرنجيّة */
.chess { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.author-tile { display: grid; grid-template-rows: auto auto; }
.author-tile:nth-child(even) .author-photo { order: 2; }
.author-photo { display: block; overflow: hidden; }
.author-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s; }
.author-tile:hover .author-photo img { transform: scale(1.04); }
.author-text {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	aspect-ratio: 8 / 5; padding: 28px 40px; text-align: center; background: var(--white);
}
.author-text h3, .author-text h2 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 700; color: var(--store-primary); }
.author-text p { color: var(--muted); max-width: 380px; }
.author-text small { color: var(--store-primary-dark); font-weight: 700; }

/* ---------------------------------------------------------------- التذييل */
.site-footer {
	margin-top: 0; color: #DCE3E8;
	background: linear-gradient(160deg, var(--store-accent) 0%, color-mix(in srgb, var(--store-accent) 82%, #3A5566) 100%);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.5fr; gap: 36px; padding-block: 60px 40px; }
.site-footer .brand { color: #FFFFFF; }
.footer-about p { margin-block: 16px; color: #C9D3DA; max-width: 320px; }
.footer-contact li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #C9D3DA; font-size: 14px; }
.footer-contact .icon { width: 17px; height: 17px; }
.site-footer h3 { margin-bottom: 16px; font-size: 19px; font-weight: 700; color: #FFFFFF; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #C9D3DA; transition: color .2s; }
.footer-col a:hover { color: #FFFFFF; }
.footer-news p { color: #C9D3DA; margin-bottom: 16px; }
.nl-field { display: flex; gap: 6px; padding: 6px; border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius-sm); }
.nl-field input { flex: 1; min-width: 0; border: 0; background: none; color: #FFFFFF; padding: 6px 12px; }
.nl-field input::placeholder { color: #B5C1CA; }
.nl-field button { border: 0; border-radius: calc(var(--radius-sm) - 3px); padding: 9px 18px; background: #FFFFFF; color: var(--store-primary-dark); font-weight: 700; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px 26px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 14px; color: #C9D3DA; }
.footer-bottom b { color: #FFFFFF; }
.social { display: flex; gap: 10px; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; color: #FFFFFF; }
.social a:hover { background: rgba(255, 255, 255, .1); }
.social .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- شريط عنوان الصفحات الداخليّة */
.page-band {
	position: relative; overflow: hidden; padding-block: 42px; text-align: center;
	background: var(--soft);
}
.page-band::before, .page-band::after {
	content: ""; position: absolute; border-radius: 50%; pointer-events: none;
	border: 1px solid color-mix(in srgb, var(--store-primary) 22%, transparent);
}
.page-band::before { width: 520px; height: 520px; inset-inline-start: -200px; top: -330px; }
.page-band::after { width: 380px; height: 380px; inset-inline-end: -120px; bottom: -280px; }
.band-title { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; color: var(--store-primary); line-height: 1.3; }
.band-sub { margin-top: 4px; color: var(--muted); }
.crumbs { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--store-primary-dark); }
.crumbs .sep { transform: rotate(90deg); }
.crumbs [aria-current] { color: var(--store-primary-dark); font-weight: 700; }

/* ---------------------------------------------------------------- قائمة التصنيف */
.listing-wrap { padding-block: 32px 56px; }
.sub-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.listing { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 32px; align-items: start; }
.listing > * { min-width: 0; }
.filters-close { display: none; }
.side-filters { display: grid; gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.panel summary {
	display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
	background: var(--tint); color: var(--store-primary-dark); font-weight: 700; cursor: pointer; list-style: none;
}
.panel summary::-webkit-details-marker { display: none; }
.panel[open] summary .icon { transform: rotate(180deg); }
.panel-body { padding: 14px 18px; display: grid; gap: 4px; }
.check { display: flex; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary-dark); flex: none; }
.check small { margin-inline-start: auto; color: var(--muted); }
.check .stars .icon { width: 14px; height: 14px; }
.more-btn { justify-self: start; margin-top: 6px; padding: 6px 16px; border: 0; border-radius: var(--pill); background: var(--store-primary-dark); color: #FFFFFF; font-size: 13px; font-weight: 700; }
.price-range { display: flex; align-items: center; gap: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 16px; border-radius: var(--radius); background: var(--soft); }
.toolbar p { color: var(--muted); }
.toolbar b { color: var(--store-text); }
.tools { display: flex; align-items: center; gap: 10px; }
.tools .field { width: auto; min-width: 170px; }
.filters-btn { display: none; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--muted); }
.view-toggle button[aria-pressed="true"] { background: var(--store-primary-dark); border-color: var(--store-primary-dark); color: #FFFFFF; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; padding-inline: 14px 6px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 14px; }
.tag button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); }
.tag .icon { width: 13px; height: 13px; }
.clear { border: 0; background: none; color: var(--sale); font-weight: 700; text-decoration: underline; }
.listing-grid { --per-row: 3; }
body[data-books-per-row="5"] .listing-grid, body[data-books-per-row="6"] .listing-grid { --per-row: 4; }
.listing-main.is-list .listing-grid { grid-template-columns: 1fr; }
.listing-main.is-list .book-card { flex-direction: row; gap: 22px; align-items: center; }
.listing-main.is-list .book-media { width: 200px; flex: none; padding: 18px 36px 22px; }
.listing-main.is-list .book-body { text-align: start; align-items: flex-start; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
	display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 6px;
	border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 700;
}
.pagination a:hover { border-color: var(--store-primary-dark); }
.pagination [aria-current] { background: var(--store-primary-dark); border-color: var(--store-primary-dark); color: #FFFFFF; }
.pagination .gap { border: 0; }

/* ---------------------------------------------------------------- صفحة الكتاب */
.pdp { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr) 300px; gap: 36px; align-items: start; padding-block: 36px 24px; }
.gallery-main { position: relative; padding: 36px 18%; border-radius: var(--radius); background: linear-gradient(180deg, #E9EDF0, #F8F9FA); }
.gallery-main img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 26px 34px -20px rgba(20, 30, 40, .6); }
.gallery-main .type-dot { top: 16px; bottom: auto; inset-inline-start: 16px; width: 36px; height: 36px; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs button { width: 74px; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary-dark); }
.thumbs img { aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.pdp-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pdp-title { font-size: clamp(28px, 3vw, 40px); font-weight: 800; line-height: 1.3; color: var(--store-primary); }
.pdp-author { color: var(--muted); }
.pdp-author a { color: var(--store-primary-dark); font-weight: 700; }
.pdp-desc { color: #4A4A4A; }
.facts-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; margin-block: 8px; }
.facts-row .fact-ico { width: 60px; height: 60px; border-radius: var(--radius); }
.facts-row .fact-ico .icon { width: 26px; height: 26px; }
.facts-row .fact b { font-size: 14px; }
.facts-row .fact small { font-size: 13px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.spec-table th { width: 40%; color: var(--muted); font-weight: 500; }
.buy-col { display: grid; gap: 22px; }
.buy-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.buy-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--store-primary-dark); color: #FFFFFF; font-weight: 700; }
.buy-body { display: grid; gap: 12px; padding: 20px; }
.buy-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.buy-price .badge { position: static; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: #2E7D4F; font-weight: 700; font-size: 14px; }
.stock .icon { width: 17px; height: 17px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); overflow: hidden; justify-self: start; }
.qty button { display: grid; place-items: center; width: 42px; height: 44px; padding: 0; border: 0; background: none; color: var(--store-primary-dark); }
.qty input { width: 48px; height: 44px; border: 0; text-align: center; background: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm button { width: 34px; height: 36px; }
.qty-sm input { width: 36px; height: 36px; }
.buy-body .btn-text { justify-self: center; }
.buy-note { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.buy-note .icon { width: 18px; height: 18px; }
.side-new { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.side-title { margin-bottom: 12px; font-size: 18px; font-weight: 700; color: var(--store-primary); }
.mini-book { display: flex; gap: 14px; align-items: center; padding-block: 10px; }
.mini-book + .mini-book { border-top: 1px solid var(--line); }
.mini-cover { position: relative; width: 62px; flex: none; }
.mini-cover img { aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; }
.mini-cover .type-dot { width: 22px; height: 22px; bottom: -6px; inset-inline-start: -6px; border-width: 1.5px; }
.mini-cover .type-dot .icon { width: 11px; height: 11px; }
.mini-book h3 { font-size: 15px; font-weight: 700; color: var(--store-primary); line-height: 1.4; }
.mini-book p { font-size: 13px; color: var(--muted); }
.mini-book .price { font-size: 15px; justify-content: flex-start; }
.pdp-tabs { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tab-heads { display: flex; background: var(--soft); border-bottom: 1px solid var(--line); }
.tab-heads a { padding: 14px 26px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-heads a[aria-current="true"] { color: var(--store-primary-dark); border-bottom-color: var(--store-primary-dark); background: var(--white); }
.tab-panel { padding: 26px; }
.tab-panel p + p { margin-top: 12px; }
.tab-reviews { border-top: 1px solid var(--line); }
.reviews-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; }
.rv-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.rv-summary strong { font-size: 48px; font-weight: 800; color: var(--store-primary); line-height: 1; }
.rv-summary small { display: block; color: var(--muted); }
.bars li { display: grid; grid-template-columns: 60px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.review-box { display: grid; gap: 10px; margin-top: 22px; padding: 20px; border-radius: var(--radius); background: var(--soft); }
.review-box h3 { font-size: 18px; color: var(--store-primary); }
.review-box p { font-size: 14px; color: var(--muted); }
.review-box textarea { min-height: 96px; resize: vertical; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin: 0; padding: 0; border: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { color: #CDD2D7; 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; }
.review-row { display: flex; gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.review-row:first-child { padding-top: 0; }
.review-row .avatar { width: 46px; height: 46px; font-size: 18px; }
.review-row-head { display: flex; align-items: baseline; gap: 10px; }
.review-row-head small { color: var(--muted); font-size: 13px; }
.review-row p { margin-top: 4px; color: #4A4A4A; }

/* ---------------------------------------------------------------- صفحة المؤلّف */
.author-chess { display: grid; grid-template-columns: 1fr 1fr; }
.author-chess .author-photo img { aspect-ratio: 16 / 11; }
.author-chess .author-text { aspect-ratio: auto; background: var(--white); }
.author-chess .author-text p { max-width: 520px; }

/* ---------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; padding-block: 36px 20px; }
.cart-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-head, .cart-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 1fr 1.2fr 1fr 48px; align-items: center; gap: 12px; padding: 14px 20px; }
.cart-head { background: var(--soft); font-weight: 700; color: var(--store-primary-dark); font-size: 14px; }
.cart-row + .cart-row { border-top: 1px solid var(--line); }
.cart-product { display: flex; align-items: center; gap: 14px; }
.cart-thumb { width: 70px; flex: none; padding: 8px; border-radius: var(--radius-sm); background: var(--soft); }
.cart-thumb img { aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.cart-product h3 { font-size: 16px; font-weight: 700; color: var(--store-primary); line-height: 1.4; }
.cart-product p { font-size: 13px; color: var(--muted); }
.type-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.cart-cell { font-weight: 500; }
.remove { color: var(--muted); }
.remove:hover { color: var(--sale); background: #FDF1F1; }
.cart-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.cart-actions .link-more .icon { transform: none; }
.empty-cart { padding: 40px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-cart > .icon { width: 48px; height: 48px; margin: 0 auto 10px; color: var(--store-primary); }
.empty-cart h2, .empty-cart h3 { font-size: 22px; color: var(--store-primary); }
.empty-cart p { margin-block: 6px 16px; color: var(--muted); }
.empty-cart[hidden] { display: none; }
.summary { display: grid; gap: 18px; }
.summary-box { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.summary-box h2 { margin-bottom: 14px; font-size: 19px; color: var(--store-primary); }
.coupon { display: flex; gap: 8px; }
.coupon .btn { padding-inline: 18px; }
.applied { margin-top: 10px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.applied .btn-text { color: var(--sale); font-size: 14px; }
.sum-row { display: flex; justify-content: space-between; padding-block: 8px; color: #4A4A4A; }
.sum-total { margin-block: 6px 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 19px; color: var(--store-text); }
.sum-total b { font-weight: 800; }
.summary-note { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.summary-note .icon { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- 404 */
.nf { padding-block: 56px 24px; text-align: center; }
.nf-art { position: relative; display: grid; place-items: center; height: 230px; }
.nf-code { font-size: clamp(130px, 20vw, 230px); font-weight: 800; line-height: 1; color: #EEF1F3; letter-spacing: 6px; user-select: none; }
.nf-book { position: absolute; display: flex; width: 150px; height: 104px; filter: drop-shadow(0 18px 18px rgba(20, 30, 40, .22)); }
.nf-book span { flex: 1; background: var(--white); border: 3px solid var(--store-primary-dark); border-radius: 4px 14px 14px 4px; transform: skewY(-8deg); }
.nf-book span:first-child { border-radius: 14px 4px 4px 14px; transform: skewY(8deg); background: var(--tint-2); }
.nf h1 { margin-top: 8px; font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; color: var(--store-primary); }
.nf p { margin: 8px auto 22px; max-width: 520px; color: var(--muted); }
.nf-search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto 16px; }
.nf-search input { flex: 1; min-width: 0; min-height: 50px; padding: 8px 20px; border: 1px solid var(--line); border-radius: var(--pill); }

/* ---------------------------------------------------------------- صفحة المكوّنات */
.kit { padding-block: 32px; }
.kit-section { padding-block: 26px; border-bottom: 1px solid var(--line); }
.kit-title { margin-bottom: 18px; font-size: 19px; color: var(--store-primary); }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.kit-options { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-swatch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; direction: ltr; }
.kit-swatch > span { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); }

/* ==========================================================================
   العروض
   ========================================================================== */
@media (max-width: 1200px) {
	.main-nav > ul > li > a, .drop-btn { padding-inline: 8px; font-size: 15px; }
	.pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
	.buy-col { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
	.footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
	.footer-news { grid-column: 1 / -1; max-width: 520px; }
	.feature { gap: 110px; }
	.feature-title { inset-inline-end: -90px; width: 400px; }
	.feature-title b { background: linear-gradient(270deg, #FFFFFF 0 310px, var(--store-primary-dark) 310px); -webkit-background-clip: text; background-clip: text; }
}

@media (max-width: 1024px) {
	:root { --gutter: 20px; }
	.main-nav { display: none; }
	.menu-toggle { display: inline-grid; }
	.header-row { justify-content: space-between; }
	.header-actions { margin-inline-start: auto; }
	.book-grid { --per-row: 3; }
	.book-grid.grid-small { --per-row: 4; }
	.slide { gap: 28px; }
	.slide-copy { padding-bottom: 130px; }
	.spot { grid-template-columns: 1fr 1fr; }
	.spot .facts { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, 1fr); }
	.feature { grid-template-columns: 1fr; gap: 28px; }
	.feature-banner { margin-inline-end: var(--gutter); }
	.feature-title { inset-inline: 32px; top: auto; bottom: 32px; width: auto; }
	.feature-title b { background: none; color: #FFFFFF; -webkit-text-fill-color: #FFFFFF; }
	.feature-banner::after { background: linear-gradient(0deg, rgba(10, 18, 24, .72) 0%, transparent 65%); }
	.feature-books { max-width: none; padding: 0 var(--gutter); }
	.carousel .track { grid-auto-columns: calc(33.333% - 16px); }
	.listing { grid-template-columns: 1fr; }
	.listing-side {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70; width: min(340px, 88vw);
		padding: 18px; overflow-y: auto; background: var(--white); display: none; box-shadow: var(--shadow);
	}
	.filters-open .listing-side { display: block; }
	.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
	.filters-close { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 18px; }
	.filters-btn { display: inline-flex; }
	.reviews-wrap { grid-template-columns: 1fr; }
	.cart-layout { grid-template-columns: 1fr; }
	.chess { grid-template-columns: 1fr; }
	.author-tile { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
	.author-tile:nth-child(even) .author-photo { order: 2; }
	.author-text { aspect-ratio: auto; }
}

@media (max-width: 860px) {
	.slide { grid-template-columns: 1fr; }
	.slide-copy { padding-bottom: 0; text-align: center; }
	.slide-copy p { margin-inline: auto; }
	.slide-media { padding-block: 0 40px; }
	.hero { padding-block: 32px 24px; }
	.hero .dashes { position: static; margin-top: 18px; }
	.hero + .trust-section { margin-top: 0; }
	.trust-section .trust, .hero + .trust-section .trust { max-width: none; }
	.promo-pair { grid-template-columns: 1fr; }
	.review-grid { grid-template-columns: 1fr; }
	.pdp { grid-template-columns: 1fr; }
	.gallery { max-width: 420px; width: 100%; margin-inline: auto; }
	.buy-col { grid-template-columns: 1fr; }
	.author-chess { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-about { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
	:root { --gutter: 16px; }
	body { font-size: 15px; }
	.hide-sm { display: none; }
	.header-row { min-height: 64px; gap: 6px; }
	.brand { font-size: 19px; }
	.brand img { width: 34px; height: 34px; }
	.section { padding-block: 34px; }
	.book-grid { --per-row: 2; gap: 24px 14px; }
	.book-grid.grid-small { --per-row: 2; }
	.listing-grid { --per-row: 2; }
	.book-media { padding: 20px 14% 22px; }
	.book-title { font-size: 15px; }
	.price { font-size: 15px; }
	.trust-item { padding: 12px 4px; }
	.trust-item b { font-size: 17px; }
	.trust-item small { font-size: 12px; }
	.cat-names { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 6px; scrollbar-width: none; }
	.cat-names::-webkit-scrollbar { display: none; }
	.promo { grid-template-columns: 1.2fr 1fr; padding: 22px; min-height: 0; }
	.spot { grid-template-columns: 1fr; gap: 24px; }
	.spot .facts { grid-row: auto; grid-template-columns: 1fr 1fr; }
	.spot-cover { width: 56%; }
	.spot-card .book-media { display: none; }
	.fact-ico { width: 64px; height: 64px; }
	.carousel .track { grid-auto-columns: calc(50% - 8px); gap: 16px; }
	.feature-title { inset-inline: 20px; bottom: 20px; font-size: 26px; }
	.author-tile { grid-template-columns: 1fr; }
	.author-tile:nth-child(even) .author-photo { order: 0; }
	.author-text { padding: 24px 20px 32px; }
	.toolbar { padding: 10px; }
	.tools { width: 100%; }
	.tools .field { flex: 1; min-width: 0; }
	.facts-row { grid-template-columns: 1fr 1fr; }
	.cart-head { display: none; }
	.cart-row { grid-template-columns: 1fr 1fr; padding: 16px; position: relative; }
	.cart-product { grid-column: 1 / -1; padding-inline-end: 40px; }
	.cart-cell::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
	.cart-row .remove { position: absolute; top: 12px; inset-inline-end: 8px; }
	.coupon { flex-wrap: wrap; }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 18px; padding-top: 44px; }
	.footer-news { grid-column: 1 / -1; }
	.footer-bottom { flex-direction: column; text-align: center; }
	.nf-search { flex-direction: column; }
	.tab-heads a { flex: 1; padding-inline: 10px; text-align: center; }
	.tab-panel { padding: 18px; }
	.listing-main.is-list .book-media { width: 130px; padding: 12px 20px 16px; }
}

/* ---------------------------------------------------------------- ميزات المنصّة: المدوّنة، الأسئلة الشائعة، النظرة السريعة، عرضٌ سريع، قسيمة النشرة */
.qv {
	position: absolute; top: 56px; inset-inline-end: 12px; z-index: 3;
	display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
	border: 0; border-radius: 50%; background: #FFFFFF; color: var(--store-primary-dark);
	box-shadow: 0 2px 8px rgba(20, 30, 40, .12);
	opacity: 0; transform: translateY(-4px); transition: .25s;
}
.qv .icon { width: 18px; height: 18px; }
.book-card:hover .qv, .qv:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .qv { opacity: 1; transform: none; } }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.post-grid-page { row-gap: 40px; margin-bottom: 36px; }
.post-card { display: grid; align-content: start; gap: 16px; }
.post-img { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-img img { transform: scale(1.04); }
.post-text { display: grid; justify-items: start; gap: 8px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13.5px; color: var(--muted); }
.post-cat { color: var(--store-primary-dark); font-weight: 700; }
.post-text h3 { font-size: 21px; line-height: 1.4; color: var(--store-primary); }
.post-text h3 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-title { max-width: 24ch; margin-inline: auto; }
.article-wrap { max-width: 800px; }
.article-img { margin: 0 0 28px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.article-img img { width: 100%; height: 100%; object-fit: cover; }
.article-body { display: grid; gap: 18px; font-size: 17.5px; line-height: 2; margin-bottom: 26px; }
.faq-section { background: var(--soft); }
.faq-wrap { max-width: 860px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { background: #FFFFFF; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; cursor: pointer; font-size: 17px; font-weight: 700; color: var(--store-primary); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { flex: none; width: 20px; height: 20px; transition: transform .2s; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item[open] { border-bottom: 3px solid var(--store-primary); }
.faq-item p { padding: 0 20px 18px; color: var(--muted); }
.flash { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--sale) 8%, #FFFFFF); border: 1px solid color-mix(in srgb, var(--sale) 25%, #FFFFFF); }
.flash[hidden] { display: none; }
.flash-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--sale); font-size: 14.5px; }
.flash-label .icon { width: 18px; height: 18px; }
.flash-cd { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.flash-cd span { display: grid; justify-items: center; padding: 6px 2px; border-radius: 6px; background: #FFFFFF; font-size: 12px; color: var(--muted); }
.flash-cd b { font-size: 19px; line-height: 1.2; color: var(--store-text); font-variant-numeric: tabular-nums; }
.nl-offer { margin-top: 10px; font-size: 14px; font-weight: 700; color: #FFFFFF; }
@media (max-width: 991px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.post-grid { grid-template-columns: minmax(0, 1fr); }
	.faq-item summary { font-size: 15.5px; padding: 15px 16px; }
	.faq-item p { padding: 0 16px 15px; }
	.article-body { font-size: 16.5px; }
}

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

/* ---------------------------------------------------------------- الإصدار الثاني: صفوفٌ كاملة، وتبويبات، وعروض بعدّاد، وصيغ الكتاب */

/* صفٌّ واحدٌ كامل: يُعرض من الكتب بقدر أعمدة الصفّ، فلا يبقى صفٌّ ناقص بأيّ عرضٍ أو عدد */
.one-row > :nth-child(n + 5) { display: none; }
body[data-books-per-row="3"] .one-row > :nth-child(n + 4) { display: none; }
body[data-books-per-row="5"] .one-row > :nth-child(5),
body[data-books-per-row="6"] .one-row > :nth-child(-n + 6) { display: flex; }

/* تبويبات صفّ الكتب: أسماءٌ رماديّة كبيرة كشريط التصنيفات، والمختار بلون الهويّة وشرطة الترقيم الطويلة تحته */
.section-head.has-tabs { flex-wrap: wrap; align-items: flex-end; column-gap: 32px; }
.section-head.has-tabs > div:first-child { margin-inline-end: auto; }
.row-tabs { display: flex; gap: 6px 26px; order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; padding-block: 4px 2px; border-bottom: 1px solid var(--line); }
.row-tabs::-webkit-scrollbar { display: none; }
.row-tab {
	position: relative; flex: none; min-height: 44px; padding: 6px 0 12px; border: 0; background: none;
	font-size: 17px; font-weight: 800; color: var(--muted); white-space: nowrap; transition: color .2s;
}
.row-tab::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 4px; border-radius: 4px; background: var(--store-primary); transform: scaleX(0); transition: transform .25s; }
.row-tab:hover { color: var(--store-primary-dark); }
.row-tab[aria-selected="true"] { color: var(--store-primary); }
.row-tab[aria-selected="true"]::after { transform: none; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* العروض: لوحةٌ بلون الهويّة الفاتح، وعدّادٌ واحد للقسم */
.deal-panel { padding: 34px 36px 38px; border-radius: calc(var(--radius) * 1.5); background: linear-gradient(160deg, var(--tint-2) 0%, var(--tint) 55%, #FFFFFF 100%); }
.deal-head { flex-wrap: wrap; align-items: center; }
.deal-head > div:first-child { margin-inline-end: auto; }
.deal-panel .book-media { background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, .55) 100%); }
body[data-card-style="minimal"] .deal-panel .book-media { background: none; }
.deal-cd { display: flex; align-items: center; gap: 8px; }
.deal-cd[hidden] { display: none; }
.deal-cd-label { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 4px; font-weight: 700; color: var(--store-primary-dark); font-size: 14.5px; }
.deal-cd-label .icon { width: 18px; height: 18px; }
.deal-cd-unit { display: grid; justify-items: center; min-width: 56px; padding: 6px 4px 5px; border-radius: var(--radius-sm); background: var(--store-primary-dark); color: #FFFFFF; line-height: 1.15; }
.deal-cd-unit b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.deal-cd-unit small { font-size: 12px; color: #D6DEE4; }

/* صيغ الكتاب في صفحته */
.formats-box { display: grid; gap: 8px; width: 100%; }
.formats-box[hidden], .formats-box:not(:has([data-repeat="format"] ~ .format-opt)) { display: none; } /* صيغةٌ واحدة: تُخفى القائمة */
.formats-label { font-size: 14px; font-weight: 700; color: var(--store-primary-dark); }
.formats { display: flex; flex-wrap: wrap; gap: 10px; }
.format-opt {
	display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; min-width: 138px;
	padding: 8px 14px 8px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); transition: border-color .2s, background .2s;
}
.format-opt .t-dot { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #FFFFFF; }
.format-opt .t-dot .icon { width: 15px; height: 15px; stroke-width: 2; }
.format-name { font-size: 14px; font-weight: 800; line-height: 1.35; color: var(--store-text); }
.format-price { font-size: 13px; color: var(--muted); line-height: 1.35; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt.is-current { border-color: var(--store-primary-dark); background: var(--tint); box-shadow: inset 0 0 0 1px var(--store-primary-dark); }

/* التوصيل والدفع والاستبدال تحت أزرار الشراء */
.buy-info { display: grid; gap: 8px; margin-top: 2px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13.5px; color: #555; }
.buy-info li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.55; }
.buy-info .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--store-primary); }
.buy-info b { color: var(--store-text); font-weight: 700; }

/* أعمال المؤلّف: صفٌّ يُمرَّر أفقيًّا فلا يبقى صفٌّ ناقص */
.works .track { grid-auto-columns: calc((100% - (var(--per-row) - 1) * 24px) / var(--per-row) - 18px); gap: 24px; }

@media (max-width: 1024px) {
	.one-row > :nth-child(n + 4),
	body[data-books-per-row] .one-row > :nth-child(n + 4) { display: none; }
	.book-grid.grid-small > :nth-child(n + 5) { display: none; }
	.deal-panel { padding: 28px 24px 30px; }
	.feature-banner img { aspect-ratio: 16 / 9; object-position: 50% 75%; }
}

@media (max-width: 640px) {
	.one-row > :nth-child(-n + 4),
	body[data-books-per-row] .one-row > :nth-child(-n + 4) { display: flex; }
	/* «شاهدتَه مؤخّرًا»: شريطٌ يُمرَّر بدل ثلاثة صفوف */
	.book-grid.grid-small { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(42% - 8px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.book-grid.grid-small::-webkit-scrollbar { display: none; }
	.book-grid.grid-small > * { scroll-snap-align: start; }
	.book-grid.grid-small > :nth-child(n + 5) { display: flex; }
	.row-tab { font-size: 15.5px; }
	.row-tabs { gap: 6px 20px; }
	.deal-panel { margin-inline: calc(var(--gutter) * -1); padding: 26px var(--gutter) 28px; border-radius: 0; }
	.deal-cd { order: 3; flex: 1 1 100%; }
	.deal-cd-unit { flex: 1; min-width: 0; }
	.deal-cd-label { flex: none; }
	.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.format-opt { min-width: 0; grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 4px; row-gap: 2px; }
	.format-opt .t-dot { grid-row: auto; width: 26px; height: 26px; }
	.works .track { grid-auto-columns: calc(50% - 8px); gap: 16px; }
	/* المؤلّفون في الهاتف: الصورة بجانب النبذة بدل صورةٍ بعرض الشاشة */
	.author-tile { grid-template-columns: 38% minmax(0, 1fr); align-items: stretch; }
	.author-tile:nth-child(even) .author-photo { order: 2; }
	.author-photo img { height: 100%; }
	.author-text { padding: 18px 16px; gap: 4px; }
	.author-text h3 { font-size: 19px; }
	.author-text p { font-size: 13.5px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
}

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