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

:root {
	--store-primary: #3F9D5C;
	--store-primary-dark: #2D7A45;
	--store-accent: #1F2A24;
	--store-bg: #FFFFFF;
	--store-text: #181D25;

	/* محايدات */
	--muted: #4E5562;
	--line: #E0E5EB;
	--soft: #F5F7FA;
	--soft-2: #EEF1F6;
	--white: #FFFFFF;

	/* ألواح فاتحة مشتقّة من ألوان المتجر ودرجتين محايدتين */
	--tint-1: color-mix(in srgb, var(--store-primary) 12%, #FFFFFF);
	--tint-2: color-mix(in srgb, var(--store-primary-dark) 5%, #FBF1EA);
	--tint-3: color-mix(in srgb, var(--store-primary-dark) 6%, #EAF0F8);

	/* ألوان أنواع الكتب (القاعدة 6) والنجوم */
	--t-print: #DB7056;
	--t-ebook: #5675A3;
	--t-audio: #986AB0;
	--t-edu: #3f8f6b;
	--gold: #F2A516;

	--radius: 16px;
	--radius-sm: 10px;
	--pill: 999px;
	--per-row: 4;
	--font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--shadow: 0 18px 40px -18px rgb(20 28 40 / .28);
}

body[data-corners="sharp"] {
	--radius: 4px;
	--radius-sm: 3px;
	--pill: 6px;
}
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%; }
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;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--store-primary-dark); outline-offset: 2px; }

.container { width: 100%; max-width: 1296px; margin-inline: auto; padding-inline: 20px; }
.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-fill { fill: currentColor; stroke: none; }
.icon-sm { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 0 22px;
	border: 1.5px solid transparent; border-radius: var(--pill);
	font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap;
	transition: background-color .2s, border-color .2s, color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--store-primary-dark); color: #FFFFFF; }
.btn-primary:hover { background: color-mix(in srgb, var(--store-primary-dark) 82%, #000000); }
.btn-dark { background: var(--store-accent); color: #FFFFFF; }
.btn-dark:hover { background: color-mix(in srgb, var(--store-accent) 80%, #000000); }
.btn-outline { background: var(--white); border-color: var(--line); color: var(--store-text); }
.btn-outline:hover { border-color: var(--store-text); }
.btn-outline-light { background: transparent; border-color: #FFFFFF; color: #FFFFFF; }
.btn-outline-light:hover { background: #FFFFFF; color: var(--store-text); }
.btn-lg { min-height: 50px; padding: 0 30px; font-size: 15px; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { cursor: not-allowed; opacity: .55; }

.icon-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: var(--soft-2); }

.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.link-more .icon { width: 16px; height: 16px; transition: transform .2s; }
a:hover .link-more .icon, .link-more:hover .icon { transform: translateX(-3px); }

.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 12px; border-radius: var(--pill);
	background: var(--soft-2); color: var(--store-text); font-size: 12.5px; font-weight: 500;
}

.field {
	height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--pill);
	background: var(--white); color: var(--store-text); min-width: 0;
}
.field:focus { outline: 0; border-color: var(--store-primary-dark); }
textarea.field { height: auto; min-height: 110px; padding: 12px 16px; border-radius: var(--radius-sm); resize: vertical; width: 100%; }

/* ---------------------------------------------------------------- الرأس */
.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: 16px; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; white-space: nowrap; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
body[data-corners="sharp"] .brand img { border-radius: 4px; }

.cat-menu { position: relative; }
.cat-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px;
	border: 0; border-radius: var(--pill); background: var(--soft-2); font-weight: 500; cursor: pointer;
}
.cat-btn .icon-chev { width: 16px; height: 16px; transition: transform .2s; }
.cat-menu.open .cat-btn .icon-chev { transform: rotate(180deg); }
.cat-drop {
	position: absolute; top: calc(100% + 10px); inset-inline-start: 0; z-index: 5;
	display: none; grid-template-columns: 1fr 1fr; gap: 6px 28px; width: 500px; padding: 20px 22px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cat-menu.open .cat-drop { display: grid; }
.cat-drop h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.cat-drop a { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; font-weight: 500; }
.cat-drop a:hover { color: var(--store-primary-dark); }
.cat-drop .t-dot { width: 10px; height: 10px; border-radius: 50%; }

.header-search {
	flex: 1; display: flex; align-items: center; gap: 4px; height: 44px; min-width: 0;
	padding-inline: 18px 4px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--white);
}
.header-search:focus-within { border-color: var(--store-primary-dark); }
.header-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; }
.header-search input::placeholder { color: var(--muted); }
.header-search button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }

.header-help { display: flex; flex-direction: column; line-height: 1.35; font-size: 13px; white-space: nowrap; }
.header-help small { color: var(--muted); font-size: 12px; }
.header-help b { font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 2px; }
.cart-link { position: relative; }
.cart-count {
	position: absolute; top: 0; inset-inline-end: -2px;
	display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
	border-radius: 10px; background: var(--store-primary-dark); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 1;
}

/* شريط التصنيفات السريعة */
.cat-strip { background: var(--white); border-bottom: 1px solid var(--line); }
.strip-track {
	display: flex; justify-content: space-between; gap: 26px; padding: 11px 0;
	overflow-x: auto; scrollbar-width: none;
}
.strip-track::-webkit-scrollbar { display: none; }
.strip-item { display: inline-flex; align-items: center; gap: 10px; flex: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.strip-item:hover { color: var(--store-primary-dark); }
.strip-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--soft); overflow: hidden; }
.strip-ico img { width: 30px; height: 30px; mix-blend-mode: multiply; }

/* الدرج الجانبيّ */
.drawer-backdrop {
	position: fixed; inset: 0; z-index: 60; background: rgb(15 20 25 / .45);
	opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.drawer, .filters-panel-mobile {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
	width: min(320px, 86vw); padding: 18px 20px; overflow-y: auto;
	background: var(--white); transform: translateX(100%); visibility: hidden;
	transition: transform .3s, visibility .3s;
}
body.drawer-open .drawer-backdrop, body.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
body.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-nav > li > a, .drawer-nav summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 500; cursor: pointer; list-style: none; }
.drawer-nav summary::-webkit-details-marker { display: none; }
.drawer-nav .sub a { display: block; padding: 8px 14px; font-size: 14px; color: var(--muted); }
.drawer-help { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 14px; border-radius: var(--radius-sm); background: var(--soft); font-size: 13px; }
.drawer-help small { display: block; color: var(--muted); }

/* ---------------------------------------------------------------- السلايدر */
.hero { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide {
	position: relative; flex: 0 0 100%; scroll-snap-align: start;
	display: flex; align-items: center; min-height: 468px; color: #FFFFFF; overflow: hidden;
}
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to left, rgb(8 18 12 / .7), rgb(8 18 12 / .38) 50%, rgb(8 18 12 / 0) 80%);
}
.slide-content { position: relative; z-index: 1; padding-block: 48px; }
.slide-content > * { max-width: 560px; }
.slide-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.slide-kicker .icon { width: 18px; height: 18px; }
.slide h1, .slide h2 { font-size: clamp(30px, 3.7vw, 50px); font-weight: 800; line-height: 1.2; margin: 12px 0 14px; }
.slide p { font-size: 16px; margin-bottom: 26px; }
.slider-dots { position: absolute; bottom: 18px; inset-inline: 0; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.slider-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: rgb(255 255 255 / .55); cursor: pointer; transition: width .25s; }
.slider-dots button[aria-current="true"] { width: 24px; background: #FFFFFF; }

/* ---------------------------------------------------------------- الأقسام */
.section { padding: 40px 0; }
.section-tight { padding-top: 18px; }
.section-head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.section-title { font-size: 25px; font-weight: 700; }
.section-head.center { justify-content: center; text-align: center; border: 0; padding-bottom: 0; margin-bottom: 30px; }
.section-head.center p { color: var(--muted); margin-top: 6px; }

/* بطاقات الترويج الثلاث */
.promo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-top: 18px; }
.promo-pair { display: contents; }
.promo {
	position: relative; display: block; min-height: 178px; padding: 30px 24px; overflow: hidden;
	border-radius: var(--radius); background: var(--tint-2);
}
.promo.t2 { background: var(--tint-1); }
.promo.t3 { background: var(--tint-3); }
.promo-text { position: relative; z-index: 1; max-width: 54%; }
.promo-kicker { display: block; font-size: 12.5px; color: var(--muted); }
.promo h3 { font-size: 19px; font-weight: 700; margin: 6px 0 14px; }
.promo img {
	position: absolute; inset-inline-end: 0; bottom: 0; width: 52%; height: 100%;
	object-fit: cover; object-position: center; mix-blend-mode: multiply; transition: transform .35s;
}
.promo:hover img { transform: scale(1.05); }

