/* =====================================================================
   قالب «مَحبرة» — mahbara 1.0.0
   أحاديّ اللون: أسود وأبيض ورماديّ، ولون التمييز للسعر وشارة الخصم وحدهما.
   ألوان الهويّة متغيّراتٌ يختارها الناشر؛ وما سواها محايد.
   ===================================================================== */

:root {
	/* ألوان المتجر (قيمٌ تجريبيّة) */
	--store-primary: #1F1F1F;
	--store-primary-dark: #000000;
	--store-accent: #B83A3A;
	--store-bg: #FFFFFF;
	--store-text: #101010;

	/* محايدات */
	--muted: #696E73;
	--line: #E9E9E9;
	--soft: #F6F4F3;
	--media: #F2F2F2;
	--white: #FFFFFF;
	--gold: #E8A33D;
	--star-off: #D9D9D9;
	--ok: #2E7D32;

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

	--radius: 12px;
	--radius-sm: 8px;
	--pill: 999px;
	--cols: 4;
	--gutter: 16px;
	--container: 1440px;
	--font: "Tajawal", system-ui, sans-serif;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

body[data-corners="sharp"] { --radius: 0; --radius-sm: 0; --pill: 0; }
body[data-books-per-row="3"] { --cols: 3; }
body[data-books-per-row="4"] { --cols: 4; }
body[data-books-per-row="5"] { --cols: 5; }
body[data-books-per-row="6"] { --cols: 6; }

/* ---------------------------------------------------------------- الأساس */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, dl, dd, blockquote, fieldset { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--store-text); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 960px; }
.center { text-align: center; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--store-primary); color: var(--white); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- الأزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 28px;
	border-radius: var(--pill); border: 1px solid transparent;
	font-weight: 500; font-size: 15px; white-space: nowrap;
	transition: background .2s, color .2s, border-color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--store-primary); color: var(--white); }
.btn-dark:hover { background: var(--store-primary-dark); }
.btn-accent { background: var(--store-accent); color: var(--white); }
.btn-accent:hover { filter: brightness(.92); }
.btn-outline { background: var(--white); color: var(--store-text); border-color: var(--store-text); }
.btn-outline:hover { background: var(--store-text); color: var(--white); }
.btn-light { background: var(--white); color: #101010; }
.btn-light:hover { background: #101010; color: var(--white); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--store-text); text-decoration: underline; text-underline-offset: 4px; }
.link-btn .icon { width: 18px; height: 18px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--store-text); }
.icon-btn:hover { background: var(--media); }

.field {
	width: 100%; min-height: 46px; padding: 0 16px;
	border: 1px solid var(--line); border-radius: var(--pill);
	background: var(--white); color: var(--store-text);
}
textarea.field { border-radius: var(--radius); padding: 12px 16px; min-height: 110px; resize: vertical; }
select.field { appearance: none; padding-inline-end: 40px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23101010' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat left 14px center / 18px; }
.field::placeholder { color: var(--muted); }
.field:focus { outline: none; border-color: var(--store-text); }

/* ---------------------------------------------------------------- شريط الإعلان */
.announce {
	display: flex; align-items: center; justify-content: center; gap: 14px;
	background: var(--store-primary); color: var(--white);
	min-height: 40px; padding: 0 var(--gutter); font-size: 14px;
}
.announce:not(:has(.announce-item)) { display: none; }
.announce-track { position: relative; flex: 0 1 560px; min-width: 0; text-align: center; }
.announce-item { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.announce-item.is-active { display: block; animation: fade-in .4s var(--ease); }
.announce-btn { color: var(--white); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.announce-btn .icon { width: 18px; height: 18px; }
.announce-btn:hover { background: rgba(255, 255, 255, .14); }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- الرأس */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--store-bg); border-bottom: 1px solid var(--line); }
.header-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 76px; gap: 16px; }
.header-start { display: flex; align-items: center; gap: 6px; }
.menu-toggle { display: none; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-list > li > a, .drop-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px; font-size: 16px; font-weight: 500; border-radius: var(--radius-sm); }
.nav-list > li > a:hover, .drop-toggle:hover { text-decoration: underline; text-underline-offset: 6px; }
.has-drop { position: relative; }
.dropdown {
	position: absolute; top: 100%; inset-inline-start: 0; min-width: 210px; z-index: 50;
	padding: 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .08);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s var(--ease);
}
.dropdown a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); }
.dropdown a:hover { background: var(--media); }
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown, .has-drop.is-open .dropdown { opacity: 1; visibility: visible; transform: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: center; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand-name { font-size: 24px; font-weight: 500; letter-spacing: -.2px; white-space: nowrap; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.count-badge {
	position: absolute; top: 3px; inset-inline-end: 1px;
	min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
	background: var(--store-accent); color: var(--white); font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}

.search-panel { border-top: 1px solid var(--line); background: var(--store-bg); padding: 16px 0; }
.search-inner { display: flex; gap: 10px; max-width: 760px; }

/* الدرج */
.drawer-backdrop, .filters-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .4); opacity: 0; visibility: hidden; transition: .25s; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
	width: min(340px, 86vw); padding: 18px; overflow-y: auto;
	background: var(--white); transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s;
	display: flex; flex-direction: column; gap: 16px;
}
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head .brand-name { font-size: 19px; }
.drawer-nav { display: flex; flex-direction: column; }
.drawer-nav > a { padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.drawer-label { margin-top: 14px; font-size: 13px; color: var(--muted); }
.drawer-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.drawer-cats a { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 14px; }
.drawer-contact { display: flex; gap: 8px; align-items: center; margin-top: auto; color: var(--muted); }

/* ---------------------------------------------------------------- الأقسام */
.section { padding: 64px 0 0; }
.section-tight { padding-top: 40px; }
main > :last-child { padding-bottom: 72px; }
main > .trust:last-child { padding-bottom: 46px; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-title { font-size: clamp(27px, 2.8vw, 38px); font-weight: 400; line-height: 1.3; letter-spacing: -.3px; }
.section-sub { margin-top: 6px; color: var(--muted); font-size: 16px; }

/* ---------------------------------------------------------------- السلايدر */
.hero { position: relative; overflow: hidden; background: #1A1A1A; }
.slides { position: relative; height: clamp(420px, 41vw, 600px); }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), visibility .8s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .38); }
.slide-content {
	position: absolute; inset: 0; z-index: 1;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	padding: 0 var(--gutter) 30px; text-align: center; color: var(--white);
}
.slide-kicker { font-size: 15px; letter-spacing: .5px; }
.slide-title { font-size: clamp(36px, 5vw, 72px); font-weight: 300; line-height: 1.2; max-width: 900px; }
.slide-content .btn { margin-top: 18px; }
.slider-dots { position: absolute; bottom: 26px; inset-inline: 0; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.slider-dots button { width: 34px; height: 3px; padding: 8px 0; background: rgba(255, 255, 255, .45); background-clip: content-box; }
.slider-dots button.is-active { background-color: var(--white); width: 44px; }

/* ---------------------------------------------------------------- التصنيفات والمؤلّفون (دوائر) */
.cat-row, .author-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.author-row { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 1180px; margin-inline: auto; }
.cat-circle, .author-circle { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.circle-img { display: block; width: 100%; max-width: 210px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--media); }
.circle-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.cat-circle:hover img, .author-circle:hover img { transform: scale(1.06); }
.cat-circle h3, .author-circle h3 { margin-top: 14px; font-size: 21px; font-weight: 400; }
.cat-count { font-size: 14px; color: var(--muted); }
.cat-row-sm { gap: 18px; }
.cat-row-sm .circle-img { max-width: 170px; }
.cat-row-sm h3 { font-size: 18px; margin-top: 10px; }

/* ---------------------------------------------------------------- بطاقة الكتاب */
.book-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 32px 24px; }
.book-card { position: relative; display: flex; flex-direction: column; gap: 14px; }
.book-media {
	position: relative; aspect-ratio: 4 / 5; overflow: hidden;
	display: grid; place-items: center; padding: 11% 18% 14%;
	background: var(--media); border-radius: var(--radius);
}
.book-cover { display: block; width: 100%; height: 100%; }
.book-cover img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .16)); transition: transform .5s var(--ease); }
.book-card:hover .book-cover img { transform: translateY(-4px); }
.badges { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; display: flex; gap: 6px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: var(--pill); font-size: 12px; font-weight: 700; line-height: 22px; }
.badge-new { background: var(--ok); color: var(--white); }
.badge-sale { background: var(--store-accent); color: var(--white); }
.type-dot {
	position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2;
	display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
	color: var(--white); box-shadow: 0 0 0 2px var(--white);
}
.type-dot .icon { width: 16px; height: 16px; stroke-width: 1.8; }
.type-dot[data-type="print"], .kind-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"], .kind-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"], .kind-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"], .kind-dot[data-type="educational"] { background: var(--type-educational); }
.wish-btn {
	position: absolute; top: 52px; inset-inline-end: 10px; z-index: 2;
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
	background: var(--white); color: #101010; box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
	opacity: 0; transform: translateX(-6px); transition: .25s var(--ease);
}
.wish-btn .icon { width: 18px; height: 18px; }
.wish-btn[aria-pressed="true"] { color: var(--store-accent); }
.wish-btn[aria-pressed="true"] .icon { fill: currentColor; }
/* زرّ السلّة: الكبسولة البيضاء نفسها، ظاهرةٌ دائمًا تحت السعر، لا عند التحويم */
.quick-add {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; min-height: 40px; margin-top: auto; padding: 0 12px;
	border: 1px solid #101010; border-radius: var(--pill); background: var(--white); color: #101010;
	font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s, border-color .2s;
}
.quick-add .icon { width: 17px; height: 17px; }
.quick-add:hover:not(:disabled) { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
.quick-add:disabled { cursor: not-allowed; border-color: var(--line); background: var(--media); color: #4A4A4A; }
.book-card:hover .wish-btn, .book-card:focus-within .wish-btn { opacity: 1; transform: none; }
@media (hover: none) {
	.wish-btn { opacity: 1; transform: none; }
}
.stock-strip {
	position: absolute; inset-inline: 0; top: 50%; z-index: 2; transform: translateY(-50%);
	padding: 6px 0; text-align: center; background: rgba(16, 16, 16, .86); color: var(--white); font-size: 14px; font-weight: 500;
}
.book-card.is-out .book-cover img { opacity: .55; filter: grayscale(1); }
.book-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.book-body .price { margin-bottom: 10px; }
.book-title { font-size: 16px; font-weight: 500; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.book-author { font-size: 14px; color: var(--muted); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 14px; height: 14px; }
.stars .off { color: var(--star-off); }
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-weight: 500; font-size: 16px; }
.price > span { color: var(--store-accent); }
.price del { color: var(--muted); font-size: 14px; font-weight: 400; }

/* أشكال البطاقة */
body[data-card-style="framed"] .book-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
body[data-card-style="framed"] .book-media { background: var(--white); border-radius: var(--radius-sm); }
body[data-card-style="minimal"] .book-media { background: transparent; padding: 0; aspect-ratio: 2 / 3; }
body[data-card-style="minimal"] .book-cover img { object-fit: cover; border-radius: var(--radius-sm); filter: none; }
body[data-card-style="minimal"] .badges { top: 10px; inset-inline-start: 10px; }

/* «شاهدتَه مؤخّرًا»: بطاقاتٌ صغيرة في صفٍّ واحد */
.recent-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.is-compact .book-media { aspect-ratio: 3 / 4; padding: 12% 20%; }
.is-compact .quick-add { min-height: 36px; font-size: 13px; gap: 6px; }
.is-compact .quick-add .icon { width: 15px; height: 15px; }
.is-compact .wish-btn { top: 46px; width: 30px; height: 30px; }
.is-compact .type-dot { width: 26px; height: 26px; }
.is-compact .type-dot .icon { width: 14px; height: 14px; }
.is-compact .book-title { font-size: 15px; }
.is-compact .rating { display: none; }

/* ---------------------------------------------------------------- الفسيفساء */
.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; aspect-ratio: 1410 / 920; max-height: 940px; }
.mosaic:not(:has(.tile-tall)) { grid-template-rows: 1fr; aspect-ratio: 1410 / 450; }
.mosaic-tile { position: relative; display: block; overflow: hidden; background: #2A2A2A; min-height: 200px; }
.tile-tall { grid-row: span 2; }
.mosaic-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.mosaic-tile::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .28); transition: background .4s; }
.mosaic-tile:hover img { transform: scale(1.04); }
.mosaic-tile:hover::after { background: rgba(0, 0, 0, .4); }
.tile-title {
	position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 16px; text-align: center;
	color: var(--white); font-size: clamp(26px, 2.8vw, 40px); font-weight: 400;
}
.kit-mosaic { max-width: 700px; aspect-ratio: 700 / 450; display: grid; }