/* شريط الثقة */
.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-top: 18px; }
.trust-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.trust-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--tint-1); color: var(--store-primary-dark); }
.trust-item b { display: block; font-size: 14.5px; }
.trust-item small { display: block; font-size: 13px; color: var(--muted); }
body[data-show-trust-bar="false"] .trust-section { display: none; }

/* عمودان: تصنيفات أو بانر عموديّ بجانب صفّ كتب */
.split { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 30px; align-items: start; }
.split > :only-child { grid-column: 1 / -1; }

.cat-list { display: grid; gap: 4px; }
.cat-list a { display: flex; align-items: center; gap: 14px; padding: 7px 0; }
.cat-list a:hover b { color: var(--store-primary-dark); }
.cat-ico { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--soft); overflow: hidden; }
.cat-ico img { width: 40px; height: 40px; mix-blend-mode: multiply; }
.cat-list b { display: block; font-size: 15px; font-weight: 700; }
.cat-list small { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- بطاقة الكتاب */
.book-grid { --cols: var(--per-row); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 28px 20px; }
.split .book-grid, .listing .book-grid { --cols: 4; }
body[data-books-per-row="3"] .split .book-grid, body[data-books-per-row="3"] .listing .book-grid { --cols: 3; }
.book-grid.one-row > :nth-child(n + 5) { display: none; }

.book-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.book-media { position: relative; padding: 22px 17% 26px; border-radius: var(--radius); background: var(--soft); }
.book-cover img {
	width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px;
	box-shadow: 0 12px 18px -10px rgb(20 28 40 / .55); transition: transform .3s;
}
.book-card:hover .book-cover img { transform: translateY(-4px); }
.type-dot {
	position: absolute; top: 10px; inset-inline-start: 10px; z-index: 1;
	display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #FFFFFF;
	box-shadow: 0 0 0 2px #FFFFFF;
}
.type-dot .icon { width: 16px; height: 16px; }
[data-type="print"] { --tc: var(--t-print); }
[data-type="ebook"] { --tc: var(--t-ebook); }
[data-type="audio"] { --tc: var(--t-audio); }
[data-type="educational"] { --tc: var(--t-edu); }
.type-dot, .t-dot { background: var(--tc); }
.fav {
	position: absolute; top: 8px; inset-inline-end: 8px; z-index: 1;
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--store-text); cursor: pointer;
}
.fav:hover { background: var(--white); }
.fav[aria-pressed="true"] .icon { fill: currentColor; }
.add {
	position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 1;
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
	border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--store-text); cursor: pointer;
	transition: background-color .2s, color .2s;
}
body[data-corners="sharp"] .add { border-radius: 3px; }
.add:hover { background: var(--store-primary-dark); border-color: var(--store-primary-dark); color: #FFFFFF; }
.book-badges { position: absolute; bottom: 12px; inset-inline-start: 10px; z-index: 1; display: flex; gap: 4px; }
.badge { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1.3; color: #FFFFFF; }
.badge-sale { background: var(--store-primary-dark); }
.badge-new { background: var(--store-accent); }
.stock-band {
	position: absolute; top: 50%; inset-inline: 0; z-index: 1; width: max-content; margin-inline: auto; transform: translateY(-50%);
	padding: 4px 14px; border-radius: var(--pill); background: var(--white); color: var(--store-text);
	font-size: 13px; font-weight: 700; box-shadow: var(--shadow);
}
.is-out .book-cover img { opacity: .45; }
.is-out .add { cursor: not-allowed; color: var(--muted); }
.is-out .add:hover { background: var(--white); border-color: var(--line); color: var(--muted); }

.book-body { padding: 12px 2px 0; }
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 17px; font-weight: 800; }
.price del { font-size: 13px; font-weight: 400; color: var(--muted); }
.book-title { margin: 4px 0 2px; font-size: 15px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-title a:hover { color: var(--store-primary-dark); }
.book-author { font-size: 13px; color: var(--muted); }
.rating { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 14px; height: 14px; }
.stars .off { color: #D6DBE2; }
body[data-show-ratings="false"] .book-card .rating { display: none; }

/* أشكال البطاقة */
body[data-card-style="framed"] .book-card { padding: 10px 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
body[data-card-style="framed"] .book-media { background: var(--white); padding-block: 14px 20px; }
body[data-card-style="framed"] .book-body { padding-inline: 6px; }
body[data-card-style="minimal"] .book-media { padding: 0; background: none; }
body[data-card-style="minimal"] .book-cover img { border-radius: var(--radius-sm); box-shadow: none; }
body[data-card-style="minimal"] .fav { background: var(--white); }

/* ---------------------------------------------------------------- تسوّق حسب النوع */
.types-grid { display: grid; grid-template-columns: minmax(0, .8fr) repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.types-intro { align-self: center; }
.types-intro p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.type-tile {
	display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius);
	background: color-mix(in srgb, var(--tc) 10%, #FFFFFF); transition: transform .25s;
}
.type-tile:hover { transform: translateY(-3px); }
.type-circle { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: #FFFFFF; color: var(--tc); }
.type-circle .icon { width: 28px; height: 28px; stroke-width: 1.5; }
.type-tile h3 { font-size: 16px; font-weight: 700; white-space: nowrap; }
.type-tile p { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
body[data-show-types="false"] .types-section { display: none; }

/* بانر عموديّ */
.tall-banner {
	position: relative; display: block; min-height: 430px; height: 100%; padding: 28px 24px; overflow: hidden;
	border-radius: var(--radius); background: var(--tint-3);
}
.tall-banner > div { position: relative; z-index: 1; }
.tall-banner h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.tall-banner p { font-size: 14px; color: var(--muted); margin: -4px 0 12px; }
.tall-banner img {
	position: absolute; bottom: 0; inset-inline: 0; width: 100%; height: 60%;
	object-fit: cover; object-position: center bottom; mix-blend-mode: multiply;
}

/* الكتاب المختار + آراء القرّاء */
.spot-split { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 36px; align-items: start; }
.spot-split > :only-child { grid-column: 1 / -1; }
body[data-show-reviews="false"] .spot-split { grid-template-columns: minmax(0, 1fr); }
body[data-show-reviews="false"] .reviews-block { display: none; }
.review-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; }
.avatar {
	display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
	background: var(--tint-1); color: var(--store-primary-dark); font-size: 20px; font-weight: 800;
}
.review-row p { font-size: 15px; margin: 4px 0 6px; }
.review-meta { font-size: 13px; color: var(--muted); }
.review-meta b { color: var(--store-text); font-weight: 700; }
.review-meta a { text-decoration: underline; text-underline-offset: 3px; }
.review-meta a:hover { color: var(--store-primary-dark); }

.spot-card {
	display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 30px; align-items: center;
	padding: 26px; border: 1px solid var(--line); border-radius: var(--radius);
}
.spot-cover { position: relative; padding: 22px 26px; border-radius: var(--radius-sm); background: var(--soft); }
.spot-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 14px 22px -12px rgb(20 28 40 / .6); }
.spot-eyebrow { font-size: 13px; font-weight: 700; color: var(--store-primary-dark); }
.spot-card h3 { font-size: 24px; font-weight: 700; margin: 8px 0 4px; }
.spot-card .book-author b { color: var(--store-text); font-weight: 500; }
.spot-desc { font-size: 14px; color: var(--muted); margin: 8px 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spot-card .price { font-size: 24px; display: flex; margin-top: 10px; }

/* بانران متجاوران */
.pair-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.wide-promo {
	position: relative; display: flex; align-items: center; min-height: 214px; padding: 28px 30px; padding-inline-start: 46%;
	overflow: hidden; border-radius: var(--radius); background: var(--soft);
}
.wide-promo img { position: absolute; top: 0; inset-inline-start: 0; width: 44%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.wide-promo h3 { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.wide-promo p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

/* المؤلّفون */
.author-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; text-align: center; }
.author-card img { width: 100%; max-width: 128px; aspect-ratio: 1; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; }
.author-card h3 { font-size: 15px; font-weight: 700; }
.author-card:hover h3 { color: var(--store-primary-dark); }
.author-card small { display: block; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- التذييل */
.site-footer { margin-top: 48px; background: var(--store-accent); color: #FFFFFF; }
.newsletter { padding: 46px 20px 38px; text-align: center; }
.newsletter h2 { font-size: 25px; font-weight: 700; }
.newsletter p { margin-top: 8px; color: rgb(255 255 255 / .78); font-size: 14px; }
.nl-field { display: flex; gap: 10px; max-width: 500px; margin: 22px auto 0; }
.nl-field input {
	flex: 1; min-width: 0; height: 46px; padding: 0 20px;
	border: 1px solid rgb(255 255 255 / .32); border-radius: var(--pill); background: transparent; color: #FFFFFF;
}
.nl-field input::placeholder { color: rgb(255 255 255 / .72); }
.nl-field input:focus { outline: 0; border-color: #FFFFFF; }
.nl-field .btn { min-height: 46px; }
.footer-main { border-top: 1px solid rgb(255 255 255 / .12); }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(4, minmax(0, 1fr)); gap: 28px; padding-block: 40px; }
.footer-grid .brand { color: #FFFFFF; }
.footer-about p { margin-top: 14px; font-size: 14px; color: rgb(255 255 255 / .78); max-width: 300px; }
.social { display: flex; gap: 6px; margin-top: 18px; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .22); color: #FFFFFF; }
.social a:hover { background: rgb(255 255 255 / .12); }
.social .icon { width: 18px; height: 18px; }
.footer-col h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 12px; }
.footer-col li { margin-bottom: 7px; }
.footer-col a, .footer-col li { font-size: 14px; color: rgb(255 255 255 / .8); }
.footer-col a:hover { color: #FFFFFF; }
.footer-contact li { display: flex; align-items: center; gap: 8px; }
.footer-contact .icon { width: 16px; height: 16px; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .12); }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 16px; font-size: 13px; color: rgb(255 255 255 / .75); }

/* ---------------------------------------------------------------- صفحات داخليّة: رأس الصفحة */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 18px 0 6px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--store-text); }
.crumbs .icon { width: 14px; height: 14px; }
.page-title { font-size: 28px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* التصنيف: عمود جانبيّ وشبكة */
.listing { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 34px; align-items: start; padding-top: 18px; }
.side-title { font-size: 17px; font-weight: 700; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side-cats > li > a { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-weight: 500; }
.side-cats > li > a .icon { margin-inline-start: auto; width: 16px; height: 16px; color: var(--muted); }
.side-cats .cat-ico { width: 40px; height: 40px; }
.side-cats .cat-ico img { width: 30px; height: 30px; }
.side-cats .is-current > a { color: var(--store-primary-dark); font-weight: 700; }
.side-children { padding: 2px 52px 8px 0; }
.side-children a { display: block; padding: 4px 0; font-size: 14px; color: var(--muted); }
.side-children a:hover { color: var(--store-text); }
.acc { border-bottom: 1px solid var(--line); }
.acc > summary {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 14px 0; font-weight: 700; cursor: pointer; list-style: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .icon { width: 18px; height: 18px; transition: transform .2s; }
.acc[open] > summary .icon { transform: rotate(180deg); }
.acc-body { padding-bottom: 16px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary-dark); margin: 0; }
.check small { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range .field { width: 100%; height: 40px; padding: 0 12px; }
.side-banner { margin-top: 24px; min-height: 380px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar p { font-size: 14px; color: var(--muted); }
.toolbar p b { color: var(--store-text); }
.sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.sort .field { max-width: 100%; }
.sort .field { height: 40px; padding-inline: 14px 30px; }
.filters-btn { display: none; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border-radius: var(--pill); background: var(--soft-2); font-size: 13px; }
.tag button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--white); cursor: pointer; }
.tag button .icon { width: 12px; height: 12px; }
.tags .clear { font-size: 13px; font-weight: 700; color: var(--store-primary-dark); padding: 5px 4px; background: none; border: 0; cursor: pointer; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 40px; }
.pagination a, .pagination span {
	display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px;
	border-radius: var(--pill); font-size: 14px; font-weight: 500;
}
.pagination a:hover { background: var(--soft-2); }
.pagination [aria-current="page"] { background: var(--store-accent); color: #FFFFFF; }
.pagination .icon { width: 18px; height: 18px; }
.filters-close { display: none; }

/* ---------------------------------------------------------------- صفحة الكتاب */
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) 290px; gap: 36px; align-items: start; padding-top: 14px; }
.gallery { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; }
.thumbs { display: flex; flex-direction: column; gap: 10px; }
.thumbs button { padding: 6px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); cursor: pointer; }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary-dark); }
.thumbs img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.gallery-main { position: relative; padding: 38px 19%; border-radius: var(--radius); background: var(--soft); }
.gallery-main img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 22px 34px -18px rgb(20 28 40 / .6); }
.gallery-main .type-dot { width: 38px; height: 38px; top: 14px; inset-inline-start: 14px; }
.gallery-main .type-dot .icon { width: 20px; height: 20px; }
.pdp-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.pdp-kicker .chip a:hover { color: var(--store-primary-dark); }
.pdp h1 { font-size: 28px; font-weight: 700; margin: 12px 0 6px; }
.pdp-author { font-size: 14.5px; color: var(--muted); }
.pdp-author a { color: var(--store-text); font-weight: 700; }
.pdp-author a:hover { color: var(--store-primary-dark); }
.pdp .rating { margin-top: 10px; font-size: 13.5px; }
.pdp .rating .icon { width: 16px; height: 16px; }
.pdp-options { margin-top: 18px; }
.pdp-options small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 7px 16px; border: 1.5px solid var(--line); border-radius: var(--pill); font-size: 14px; font-weight: 500; }
.opt.is-on { border-color: var(--store-primary-dark); color: var(--store-primary-dark); }
.price-lg { font-size: 30px; margin-top: 18px; }
.price-lg del { font-size: 17px; }
.stock { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--store-primary-dark); }
.stock .icon { width: 16px; height: 16px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.buy-row .btn-primary { flex: 1; min-width: 180px; }
.qty { display: inline-flex; align-items: center; height: 50px; padding: 0 4px; border: 1px solid var(--line); border-radius: var(--pill); }
.qty button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.qty button:hover { background: var(--soft-2); }
.qty input { width: 38px; border: 0; background: transparent; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-sm { height: 40px; }
.qty-sm button { width: 30px; height: 30px; }
.wish-btn { width: 50px; height: 50px; border: 1px solid var(--line); }
.buy-row .btn-outline { min-height: 50px; }
.pdp-desc { margin-top: 22px; font-size: 14.5px; color: var(--muted); }
.meta-icons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.meta-ico { padding: 12px 8px; border-radius: var(--radius-sm); background: var(--soft); text-align: center; }
.meta-ico .icon { width: 22px; height: 22px; margin: 0 auto 4px; color: var(--store-primary-dark); }
.meta-ico small { display: block; font-size: 12px; color: var(--muted); }
.meta-ico b { display: block; font-size: 14px; }
.pdp-aside .section-head { margin-bottom: 16px; }
.pdp-aside .section-title { font-size: 18px; }
.pdp-aside .book-grid { --cols: 2; gap: 20px 14px; }
.pdp-aside .book-media { padding: 14px 14% 18px; }
.pdp-aside .price { font-size: 15px; }
.pdp-aside .book-title { font-size: 14px; }
.pdp-aside .accs { margin-top: 20px; border-top: 1px solid var(--line); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.spec-table th, .spec-table td { padding: 7px 0; border-bottom: 1px dashed var(--line); text-align: start; vertical-align: top; }
.spec-table th { font-weight: 400; color: var(--muted); width: 45%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.acc-body p { color: var(--muted); }

/* الآراء في صفحة الكتاب */
.reviews-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; align-items: start; }
.rv-summary { display: flex; align-items: center; gap: 14px; }
.rv-summary strong { font-size: 46px; font-weight: 800; line-height: 1; }
.rv-summary .stars .icon { width: 18px; height: 18px; }
.rv-summary small { display: block; font-size: 13px; color: var(--muted); }
.bars { margin-top: 16px; display: grid; gap: 6px; }
.bars li { display: grid; grid-template-columns: 52px 1fr 34px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.bar { height: 7px; border-radius: 4px; background: var(--soft-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.review-box { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.review-box h3 { font-size: 17px; font-weight: 700; }
.review-box > p { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-bottom: 10px; border: 0; padding: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { color: #D6DBE2; 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-dark); border-radius: 4px; }
.review-box .btn { margin-top: 12px; }

/* ---------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 34px; align-items: start; padding-top: 18px; }
.cart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.cart-head .clear { border: 0; background: none; color: var(--store-primary-dark); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.cart-row {
	display: grid; grid-template-columns: 84px minmax(0, 1fr) auto 110px 40px; gap: 18px; align-items: center;
	padding: 18px 0; border-bottom: 1px solid var(--line);
}
.cart-thumb { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--soft); }
.cart-thumb img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.cart-info h3 { font-size: 15.5px; font-weight: 700; }
.cart-info h3 a:hover { color: var(--store-primary-dark); }
.cart-info p { font-size: 13px; color: var(--muted); }
.cart-info .type-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.cart-info .t-dot { width: 10px; height: 10px; border-radius: 50%; }
.cart-info .unit { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.cart-total { font-weight: 800; font-size: 16px; text-align: end; }
.remove { color: var(--muted); }
.remove:hover { color: var(--store-text); }
.empty-cart { padding: 50px 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(--muted); }
.empty-cart p { color: var(--muted); margin: 6px 0 18px; }
.summary { position: sticky; top: 96px; padding: 24px; border-radius: var(--radius); background: var(--soft); }
.summary h2 { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.coupon { display: flex; gap: 8px; margin-bottom: 16px; }
.coupon .field { flex: 1; height: 44px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14.5px; }
.sum-row span:first-child { color: var(--muted); }
.sum-total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 800; }
.sum-total span:first-child { color: var(--store-text); }
.summary .btn { margin-top: 16px; }
.summary-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.summary-note .icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- 404 */
.nf { position: relative; padding: 56px 0 20px; text-align: center; overflow: hidden; }
.nf-code { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: clamp(110px, 17vw, 196px); font-weight: 800; line-height: 1; }
.nf-o { display: grid; place-items: center; width: .82em; height: .82em; border-radius: 50%; background: var(--tint-1); color: var(--store-primary-dark); }
.nf-o .icon { width: .46em; height: .46em; stroke-width: 1.4; }
.nf h1 { font-size: 28px; font-weight: 700; margin-top: 26px; }
.nf p { color: var(--muted); max-width: 460px; margin: 8px auto 24px; }
.nf-leaf { position: absolute; width: 46px; height: 46px; fill: var(--tint-1); stroke: var(--store-primary); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.nf-search { display: flex; max-width: 440px; margin: 0 auto 18px; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------------------------------------------------------------- المؤلّف */
.author-hero {
	display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 34px; align-items: center;
	margin-top: 10px; padding: 32px 36px; border-radius: var(--radius); background: var(--tint-1);
}
.author-hero img { width: 172px; height: 172px; border-radius: 50%; object-fit: cover; border: 6px solid var(--white); }
.author-hero h1 { font-size: 30px; font-weight: 700; }
.author-hero .chip { background: var(--white); margin-top: 8px; }
.author-hero .bio { margin-top: 12px; max-width: 70ch; font-size: 15px; }
.author-hero .social { margin-top: 14px; }
.author-hero .social a { border-color: color-mix(in srgb, var(--store-text) 18%, transparent); color: var(--store-text); }

/* ---------------------------------------------------------------- components.html */
.kit-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.kit-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kit-options { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; max-width: 900px; }
.kit-swatch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.kit-swatch span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); }

/* ---------------------------------------------------------------- الاستجابة */
@media (max-width: 1180px) {
	.header-help { display: none; }
	.pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.pdp-aside { grid-column: 1 / -1; }
	.pdp-aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
	.pdp-aside .accs { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
	.footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.types-intro { grid-column: 1 / -1; }
	.types-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.footer-about { grid-column: 1 / -1; }
	.author-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
	.book-grid { --cols: 3; }
	.split .book-grid, .listing .book-grid { --cols: 3; }
	.split { grid-template-columns: 230px minmax(0, 1fr); }
	.spot-split { grid-template-columns: minmax(0, 1fr); }
	.cat-menu { display: none; }
	.trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.types-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.listing { grid-template-columns: minmax(0, 1fr); }
	.filters-btn { display: inline-flex; }
	.listing-side {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
		width: min(340px, 88vw); padding: 18px 20px 30px; overflow-y: auto;
		background: var(--white); transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
	}
	body.filters-open .listing-side { transform: none; visibility: visible; }
	.filters-close { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
	.cart-layout { grid-template-columns: minmax(0, 1fr); }
	.summary { position: static; }
	.reviews-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
	.promo-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.promo-grid::-webkit-scrollbar { display: none; }
	.promo { flex: 0 0 84%; scroll-snap-align: start; }
	.split { grid-template-columns: minmax(0, 1fr); }
	.tall-banner { min-height: 300px; }
	.tall-banner img { width: 55%; height: 100%; inset-inline: auto 0; }
	.tall-banner > div { max-width: 50%; }
	.pair-grid { grid-template-columns: minmax(0, 1fr); }
	.cat-list {
		grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: minmax(150px, 44%); gap: 4px 14px;
		overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
	}
	.cat-list::-webkit-scrollbar { display: none; }
	.cat-list li { scroll-snap-align: start; }
	.cat-list a { gap: 10px; }
	.cat-list .cat-ico { width: 44px; height: 44px; }
	.cat-list .cat-ico img { width: 34px; height: 34px; }
}
@media (max-width: 768px) {
	.container { padding-inline: 16px; }
	.header-row { flex-wrap: wrap; gap: 6px 10px; min-height: 0; padding-block: 10px; }
	.brand { margin-inline-end: auto; font-size: 19px; }
	.brand img { width: 36px; height: 36px; }
	.header-search { order: 5; flex-basis: 100%; height: 42px; }
	.hide-sm { display: none !important; }
	.slide { flex-direction: column; align-items: stretch; min-height: 0; background: var(--store-accent); }
	.slide > img { position: static; height: 190px; object-position: left center; }
	.slide::after { display: none; }
	.slide-content { padding-block: 18px 40px; }
	.slide h1, .slide h2 { font-size: 26px; margin: 8px 0 8px; }
	.slide p { font-size: 15px; margin-bottom: 16px; }
	.trust { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 2px; }
	.trust::-webkit-scrollbar { display: none; }
	.trust-item { flex: 0 0 auto; gap: 10px; padding: 9px 14px 9px 12px; border-radius: var(--pill); scroll-snap-align: start; }
	.trust-ico { width: 34px; height: 34px; }
	.trust-ico .icon { width: 18px; height: 18px; }
	.trust-item b { font-size: 13.5px; white-space: nowrap; }
	.trust-item small { font-size: 12px; white-space: nowrap; }
	.section { padding: 30px 0; }
	.section-title { font-size: 21px; }
	.book-grid, .split .book-grid, .listing .book-grid, .pdp-aside .book-grid { --cols: 2; gap: 22px 14px; }
	body[data-books-per-row="3"] .split .book-grid, body[data-books-per-row="3"] .listing .book-grid { --cols: 2; }
	.book-grid.one-row > :nth-child(n + 5) { display: flex; }
	.price { font-size: 15.5px; }
	.book-title { font-size: 14px; }
	.fav { background: var(--white); }
	.spot-card { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 18px; }
	.spot-cover { max-width: 230px; margin-inline: auto; width: 100%; }
	.wide-promo { padding: 22px; padding-inline-start: 42%; min-height: 190px; }
	.wide-promo img { width: 40%; }
	.wide-promo h3 { font-size: 18px; }
	.author-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
	.footer-bottom .container { justify-content: center; text-align: center; }
	.pdp { grid-template-columns: minmax(0, 1fr); gap: 26px; }
	.pdp h1 { font-size: 24px; }
	.pdp-aside .book-grid { --cols: 2; }
	.gallery { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
	.gallery-main { padding: 26px 16%; }
	.cart-row { grid-template-columns: 72px minmax(0, 1fr) 32px; gap: 8px 14px; }
	.cart-row .cart-thumb { grid-row: 1 / span 3; align-self: start; }
	.cart-row .cart-info { grid-column: 2; grid-row: 1; }
	.cart-row .remove { grid-column: 3; grid-row: 1; align-self: start; }
	.cart-row .qty { grid-column: 2; grid-row: 2; justify-self: start; }
	.cart-row .cart-total { grid-column: 2 / 4; grid-row: 3; text-align: start; }
	.author-hero { grid-template-columns: minmax(0, 1fr); text-align: center; padding: 26px 20px; }
	.author-hero img { margin-inline: auto; width: 140px; height: 140px; }
	.author-hero .social { justify-content: center; }
	.kit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.page-title { font-size: 24px; }
}
@media (max-width: 480px) {
	.types-grid { gap: 10px; }
	.type-tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
	.type-circle { width: 44px; height: 44px; }
	.type-circle .icon { width: 22px; height: 22px; }
	.type-tile h3 { font-size: 15px; }
	.promo-text { max-width: 58%; }
	.nl-field { flex-direction: column; }
	.nl-field input { flex: none; }
	.meta-icons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.buy-row .btn-primary { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* التصنيفات الفرعيّة تحت عنوان التصنيف */
.sub-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sub-cats .chip { padding: 6px 14px; font-size: 13.5px; background: var(--white); border: 1px solid var(--line); }
.sub-cats .chip:hover { border-color: var(--store-primary-dark); color: var(--store-primary-dark); }

/* ==== ميزات المنصّة (الملحق 8) ==== */
/* المدوّنة: بطاقة المقال وصفحتا blog.html وpost.html */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; min-width: 0; background: transparent; border: none; border-radius: var(--radius); box-shadow: none; overflow: hidden; }
.post-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.post-card:hover .post-media img { transform: scale(1.04); }
.post-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0; padding-top: 14px; }
.post-date { font-size: .82rem; color: var(--muted); font-weight: 500; }
.post-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.5; color: var(--store-text); }
.post-title a { color: inherit; text-decoration: none; }
.post-title a:hover { color: var(--store-primary-dark); }
.post-excerpt { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.75; }
.post-more { margin-top: 4px; font-size: .88rem; font-weight: 700; color: var(--store-primary-dark); text-decoration: none; }
.post-more:hover { text-decoration: underline; }
.blog-section { padding: 8px 0 56px; }
.post-grid-page { row-gap: 36px; }
.post-page { padding: 8px 0 24px; }
.post-article { max-width: 760px; margin-inline: auto; }
.post-header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 20px; }
.post-back { font-size: .88rem; font-weight: 700; color: var(--store-primary-dark); text-decoration: none; }
.post-back::before { content: "→ "; }
.post-page-title { margin: 0; font-size: clamp(1.5rem, 3.2vw, 2.2rem); line-height: 1.4; font-weight: 800; color: var(--store-text); }
.post-figure { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--line); }
.post-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-content { font-size: 1.02rem; line-height: 2; color: var(--store-text); }
.post-content p { margin: 0 0 1.1em; }
.blog-related { padding-top: 24px; border-top: 1px solid var(--line); }
@media (max-width: 991px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid > .post-card:nth-child(3):last-child { display: none; }
}
@media (max-width: 600px) {
	.post-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.post-grid > .post-card:nth-child(3):last-child { display: flex; }
}

/* «من المدوّنة» في الرئيسيّة: صفوفٌ بصورةٍ صغيرة كقائمة المرجع */
.post-grid--rows { gap: 18px 28px; }
.post-card--row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; }
.post-card--row .post-media { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
.post-card--row .post-body { padding: 0; gap: 4px; }
.post-card--row .post-title { font-size: 16px; }
.post-card--row .post-excerpt { font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 991px) { .post-grid--rows { grid-template-columns: minmax(0, 1fr); } .post-grid--rows > .post-card:nth-child(3):last-child { display: grid; } }
@media (max-width: 600px) { .post-grid--rows > .post-card:nth-child(3):last-child { display: grid; } .post-card--row { grid-template-columns: 112px minmax(0, 1fr); } }
.post-page-title { font-size: clamp(26px, 3.2vw, 36px); }
.app-promo { flex-wrap: wrap; }
.app-promo .app-badges { margin-top: 2px; }

/* أزرار متاجر التطبيقات: شاراتٌ نصّيّة مرسومة، بلا شعاراتٍ منسوخة */
.app-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 16px 6px 14px; border-radius: var(--pill); background: var(--white); color: var(--store-text); text-decoration: none; line-height: 1.15; font-weight: 700; font-size: 14px; direction: rtl; }
.app-badge .icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.app-badge small { display: block; font-size: 11px; font-weight: 500; opacity: .85; }
.app-badge:hover { opacity: .9; }
.app-badges { display: flex; flex-wrap: wrap; gap: 10px; }

.app-promo .app-badge { box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 600px) { .app-promo .app-badge { min-height: 40px; padding: 4px 12px; font-size: 13px; } }

/* ==== التطوير الثاني: صفوفٌ جديدة وحالاتٌ ناقصة ==== */
/* خلفيّات الأقسام المتناوبة */
.section-soft { background: var(--soft); }
.section-tint { background: var(--tint-1); }
.section-soft .book-media { background: var(--white); }
body[data-card-style="minimal"] .section-soft .book-media { background: none; }
.section-soft + .section-soft, .section-tint + .section-tint { padding-top: 0; }
.section-tint .spot-card { background: var(--white); border-color: transparent; }
.section-tint .section-head { border-color: color-mix(in srgb, var(--store-primary-dark) 18%, transparent); }
.section-tint .avatar { background: var(--white); }
.section-tint .review-meta, .section-tint .spot-desc { color: #3E4550; }
main:has(> .section-soft:last-child) + .site-footer { margin-top: 0; }
.section-sub { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* النظرة السريعة: تطفو تحت المفضّلة، وتظهر عند التحويم في الحاسوب ودائمًا في اللمس */
.qv {
	position: absolute; top: 46px; inset-inline-end: 8px; z-index: 1;
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
	border: 0; border-radius: 50%; background: var(--white); color: var(--store-text); cursor: pointer;
	box-shadow: 0 2px 8px -2px rgb(20 28 40 / .25); opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s;
}
.qv .icon { width: 18px; height: 18px; }
.book-card:hover .qv, .qv:focus-visible { opacity: 1; transform: none; }
.qv:hover { color: var(--store-primary-dark); }
@media (hover: none) { .qv { opacity: 1; transform: none; } }

/* صفّ «وصل حديثًا» الأفقيّ */
.carousel-nav { display: flex; gap: 6px; }
.carousel-nav .icon-btn { border: 1px solid var(--line); background: var(--white); }
.book-scroll {
	--n: 5.4; display: grid; grid-auto-flow: column; gap: 20px;
	grid-auto-columns: calc((100% - (var(--n) - 1) * 20px) / var(--n));
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.book-scroll::-webkit-scrollbar { display: none; }
.book-scroll > * { scroll-snap-align: start; }

/* تبويبات صفّ الكتب (القاعدة 16) */
.section-head.has-tabs { flex-wrap: wrap; }
.has-tabs .section-title { margin-inline-end: auto; }
.row-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.row-tabs::-webkit-scrollbar { display: none; }
.row-tab {
	flex: none; min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--pill);
	background: var(--white); color: var(--store-text); font-size: 14px; font-weight: 500; cursor: pointer;
}
.row-tab:hover { border-color: var(--store-text); }
.row-tab[aria-selected="true"] { background: var(--store-accent); border-color: var(--store-accent); color: #FFFFFF; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* عدّاد العرض (offer.ends_at) */
.countdown { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; }
.countdown[hidden] { display: none; }
.cd-label { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 4px; font-size: 13px; font-weight: 700; color: var(--store-primary-dark); }
.cd-label .icon { width: 16px; height: 16px; }
.cd-unit { display: grid; justify-items: center; min-width: 50px; padding: 5px 4px 4px; border-radius: var(--radius-sm); background: var(--store-accent); color: #FFFFFF; line-height: 1.15; }
.cd-unit b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 11px; }

/* صفوفٌ بعرض الصفحة: صفٌّ واحد كامل بحسب books_per_row */
.fill-row > :nth-child(n + 7) { display: none; }
@media (min-width: 1025px) {
	body:not([data-books-per-row="5"]):not([data-books-per-row="6"]) .fill-row > :nth-child(n + 5) { display: none; }
	body[data-books-per-row="3"] .fill-row > :nth-child(4) { display: none; }
	body[data-books-per-row="5"] .fill-row > :nth-child(6) { display: none; }
	/* «كتبٌ رائجة» صفّان كاملان، و«مختاراتٌ مميّزة» صفٌّ واحد، في ثلاثة أعمدة أيضًا */
	body[data-books-per-row="3"] .split .book-grid.two-rows > :nth-child(n + 7) { display: none; }
	body[data-books-per-row="3"] .split .book-grid.one-row > :nth-child(n + 4) { display: none; }
}

/* اختيار النسخة (book.formats) */
.formats-box { margin-top: 18px; }
.formats-box small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.format-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: var(--pill); font-size: 14px; font-weight: 500; }
.format-opt .t-dot { width: 10px; height: 10px; border-radius: 50%; }
.format-price { color: var(--muted); font-size: 13px; }
.format-opt:hover { border-color: var(--store-text); }
.format-opt.is-current { border-color: var(--store-primary-dark); color: var(--store-primary-dark); }

/* التوصيل والدفع في صفحة الكتاب */
.pdp-perks { margin-top: 14px; padding: 4px 14px; border-radius: var(--radius-sm); background: var(--soft); }
.pdp-perks li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.pdp-perks li + li { border-top: 1px solid var(--line); }
.pdp-perks .icon { width: 20px; height: 20px; flex: none; color: var(--store-primary-dark); }
.pdp-perks b { font-size: 13.5px; margin-inline-end: 6px; }
.pdp-perks small { font-size: 12.5px; color: var(--muted); }
.pdp-desc p + p { margin-top: 8px; }
.gallery { position: sticky; top: 96px; }

/* صفحة التصنيف: التقييم، والشبكة أو القائمة */
.check .stars .icon { width: 13px; height: 13px; }
.view-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--pill); }
.view-switch .icon-btn { width: 36px; height: 36px; }
.view-switch [aria-pressed="true"] { background: var(--store-accent); color: #FFFFFF; }
.book-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.book-grid.is-list .book-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.book-grid.is-list .book-media { padding: 14px 16px 18px; }
.book-grid.is-list .book-body { padding: 0; }
.book-grid.is-list .book-title { font-size: 17px; font-weight: 700; }

/* أعمال المؤلّف: صفٌّ أفقيّ فلا يبقى صفٌّ ناقص مهما كان عددها */
body .listing .book-scroll.works-scroll { --n: 4.3; }
@media (max-width: 1180px) {
	.book-scroll { --n: 4.4; }
}
@media (max-width: 1024px) {
	.book-scroll { --n: 3.4; }
	/* ثلاثة أعمدة: صفوفٌ كاملة بلا بطاقةٍ يتيمة */
	.split .book-grid.two-rows > :nth-child(n + 7), .split .book-grid.one-row > :nth-child(n + 4), .fill-row > :nth-child(n + 4) { display: none; }
}
@media (max-width: 768px) {
	.book-scroll { grid-auto-columns: 42%; gap: 14px; }
	.carousel-nav { display: none; }
	.split .book-grid.two-rows > :nth-child(-n + 6), .split .book-grid.one-row > :nth-child(n) { display: flex; }
	.fill-row > :nth-child(4) { display: flex; }
	.pdp-aside { display: block; }
	.pdp-aside .accs { margin-top: 20px; }
	.gallery { position: static; }
	.row-tabs { order: 3; flex-basis: 100%; }
	.book-grid.is-list .book-card { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
	.sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.sort .field { flex: 1; min-width: 0; }
	.countdown { gap: 5px; }
	.cd-unit { min-width: 44px; }
}

/* الجهاز اللوحيّ الصغير: ثلاثة أعمدة بدل بطاقتين كبيرتين */
@media (min-width: 600px) and (max-width: 768px) {
	.book-grid, .split .book-grid, .listing .book-grid,
	body[data-books-per-row="3"] .split .book-grid, body[data-books-per-row="3"] .listing .book-grid { --cols: 3; }
	.split .book-grid.one-row > :nth-child(n + 4), .fill-row > :nth-child(n + 4) { display: none; }
	.book-scroll { grid-auto-columns: 30%; }
}

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