/* ---------------------------------------------------------------- البانران العريضان */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 64px; }
.pair-tile { position: relative; display: block; overflow: hidden; aspect-ratio: 3 / 2; max-height: 620px; width: 100%; background: #2A2A2A; }
.pair-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.pair-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .05) 65%); }
.pair-tile:hover img { transform: scale(1.04); }
.pair-text { position: absolute; inset-inline: 40px; bottom: 36px; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--white); }
.pair-title { font-size: clamp(24px, 2.4vw, 34px); font-weight: 400; line-height: 1.3; }
.pair-sub { font-size: 15px; }
.pair-text .btn { margin-top: 12px; }

/* ---------------------------------------------------------------- الشريط المتحرّك */
.ticker { display: flex; overflow: hidden; background: var(--soft); padding: 26px 0; margin-top: 64px; }
.pair + .ticker { margin-top: 10px; }
.ticker:not(:has(.ticker-item)) { display: none; }
.ticker-track { display: flex; flex-shrink: 0; align-items: center; animation: ticker 32s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 40px; padding-inline-end: 40px; font-size: clamp(22px, 2.2vw, 30px); font-weight: 400; white-space: nowrap; color: #101010; }
.ticker-item::after {
	content: ""; width: 22px; height: 22px; flex-shrink: 0;
	background: #101010; border-radius: 0 50% 50% 50%; transform: rotate(45deg);
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(100%); } }
/* ==========================================================================
   ميزات المنصّة المعتمدة (SPEC، الملحق 8)
   ========================================================================== */
/* النظرة السريعة: تحت زرّ المفضّلة، وتظهر مثله عند التحويم */
.quick-btn {
	position: absolute; top: 92px; inset-inline-end: 10px; z-index: 2;
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
	background: var(--white); color: #101010; box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
	opacity: 0; transform: translateX(-6px); transition: .25s var(--ease);
}
.quick-btn .icon { width: 18px; height: 18px; }
.quick-btn:hover { background: #101010; color: var(--white); }
.book-card:hover .quick-btn, .book-card:focus-within .quick-btn { opacity: 1; transform: none; }
@media (hover: none) { .quick-btn { opacity: 1; transform: none; } }
.is-compact .quick-btn { top: 82px; width: 30px; height: 30px; }

@media (max-width: 767px) {
	.quick-btn { top: 76px; inset-inline-end: 6px; width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
	.ticker-track { animation: none; }
	.ticker { justify-content: center; flex-wrap: wrap; }
	.ticker-track[aria-hidden="true"] { display: none; }
	.slide, .announce-item.is-active { transition: none; animation: none; }
}

/* ---------------------------------------------------------------- آراء القرّاء */
.reviews-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.review-card { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.review-cover { display: grid; place-items: center; padding: 22px 16%; background: var(--media); border-radius: var(--radius); }
.review-cover img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 14px 24px rgba(0, 0, 0, .18); }
.review-body { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.review-body > .rating .stars .icon { width: 20px; height: 20px; }
.review-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.review-who b { font-size: 21px; font-weight: 500; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ok); }
.review-body blockquote { margin: 0; font-size: 18px; line-height: 1.75; }
.review-book { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.review-book a { font-weight: 500; }
.review-book a:hover { text-decoration: underline; text-underline-offset: 4px; }
.review-author { color: var(--muted); font-size: 14px; }
.review-book .price { margin-inline-start: auto; }

/* ---------------------------------------------------------------- شريط الخدمات */
.trust { margin-top: 72px; padding: 0 0 46px; border-bottom: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; text-align: center; }
.trust-item .icon { display: block; }
.trust-item .icon { width: 34px; height: 34px; stroke-width: 1.3; margin: 0 auto 10px; }
.trust-item h3 { font-size: 18px; font-weight: 500; }
.trust-item p { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- التذييل */
.site-footer { background: var(--white); padding-top: 56px; }
main + .site-footer { border-top: 1px solid var(--line); }
main:has(> .trust:last-child) + .site-footer { border-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.5fr; gap: 32px; padding-bottom: 40px; }
.footer-about { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--muted); }
.footer-about .brand { margin-bottom: 8px; color: var(--store-text); }
.footer-about a:hover { color: var(--store-text); }
.social { display: flex; gap: 10px; margin-top: 10px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--store-text); }
.social a:hover { background: var(--store-text); color: var(--white); border-color: var(--store-text); }
.social .icon { width: 18px; height: 18px; }
.footer-col h2, .footer-news h2 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.footer-col li + li { margin-top: 8px; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--store-text); text-decoration: underline; text-underline-offset: 4px; }
.footer-news p { color: var(--muted); }
.news-field { position: relative; margin: 16px 0 12px; }
.news-field .field { padding-inline-end: 56px; }
.news-btn { position: absolute; inset-inline-end: 4px; top: 4px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--store-primary); color: var(--white); }
.news-btn .icon { width: 18px; height: 18px; }
.fine { font-size: 13px; color: var(--muted); }
.fine a { color: var(--store-text); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 22px; text-align: center; color: var(--muted); font-size: 14px; }
body[data-show-newsletter="false"] .footer-news { display: none; }
body[data-show-newsletter="false"] .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }

/* الشريط السفليّ (الهاتف) */
.mobile-bar { display: none; }

/* ---------------------------------------------------------------- خيارات الإظهار */
body[data-show-trust-bar="false"] .trust { display: none; }
body[data-show-reviews="false"] .reviews-sec { display: none; }

/* ---------------------------------------------------------------- رأس الصفحات الداخليّة */
.page-head { text-align: center; padding-top: 52px; }
.breadcrumb { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
.breadcrumb a:hover { color: var(--store-text); }
.breadcrumb [aria-current] { color: var(--store-text); }
.breadcrumb-start { justify-content: flex-start; padding: 22px 0; }
.page-title { margin-top: 10px; font-size: clamp(30px, 3.4vw, 46px); font-weight: 400; line-height: 1.3; }
.page-sub { max-width: 680px; margin: 10px auto 0; color: var(--muted); font-size: 17px; }

/* ---------------------------------------------------------------- صفحة التصنيف */
.cat-strip { padding-top: 48px; }
.toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 26px; }
.toolbar > .btn { justify-self: start; border-color: var(--line); border-radius: var(--radius-sm); }
.toolbar-count { color: var(--muted); font-size: 14px; }
.toolbar-count b { color: var(--store-text); font-weight: 500; }
.sort { justify-self: end; min-width: 200px; }
.sort .field { border-color: transparent; font-weight: 500; }
.filters {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
	width: min(360px, 88vw); padding: 20px; overflow-y: auto; background: var(--white);
	transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s;
	display: flex; flex-direction: column; gap: 8px;
}
.filters-open .filters { transform: none; visibility: visible; }
.filters-open .filters-backdrop { opacity: 1; visibility: visible; }
.filters-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.filters-head h2 { font-size: 20px; font-weight: 500; }
.filter-box { padding: 14px 0; border-bottom: 1px solid var(--line); }
.filter-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary); }
.check .count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters .btn { margin-top: auto; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 48px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); font-weight: 500; }
.pagination span { border: 0; color: var(--muted); }
.pagination a:hover { border-color: var(--store-text); }
.pagination a.is-active { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
.pagination .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- صفحة الكتاب */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.pdp-gallery { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 18px; position: sticky; top: 100px; }
.thumbs { display: flex; flex-direction: column; gap: 10px; }
.thumb { display: block; padding: 8px; background: var(--media); border: 1px solid transparent; border-radius: var(--radius-sm); }
.thumb img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.thumb.is-active { border-color: var(--store-text); }
.main-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 9% 18%; background: var(--media); border-radius: var(--radius); }
.main-media img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .2)); }
.main-media .type-dot { width: 38px; height: 38px; top: 18px; inset-inline-end: 18px; }
.main-media .type-dot .icon { width: 20px; height: 20px; }
.pdp-info { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.pdp-cat { font-size: 14px; color: var(--muted); }
.pdp-cat a { color: var(--store-text); }
.pdp-kind { display: inline-flex; align-items: center; gap: 6px; }
.kind-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pdp-title { font-size: clamp(30px, 3vw, 44px); font-weight: 400; line-height: 1.25; }
.pdp-author { color: var(--muted); }
.pdp-author a { color: var(--store-text); text-decoration: underline; text-underline-offset: 4px; }
.pdp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--muted); }
.pdp-meta b { color: var(--store-text); font-weight: 500; }
.meta-link { color: var(--muted); }
.meta-link:hover { color: var(--store-text); text-decoration: underline; }
.meta-sep { width: 1px; height: 14px; background: var(--line); }
.pdp-price { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pdp-price .pdp-now { font-size: 30px; font-weight: 500; color: var(--store-accent); }
.pdp-price del { color: var(--muted); font-size: 18px; }
.pdp-price .badge { font-size: 13px; }
.pdp-desc { color: #4A4E52; font-size: 16px; line-height: 1.85; }
.pdp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 0; border-block: 1px solid var(--line); }
.pdp-facts li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.pdp-facts b { color: var(--store-text); font-weight: 500; }
.stock-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 14px; font-weight: 500; }
.buy-row { display: flex; gap: 10px; }
.btn-grow { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); min-height: 48px; padding: 0 6px; }
.qty button { width: 38px; height: 38px; border-radius: 50%; font-size: 20px; }
.qty button:hover { background: var(--media); }
.qty input { width: 44px; border: 0; text-align: center; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm { min-height: 40px; }
.qty-sm button { width: 32px; height: 32px; }
.pdp-links { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 4px; }
.pdp-section { padding-top: 72px; }
.pdp-section .section-title { margin-bottom: 26px; }
.spec-table { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.spec-table > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.spec-table > div:nth-child(odd) { margin-inline-end: 20px; }
.spec-table > div:nth-child(even) { margin-inline-start: 20px; }
.spec-table dt { color: var(--muted); }
.spec-table dd { font-weight: 500; text-align: end; }

.rv-summary { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.rv-score span { font-size: 48px; font-weight: 300; line-height: 1; }
.rv-score small { margin-inline-start: 6px; color: var(--muted); font-size: 16px; }
.rating-lg .stars .icon { width: 22px; height: 22px; }
.rv-count { color: var(--muted); }
.rv-summary .btn { margin-top: 8px; }
.review-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; padding: 24px; background: var(--soft); border-radius: var(--radius); }
.review-form[hidden] { display: none; }
.review-form h3 { font-size: 20px; font-weight: 500; }
.review-form .btn { align-self: flex-start; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; border: 0; padding: 0; }
.star-input legend { float: right; margin-inline-end: 10px; font-size: 14px; color: #4A4E52; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { color: var(--star-off); cursor: pointer; }
.star-input label .icon { width: 26px; height: 26px; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--gold); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-text); border-radius: 4px; }
.rv-list { display: flex; flex-direction: column; }
.rv-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.rv-head b { font-weight: 500; }
.rv-head time { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- صفحة المؤلّف */
.author-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 44px; }
.author-photo { max-width: 230px; margin-top: 28px; }
.author-count { color: var(--muted); }
.author-bio { max-width: 720px; margin-top: 14px; font-size: 17px; line-height: 1.9; color: #4A4E52; }

/* ---------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { padding: 0 8px 12px; font-size: 14px; font-weight: 500; color: var(--muted); text-align: start; border-bottom: 1px solid var(--line); }
.cart-table td { padding: 20px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-book { display: flex; align-items: center; gap: 16px; }
.cart-book img { width: 76px; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 6px 12px rgba(0, 0, 0, .12); }
.cart-book h3 { font-size: 16px; font-weight: 500; }
.cart-book p { font-size: 14px; color: var(--muted); }
.cart-book .pdp-kind { margin-top: 6px; font-size: 13px; color: var(--muted); }
.cart-book .type-dot { position: static; width: 22px; height: 22px; box-shadow: none; }
.cart-book .type-dot .icon { width: 12px; height: 12px; }
.cell-remove { text-align: end; width: 52px; }
.cart-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; }
.cart-empty { text-align: center; padding: 50px 0; }
.cart-empty[hidden] { display: none; }
.cart-empty .icon { width: 48px; height: 48px; margin: 0 auto 12px; stroke-width: 1.2; }
.cart-empty h2 { font-size: 24px; font-weight: 400; }
.cart-empty p { color: var(--muted); margin: 6px 0 18px; }
.cart-summary { display: flex; flex-direction: column; gap: 14px; padding: 26px; background: var(--soft); border-radius: var(--radius); position: sticky; top: 100px; }
.cart-summary h2 { font-size: 22px; font-weight: 400; }
.coupon { display: flex; gap: 8px; }
.coupon .field { background: var(--white); }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.sum-rows > div { display: flex; justify-content: space-between; padding: 8px 0; }
.sum-rows dt { color: #4A4E52; }
.sum-discount { color: var(--store-accent); }
.sum-total { border-top: 1px solid #DCD8D5; margin-top: 6px; padding-top: 14px !important; font-size: 19px; font-weight: 500; }
.sum-total dt { color: var(--store-text); }
.cart-summary .fine { display: flex; justify-content: center; align-items: center; gap: 6px; color: #5A5E62; }

/* ---------------------------------------------------------------- 404 */
.nf { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-top: 48px; }
.nf img { width: min(420px, 90%); height: auto; }
.nf-search { display: flex; gap: 10px; width: min(520px, 100%); margin: 12px 0 6px; }

/* ---------------------------------------------------------------- صفحة المكوّنات */
.kit-head { text-align: center; padding-top: 40px; }
.kit-block { padding-top: 48px; }
.kit-title { font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.kit-chip { display: inline-flex; align-items: center; gap: 10px; }
.kit-chip .type-dot { position: static; }
.kit-dark { display: inline-flex; padding: 12px; background: #2A2A2A; border-radius: var(--radius); }
.kit .cat-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* =====================================================================
   العروض
   ===================================================================== */
@media (max-width: 1199px) {
	.menu-toggle { display: inline-grid; }
	.main-nav { display: none; }
	.brand-name { font-size: 21px; }
	.recent-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.recent-row > :nth-child(n+5) { display: none; }
	.review-card { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 20px; }
	.review-body blockquote { font-size: 16px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	body[data-show-newsletter="false"] .footer-grid { grid-template-columns: 1fr 1fr; }
	.cart-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; }
}

@media (max-width: 991px) {
	.header-row { display: flex; }
	.header-actions { margin-inline-start: auto; }
	.book-grid { grid-template-columns: repeat(min(var(--cols), 3), minmax(0, 1fr)); gap: 28px 16px; }
	.cat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; }
	.author-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; }
	.author-row > :nth-child(n+4) { display: none; }
	.reviews-grid { grid-template-columns: 1fr; }
	.review-card { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); }
	.trust-grid { gap: 16px; }
	.trust-item h3 { font-size: 16px; }
	.pdp { grid-template-columns: 1fr; gap: 32px; }
	.pdp-gallery { position: static; max-width: 560px; width: 100%; margin-inline: auto; }
	.cart-layout { grid-template-columns: 1fr; }
	.cart-summary { position: static; }
}

@media (max-width: 767px) {
	:root { --gutter: 16px; }
	body { padding-bottom: 64px; }
	.announce { font-size: 13px; gap: 6px; }
	.header-row { min-height: 62px; gap: 6px; }
	.hide-md { display: none; }
	.brand img { width: 32px; height: 32px; }
	.brand-name { font-size: 17px; }
	.icon-btn { width: 40px; height: 40px; }
	.section { padding-top: 48px; }
	.section-head { margin-bottom: 24px; }
	.section-sub { font-size: 15px; }
	.slides { height: auto; }
	.slide { position: relative; display: none; opacity: 1; visibility: visible; transition: none; }
	.slide.is-active { display: block; }
	.slide img { height: 220px; }
	.slide::after { display: none; }
	.slide-content { position: static; gap: 8px; padding: 22px var(--gutter) 50px; background: #1A1A1A; }
	.slide-title { font-size: 28px; }
	.slide-content .btn { margin-top: 8px; }
	.slider-dots { bottom: 18px; }
	.book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
	.book-media { padding: 10% 15% 12%; }
	.quick-add { min-height: 40px; font-size: 13px; gap: 6px; padding: 0 8px; }
	.quick-add .icon { width: 15px; height: 15px; }
	.badges { top: 8px; inset-inline-start: 8px; }
	.type-dot { top: 8px; inset-inline-end: 8px; width: 26px; height: 26px; }
	.type-dot .icon { width: 14px; height: 14px; }
	.wish-btn { top: 40px; inset-inline-end: 6px; width: 30px; height: 30px; }
	.badge { font-size: 11px; padding: 0 7px; }
	.book-title { font-size: 15px; }
	.cat-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
	.cat-row::-webkit-scrollbar { display: none; }
	.cat-row > * { flex: 0 0 104px; scroll-snap-align: start; }
	.cat-circle h3, .author-circle h3 { font-size: 16px; margin-top: 8px; }
	.cat-count { font-size: 13px; }
	.cat-row-sm { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.cat-row-sm > * { flex: 0 0 96px; scroll-snap-align: start; }
	.mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; aspect-ratio: auto; gap: 8px; }
	.mosaic .tile-tall { grid-row: auto; grid-column: span 2; aspect-ratio: 4 / 3; }
	.mosaic-tile { aspect-ratio: 1; min-height: 0; }
	.tile-title { font-size: 22px; }
	.pair { grid-template-columns: 1fr; gap: 8px; margin-top: 48px; }
	.pair-text { inset-inline: 20px; bottom: 22px; }
	.ticker { padding: 18px 0; }
	.ticker-item { gap: 26px; padding-inline-end: 26px; }
	.ticker-item::after { width: 16px; height: 16px; }
	.review-card { grid-template-columns: minmax(0, 36%) minmax(0, 1fr); gap: 14px; }
	.review-cover { padding: 14px 12%; align-self: start; }
	.review-who b { font-size: 18px; }
	.review-body blockquote { font-size: 15px; }
	.review-book .price { margin-inline-start: 0; }
	.recent-row { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.recent-row > * { flex: 0 0 140px; scroll-snap-align: start; }
	.recent-row > :nth-child(n+5) { display: flex; }
	.author-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
	.trust { margin-top: 48px; padding-bottom: 28px; }
	.trust-grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; text-align: start; padding-bottom: 4px; scrollbar-width: none; }
	.trust-grid::-webkit-scrollbar { display: none; }
	.trust-item { flex: 0 0 76%; scroll-snap-align: start; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
	.trust-item .icon { grid-row: span 2; width: 28px; height: 28px; margin: 0; }
	.trust-item h3 { font-size: 15px; }
	.trust-item p { font-size: 13px; }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
	.footer-about, .footer-news { grid-column: 1 / -1; }
	.mobile-bar {
		position: fixed; bottom: 0; inset-inline: 0; z-index: 45;
		display: grid; grid-template-columns: repeat(5, 1fr);
		background: var(--white); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
	}
	.mobile-bar a, .mobile-bar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--store-text); }
	.mobile-bar .icon { width: 20px; height: 20px; }
	.page-head { padding-top: 32px; }
	.page-sub { font-size: 15px; }
	.cat-strip { padding-top: 32px; }
	.toolbar { grid-template-columns: 1fr 1fr; }
	.toolbar-count { grid-column: 1 / -1; grid-row: 2; }
	.sort { min-width: 0; }
	.pdp-gallery { grid-template-columns: 1fr; }
	.thumbs { flex-direction: row; order: 2; }
	.thumb { width: 72px; }
	.pdp-facts { grid-template-columns: 1fr; }
	.buy-row { flex-direction: column; }
	.qty { align-self: flex-start; }
	.spec-table { grid-template-columns: 1fr; }
	.spec-table > div:nth-child(n) { margin: 0; }
	.rv-head time { margin-inline-start: 0; width: 100%; }
	.cart-table thead { display: none; }
	.cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; }
	.cart-table tr { position: relative; padding: 16px 0; border-bottom: 1px solid var(--line); }
	.cart-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; }
	.cart-table td:first-child { display: block; padding-inline-end: 44px; margin-bottom: 8px; }
	.cart-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 14px; }
	.cell-remove { position: absolute; top: 14px; inset-inline-end: 0; width: auto; }
	.cart-actions { flex-direction: column; align-items: stretch; text-align: center; }
	.cart-actions .link-btn { justify-content: center; }
	.nf-search { flex-direction: column; }
	.search-inner { flex-direction: column; }
	.kit .cat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
	.brand-name { font-size: 16px; }
	.slide-title { font-size: 26px; }
}

/* ==========================================================================
   الإصدار الثاني: صفوفٌ كاملة، والتبويبات، وعرض الأسبوع، والدوّار، والمدوّنة
   ========================================================================== */
/* صفوفٌ كاملة دائمًا: يُخفى ما زاد على صفٍّ أو صفّين بحسب عدد الكتب في الصفّ */
@media (min-width: 992px) {
	body[data-books-per-row="3"] .rows-1 > :nth-child(n+4), body[data-books-per-row="4"] .rows-1 > :nth-child(n+5),
	body[data-books-per-row="5"] .rows-1 > :nth-child(n+6), body[data-books-per-row="6"] .rows-1 > :nth-child(n+7),
	body[data-books-per-row="3"] .rows-2 > :nth-child(n+7), body[data-books-per-row="4"] .rows-2 > :nth-child(n+9),
	body[data-books-per-row="5"] .rows-2 > :nth-child(n+11), body[data-books-per-row="6"] .rows-2 > :nth-child(n+13) { display: none; }
}
@media (min-width: 768px) and (max-width: 991px) {
	.rows-1 > :nth-child(n+4), .rows-2 > :nth-child(n+7) { display: none; }
}
@media (max-width: 767px) {
	.rows-1 > :nth-child(n+5), .rows-2 > :nth-child(n+5) { display: none; }
}

/* تبويبات صفّ الكتب (القاعدة 16): نصوصٌ يُسطَّر المختار منها */
.row-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin-top: 18px; }
.row-tab { min-height: 40px; padding: 6px 2px; border-bottom: 2px solid transparent; font-size: 16px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.row-tab:hover { color: var(--store-text); }
.row-tab[aria-selected="true"] { color: var(--store-text); border-bottom-color: var(--store-text); }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* عرض الأسبوع: كتابٌ واحد بغلافٍ كبير، وعدّادٌ واحد للقسم */
.section.deal-sec { margin-top: 64px; padding: 56px 0; background: var(--soft); }
.deal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.deal-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.deal-kicker { font-size: 14px; font-weight: 500; color: var(--store-accent); }
.deal-timer { display: flex; gap: 10px; margin: 16px 0 12px; }
.deal-timer span { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 10px 6px; background: var(--white); border-radius: var(--radius); }
.deal-timer b { font-size: 32px; font-weight: 300; line-height: 1.15; font-variant-numeric: tabular-nums; }
.deal-timer small { font-size: 13px; color: var(--muted); }
.deal-book { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: center; padding: 28px; background: var(--white); border-radius: var(--radius); }
.deal-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 12% 16%; background: var(--media); border-radius: var(--radius); }
.deal-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.deal-title { font-size: clamp(24px, 2.2vw, 32px); font-weight: 400; line-height: 1.3; }
.deal-title a:hover { text-decoration: underline; text-underline-offset: 5px; }
.deal-desc { margin-top: 6px; color: #4A4E52; line-height: 1.85; }
.deal-info .price { margin-top: 2px; }
.deal-info .price > span { font-size: 24px; }
.deal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.deal-wish { width: 48px; height: 48px; border: 1px solid var(--line); }
.deal-wish[aria-pressed="true"] { color: var(--store-accent); }
.deal-wish[aria-pressed="true"] .icon { fill: currentColor; }

/* الدوّار الأفقيّ: يُسحب باللمس، وبسهمين في الحاسوب */
.section-head.has-rail { position: relative; }
.rail-nav { position: absolute; inset-inline-end: 0; bottom: 2px; display: flex; gap: 8px; }
.rail-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); }
.rail-btn:hover:not(:disabled) { border-color: var(--store-text); }
.rail-btn:disabled { opacity: .35; cursor: default; }
.rail-btn .icon { width: 18px; height: 18px; }
.rail {
	display: grid; grid-auto-flow: column; gap: 24px;
	grid-auto-columns: calc((100% - (var(--cols) - 1) * 24px) / var(--cols));
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 4px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* من دفتر المكتبة (latest_posts) */
.section.posts-sec { margin-top: 64px; padding: 56px 0 60px; background: var(--soft); }
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.post-card { display: flex; flex-direction: column; gap: 14px; }
.post-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--media); }
.post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-media img { transform: scale(1.04); }
.post-body { display: flex; flex-direction: column; gap: 4px; }
.post-date { font-size: 13px; color: var(--muted); }
.post-title { font-size: 20px; font-weight: 500; line-height: 1.45; }
.post-title a:hover { text-decoration: underline; text-underline-offset: 5px; }
.post-excerpt { color: #4A4E52; font-size: 15px; }
.section-more { margin-top: 32px; text-align: center; }

@media (max-width: 991px) {
	.pair { grid-template-columns: 1fr; gap: 8px; }
	.deal { grid-template-columns: 1fr; gap: 28px; }
	.deal-head { align-items: center; text-align: center; }
	.deal-book { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; }
	.rail { gap: 16px; grid-auto-columns: calc((100% - 32px) / 3); }
	.posts-grid { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.posts-grid::-webkit-scrollbar { display: none; }
	.posts-grid > * { flex: 0 0 44%; scroll-snap-align: start; }
}
@media (min-width: 768px) and (max-width: 991px) {
	.pair-tile { aspect-ratio: 2 / 1; }
	.cat-row:not(.cat-row-sm) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
	.cat-row:not(.cat-row-sm) .cat-circle h3 { font-size: 17px; margin-top: 10px; }
}
@media (max-width: 767px) {
	.row-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 22px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
	.row-tabs::-webkit-scrollbar { display: none; }
	.row-tab { font-size: 15px; }
	.section.deal-sec, .section.posts-sec { margin-top: 48px; padding: 40px 0; }
	.deal-timer { gap: 8px; }
	.deal-timer span { min-width: 64px; padding: 8px 4px; }
	.deal-timer b { font-size: 26px; }
	.deal-book { grid-template-columns: minmax(0, 128px) minmax(0, 1fr); gap: 16px; padding: 14px; align-items: start; }
	.deal-media { padding: 10%; }
	.deal-desc { display: none; }
	.deal-info .price > span { font-size: 20px; }
	.deal-actions { width: 100%; flex-wrap: nowrap; }
	.deal-actions .btn { flex: 1; min-height: 44px; padding: 0 12px; font-size: 14px; }
	.deal-actions .btn .icon { display: none; }
	.deal-wish { width: 44px; height: 44px; }
	.rail-nav { display: none; }
	.pair-tile::after { background: linear-gradient(0deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .2) 85%); }
	.rail { gap: 12px; grid-auto-columns: 44%; }
	.posts-grid > * { flex-basis: 82%; }
	.post-title { font-size: 18px; }
}

/* صفحات الكتاب: اختيار الصيغة (book.formats)، وصندوق التوصيل والدفع، و«عن الكتاب» */
.formats-box { display: flex; flex-direction: column; gap: 8px; }
.formats-label { font-size: 14px; color: var(--muted); }
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.format-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 15px; transition: border-color .2s; }
.format-opt:hover { border-color: var(--store-text); }
.format-opt.is-current { border-color: var(--store-text); box-shadow: inset 0 0 0 1px var(--store-text); }
.format-name { font-weight: 500; }
.format-price { color: var(--muted); font-size: 14px; }
.pdp-service { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding: 16px 18px; background: var(--soft); border-radius: var(--radius); }
.pdp-service li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: #4A4E52; line-height: 1.6; }
.pdp-service .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--store-text); }
.pdp-service b { color: var(--store-text); font-weight: 500; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.about-grid .section-title { margin-bottom: 20px; }
.about-text .pdp-desc p + p { margin-top: 12px; }

/* صفحة التصنيف: طريقة العرض، والتصفيات المختارة، والقائمة */
.toolbar-end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.view-switch { display: inline-flex; gap: 4px; }
.view-switch button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.view-switch button[aria-pressed="true"] { border-color: var(--store-text); color: var(--store-text); }
.view-switch .icon { width: 18px; height: 18px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -10px 0 24px; }
.active-filters .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 14px; }
.active-filters .chip:hover { border-color: var(--store-text); }
.active-filters .chip .icon { width: 14px; height: 14px; }
.active-filters .link-btn { margin-inline-start: 6px; font-size: 14px; }
.book-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.book-grid.is-list .book-card { flex-direction: row; align-items: center; gap: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.book-grid.is-list .book-media { flex: 0 0 150px; width: 150px; padding: 16px 22px; }
.book-grid.is-list .book-body { flex: 1; }
.book-grid.is-list .quick-add { width: auto; align-self: flex-start; padding: 0 22px; margin-top: 4px; }
.book-grid.is-list .stock-strip { font-size: 12px; }

/* صفحة المؤلّف: أعماله في دوّارٍ أفقيّ، فلا يبقى صفٌّ ناقص */
.author-works .rail { --cols: 4; }

/* صفحة المكوّنات */
.kit-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.kit-deal { padding: 32px; background: var(--soft); border-radius: var(--radius); }
.kit-deal + .kit-note + .kit-deal, .kit-note + .kit-deal { margin-top: 12px; }
.kit-pdp { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }

/* المدوّنة والمقال */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }
.blog-grid .post-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 36px; align-items: center; }
.blog-grid .post-card:first-child .post-title { font-size: clamp(24px, 2.4vw, 34px); font-weight: 400; line-height: 1.35; }
.blog-grid .post-card:first-child .post-excerpt { font-size: 17px; }
.post-head { max-width: 780px; margin-inline: auto; text-align: center; padding-top: 44px; }
.post-head .post-date { display: block; margin-top: 10px; }
.post-cover { max-width: 1100px; margin: 32px auto 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-content { max-width: 720px; margin: 40px auto 0; font-size: 18px; line-height: 2; color: #2A2D30; }
.post-content p + p, .post-content h2 + p { margin-top: 16px; }
.post-content h2 { margin-top: 34px; font-size: 24px; font-weight: 500; line-height: 1.4; }
.post-content blockquote { margin: 28px 0; padding: 4px 22px; border-inline-start: 3px solid var(--store-text); font-size: 20px; color: var(--store-text); }
.post-content a { text-decoration: underline; text-underline-offset: 4px; }
.post-share { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 720px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (max-width: 991px) {
	.about-grid { grid-template-columns: 1fr; gap: 36px; }
	.author-works .rail { grid-auto-columns: calc((100% - 32px) / 3); }
	.blog-grid { gap: 32px 18px; }
	.blog-grid .post-card:first-child { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 767px) {
	.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.format-opt { flex-direction: column; justify-content: center; gap: 0; min-height: 56px; padding: 6px 4px; border-radius: var(--radius); font-size: 14px; line-height: 1.4; text-align: center; }
	.format-opt .kind-dot { display: none; }
	.format-price { font-size: 13px; }
	.pdp-service { padding: 14px; }
	.toolbar { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; }
	.toolbar-count { grid-column: 2; grid-row: 1; justify-self: end; }
	.toolbar-end { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; gap: 8px; }
	.toolbar-end .sort { flex: 1; }
	.toolbar-end .sort .field { border-color: var(--line); }
	.view-switch button { width: 40px; height: 40px; }
	.active-filters { margin-top: -8px; }
	.book-grid.is-list .book-card { gap: 14px; }
	.book-grid.is-list .book-media { flex-basis: 104px; width: 104px; padding: 10px 14px; }
	.author-works .rail { grid-auto-columns: 44%; }
	.blog-grid { grid-template-columns: 1fr; gap: 32px; }
	.post-head { padding-top: 28px; }
	.post-cover { margin-top: 22px; }
	.post-content { margin-top: 26px; font-size: 17px; line-height: 1.95; }
	.post-content blockquote { font-size: 18px; padding-inline-start: 16px; }
}

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