/* ==================================================================
   مَيدان — قالب متجر كتب لمنصّة «ناشر»
   رأسٌ بلون المتجر وصفّ تنقّلٍ أبيض، وأقسامٌ في صناديق بيضاء على رماديّ،
   وبطاقاتٌ طويلة بلا إطار، وصفوف كتبٍ ببانرٍ طرفيّ، وأزرارٌ بلون التمييز.
   ================================================================== */

:root {
	/* ألوان الهويّة: يختارها الناشر، والقيم هنا تجريبيّة */
	--store-primary: #1D63D8;
	--store-primary-dark: #174FAE;
	--store-accent: #FEE501;
	--store-bg: #F2F3F8;
	--store-text: #202326;

	/* ألوان محايدة */
	--on-primary: #FFFFFF;
	--on-accent: #111111;
	--accent-hover: #EBD300;
	--surface: #FFFFFF;
	--soft: #EEF0F6;
	--line: #E3E6EE;
	--muted: #5B6273;
	--price: #127A37;
	--sale: #D42A2A;
	--star: #F5A623;
	--star-off: #D5D8E0;
	--trust: #24262B;
	--footer: #151515;
	--footer-text: #B8BCC4;

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

	--r: 4px;
	--r-sm: 4px;
	--per: 5;
	--shadow: 0 6px 22px rgba(20, 30, 60, .08);
	--font: 'Tajawal', system-ui, sans-serif;
}

body[data-corners="rounded"] { --r: 14px; --r-sm: 10px; }
body[data-corners="sharp"] { --r: 4px; --r-sm: 4px; }
body[data-books-per-row="4"] { --per: 4; }
body[data-books-per-row="5"] { --per: 5; }
body[data-books-per-row="6"] { --per: 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.6;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--store-primary); }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--store-primary); outline-offset: 2px; }
.visually-hidden {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
main { display: block; padding-bottom: 8px; }

/* ------------------------------------------------------------------ أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 44px; padding: 0 22px; border-radius: var(--r-sm);
	font-weight: 700; font-size: 15px; white-space: nowrap; border: 1px solid transparent;
	transition: background-color .15s, color .15s, border-color .15s;
}
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-accent { background: var(--store-accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary { background: var(--store-primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--store-primary-dark); color: var(--on-primary); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--store-text); }
.btn-outline:hover { border-color: var(--store-primary); color: var(--store-primary); }
.btn-ghost { background: var(--soft); color: var(--store-text); }
.btn-ghost[aria-pressed="true"] .icon { fill: var(--sale); stroke: var(--sale); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.link-all { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.link-all .icon { width: 1em; height: 1em; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--store-primary); font-weight: 700; font-size: 14px; }
.link-arrow .icon { width: 1.05em; height: 1.05em; }

/* ------------------------------------------------------------------ الرأس */
.site-header { position: sticky; top: 0; z-index: 30; }
.hdr-main { background: var(--store-primary); color: var(--on-primary); }
.hdr-main .container { display: flex; align-items: center; gap: 22px; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.2px; }
.hdr-main .brand, .hdr-main .brand:hover { color: var(--on-primary); }
.hdr-search {
	flex: 1; display: flex; align-items: stretch; height: 48px; min-width: 0;
	background: var(--surface); border-radius: var(--r-sm); overflow: hidden;
}
.hdr-search select {
	border: 0; background: var(--soft); color: var(--store-text); padding: 0 14px; font-size: 14px;
	max-width: 160px; border-inline-end: 1px solid var(--line);
}
.hdr-search input { flex: 1; min-width: 0; border: 0; padding: 0 16px; color: var(--store-text); background: transparent; }
.hdr-search input::placeholder { color: var(--muted); }
.hdr-search input:focus { outline: none; }
.hdr-search button {
	width: 56px; flex: none; display: grid; place-items: center;
	background: color-mix(in srgb, var(--store-primary) 78%, #fff); color: var(--on-primary);
}
.hdr-search button .icon { width: 22px; height: 22px; }
.hdr-call { display: inline-flex; align-items: center; gap: 10px; color: var(--on-primary); flex: none; }
.hdr-call:hover { color: var(--on-primary); }
.hdr-call .icon { width: 30px; height: 30px; stroke-width: 1.5; }
.hdr-call small { display: block; font-size: 13px; }
.hdr-call bdi { display: block; font-weight: 700; font-size: 15px; line-height: 1.2; }
.hdr-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.hdr-icon {
	position: relative; width: 42px; height: 42px; display: grid; place-items: center;
	color: inherit; border-radius: 50%;
}
.hdr-main .hdr-icon:hover { color: var(--on-primary); background: rgba(255, 255, 255, .12); }
.hdr-icon .icon { width: 26px; height: 26px; stroke-width: 1.6; }
.hdr-count {
	position: absolute; top: 2px; inset-inline-end: 0; min-width: 19px; height: 19px; padding: 0 5px;
	border-radius: 10px; background: var(--store-accent); color: var(--on-accent);
	font-size: 11px; font-weight: 800; line-height: 19px; text-align: center;
}
.menu-toggle { display: none; }

.hdr-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.hdr-nav .container { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.cats-menu { position: relative; flex: none; }
.cats-btn {
	display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px;
	background: var(--store-primary); color: var(--on-primary); font-weight: 500; font-size: 16px;
	border-radius: var(--r-sm);
}
.cats-btn:hover { background: var(--store-primary-dark); }
.cats-drop {
	position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: 260px; padding: 8px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s;
}
.cats-menu.open .cats-drop, .cats-menu:focus-within .cats-drop { opacity: 1; visibility: visible; transform: none; }
.cats-drop a { display: block; padding: 9px 12px; border-radius: var(--r-sm); font-size: 15px; }
.cats-drop a:hover { background: var(--soft); }
.nav-list { display: flex; flex-wrap: wrap; gap: 0 26px; height: 66px; overflow: hidden; align-items: center; flex: 1; min-width: 0; }
.nav-list a { display: flex; align-items: center; height: 66px; font-size: 16px; font-weight: 500; }
.nav-track {
	display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 16px; font-weight: 500;
	padding-inline-start: 18px; border-inline-start: 1px solid var(--line);
}

/* الدرج الجانبيّ */
.drawer-backdrop {
	position: fixed; inset: 0; background: rgba(10, 15, 30, .5); z-index: 60;
	opacity: 0; visibility: hidden; transition: .2s;
}
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); z-index: 70;
	background: var(--surface); overflow-y: auto; padding: 18px;
	transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s;
}
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-open .drawer-backdrop, .filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head .brand-name { font-size: 19px; }
.drawer-nav a, .drawer-cats a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); font-weight: 500; }
.drawer-title { font-size: 16px; margin: 20px 0 6px; padding: 10px 14px; background: var(--store-primary); color: var(--on-primary); border-radius: var(--r-sm); }
.drawer-call { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-weight: 700; }

/* ------------------------------------------------------------------ الصناديق والأقسام */
.section { margin-top: 28px; }
.section-first { margin-top: 24px; }
.box { background: var(--surface); border-radius: var(--r); padding: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-title { font-size: 21px; font-weight: 700; line-height: 1.35; }
.sec-sub { color: var(--sale); font-weight: 500; font-size: 18px; }
.sec-sub-muted { color: var(--muted); font-weight: 500; font-size: 16px; }
.box-heading { font-size: 20px; font-weight: 700; margin-bottom: 14px; }

/* ------------------------------------------------------------------ الشريط العلويّ */
.top-strip { position: relative; height: 56px; overflow: hidden; background: var(--soft); }
.top-strip > a { display: flex; align-items: center; justify-content: center; height: 100%; position: relative; color: var(--store-text); }
.top-strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.strip-text { position: relative; font-size: 17px; padding: 4px 16px; background: rgba(255, 255, 255, .86); border-radius: var(--r-sm); }
.strip-text b { color: var(--store-primary-dark); font-weight: 800; }
.strip-close {
	position: absolute; top: 50%; inset-inline-end: 16px; transform: translateY(-50%);
	width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px;
	background: var(--store-text); color: #fff;
}
.strip-close .icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ دوائر التصنيف */
.cat-strip { padding: 18px 22px; }
.cat-row { position: relative; display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-circle { flex: 0 0 auto; width: 98px; text-align: center; scroll-snap-align: start; }
.cat-img { display: block; width: 98px; height: 98px; border-radius: 50%; overflow: hidden; background: var(--soft); transition: box-shadow .15s; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-circle:hover .cat-img { box-shadow: 0 0 0 3px var(--store-primary); }
.cat-circle h3 { margin-top: 10px; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ الواجهة: كتاب اليوم + سلايدر + بانران */
.hero-zone { display: grid; grid-template-columns: 220px minmax(0, 1fr) 310px; gap: 24px; height: 300px; }
.hero-zone:not(:has(.hero)) { grid-template-columns: 220px minmax(0, 1fr); }
.hero-zone:not(:has(.hero)) .hero-pair { flex-direction: row; }
.hero-zone:not(:has(.deal-panel)) { grid-template-columns: minmax(0, 1fr) 310px; }
.hero-zone:not(:has(.deal-panel)):not(:has(.hero)) { grid-template-columns: 1fr; }
.hero-zone:not(:has(> *)) { display: none; }
.deal-panel { background: var(--surface); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; overflow: hidden; }
.deal-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.deal-panel > div { flex: 1; min-height: 0; }
.deal-book { position: relative; height: 100%; display: flex; flex-direction: column; }
.deal-cover { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; background: var(--soft); border-radius: var(--r-sm); padding: 10px; }
.deal-cover img { height: 100%; width: auto; object-fit: contain; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.deal-book .badge { position: absolute; top: 8px; inset-inline-end: 8px; }
.deal-book h3 { font-size: 15px; font-weight: 700; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-book .book-author { margin: 0; }
.price-deal > span:first-child { color: var(--sale); }

.hero { position: relative; border-radius: var(--r); overflow: hidden; background: var(--soft); min-width: 0; }
.slider { position: relative; height: 100%; }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-body { position: relative; width: 56%; height: 100%; padding: 28px 32px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; }
.slide-eyebrow { color: var(--sale); font-weight: 800; font-size: 26px; line-height: 1.1; }
.slide-body h1, .slide-body h2 { font-size: 28px; font-weight: 800; line-height: 1.3; color: var(--store-text); }
.slide-body p { font-size: 14px; color: #3D4352; max-width: 380px; }
.slide-body .btn { margin-top: 8px; height: 40px; }
.slider-dots { position: absolute; bottom: 12px; inset-inline-start: 32px; display: flex; gap: 6px; }
.slider-dots button { width: 9px; height: 9px; border-radius: 9px; background: rgba(32, 35, 38, .28); transition: width .2s; }
.slider-dots button[aria-current="true"] { width: 26px; background: var(--store-primary); }

.hero-pair { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pair-banner { position: relative; flex: 1; border-radius: var(--r); overflow: hidden; background: var(--soft); color: var(--store-text); display: flex; align-items: center; }
.pair-banner:hover { color: var(--store-text); }
.pair-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pair-body { position: relative; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; max-width: 62%; }
.banner-eyebrow { color: var(--sale); font-weight: 700; font-size: 14px; }
.pair-body h3 { font-size: 20px; font-weight: 800; line-height: 1.3; }

/* ------------------------------------------------------------------ بطاقة الكتاب */
.book-grid { position: relative; display: grid; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); gap: 22px 20px; }
.listing-grid { --cols: calc(var(--per) - 1); grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.author-grid { grid-template-columns: repeat(var(--per), minmax(0, 1fr)); }
.book-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.book-media { position: relative; aspect-ratio: 3 / 4; background: var(--soft); border-radius: var(--r-sm); display: grid; place-items: center; padding: 16px 18%; overflow: hidden; }
.book-cover { display: block; width: 100%; }
.book-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 8px 16px rgba(20, 25, 40, .2); transition: transform .2s; }
.book-card:hover .book-cover img { transform: translateY(-4px); }
.type-dot {
	position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2;
	width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff;
	box-shadow: 0 0 0 2px #fff;
}
.type-dot .icon { width: 15px; height: 15px; stroke-width: 2; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-educational); }
.book-badges { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; line-height: 1.6; }
.badge-sale { background: var(--sale); color: #fff; }
.badge-new { background: var(--store-primary); color: var(--on-primary); }
.book-wish {
	position: absolute; bottom: 8px; inset-inline-end: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
	display: grid; place-items: center; background: var(--surface); color: var(--store-text); box-shadow: var(--shadow);
	opacity: 0; transition: opacity .15s;
}
.book-wish .icon { width: 18px; height: 18px; }
.book-wish[aria-pressed="true"] .icon { fill: var(--sale); stroke: var(--sale); }
.book-card:hover .book-wish, .book-wish:focus-visible, .book-wish[aria-pressed="true"] { opacity: 1; }
@media (hover: none) { .book-wish { opacity: 1; } }
.stock-band { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding: 6px; background: rgba(32, 35, 38, .88); color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.book-card.is-out .book-cover img { filter: grayscale(.7); opacity: .75; }
.book-body { padding-top: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.book-title { font-size: 15px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.stars { display: inline-flex; gap: 1px; color: var(--star); }
.stars .icon { width: 14px; height: 14px; }
.stars .off { color: var(--star-off); }
.rating-count { color: var(--muted); }
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 8px; font-weight: 700; color: var(--price); }
.price del { color: var(--muted); font-weight: 500; font-size: .87em; }
.book-foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.book-cta { position: absolute; bottom: 8px; inset-inline-start: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--store-accent); color: var(--on-accent); box-shadow: 0 3px 10px rgba(20, 25, 40, .18); transition: background-color .15s; }
.book-cta:hover { background: var(--accent-hover); }
.book-cta .icon { width: 18px; height: 18px; }

/* أشكال البطاقة */
body[data-card-style="framed"] .book-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 10px 14px; }
body[data-card-style="framed"] .book-media { background: var(--soft); }
body[data-card-style="minimal"] .book-media { background: transparent; padding: 0; aspect-ratio: auto; }
body[data-card-style="minimal"] .book-cover img { box-shadow: 0 4px 12px rgba(20, 25, 40, .16); }

/* ------------------------------------------------------------------ صفّ الكتب مع بانرٍ طرفيّ */
.row-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 0 22px; }
.row-split.banner-first { grid-template-columns: 280px minmax(0, 1fr); }
.row-split.banner-first .side-banner { order: -1; }
.row-split:not(:has(.side-banner)) { grid-template-columns: minmax(0, 1fr); }
.row-split:not(:has(.row-main)) { grid-template-columns: minmax(0, 1fr); }
.row-split:not(:has(.row-main)) .side-banner { margin-top: 0; min-height: 260px; }
.row-split:not(:has(> *)) { display: none; }
.row-main { min-width: 0; }
body[data-books-per-row="5"] .row-line > :nth-child(n+6) { display: none; }
body[data-books-per-row="4"] .row-line > :nth-child(n+5) { display: none; }
body[data-books-per-row="6"] .row-line > :nth-child(n+7) { display: none; }
.side-banner { position: relative; margin-top: 50px; border-radius: var(--r-sm); overflow: hidden; background: var(--soft); color: var(--store-text); min-height: 300px; }
.side-banner:hover { color: var(--store-text); }
.side-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side-banner-body { position: relative; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.side-banner-body h3 { font-size: 22px; font-weight: 800; line-height: 1.3; }
.side-banner-body .btn { margin-top: 6px; }
.side-banner.is-dark, .side-banner.is-dark:hover { color: #fff; }
.side-banner.is-dark .banner-eyebrow { color: var(--store-accent); }

/* ------------------------------------------------------------------ البانر العريض */
.wide-banner { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1600 / 320; min-height: 180px; border-radius: var(--r); overflow: hidden; background: #123C82; color: #fff; text-align: center; }
.wide-banner:hover { color: #fff; }
.wide-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wide-body { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.wide-body b { font-size: 34px; font-weight: 800; line-height: 1.25; }
.wide-body > span { font-size: 17px; }
.wide-body mark { background: var(--store-accent); color: var(--on-accent); padding: 0 6px; border-radius: 3px; text-shadow: none; font-weight: 700; }

/* ------------------------------------------------------------------ التصنيفات المميّزة */
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feat-cat { display: block; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.feat-cat img { width: 100%; aspect-ratio: 560 / 270; object-fit: cover; transition: transform .25s; }
.feat-cat:hover img { transform: scale(1.03); }
.feat-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--surface); position: relative; }
.feat-name b { font-size: 16px; }
.feat-name small { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ المؤلّفون */
.author-row { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.author-card { text-align: center; }
.author-card img { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 10px; object-fit: cover; background: var(--soft); transition: box-shadow .15s; }
.author-card:hover img { box-shadow: 0 0 0 3px var(--store-primary); }
.author-card h3 { font-size: 16px; font-weight: 700; }
.author-card span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ اللوحات الأربع */
.quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.quad-panel { background: var(--surface); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.quad-title { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.quad-book h3, .carousel-book h3 { font-size: 15px; font-weight: 500; margin-top: 10px; line-height: 1.45; }
.quad-book .price, .carousel-book .price { justify-content: flex-start; }
.quad-gallery { display: flex; gap: 10px; height: 230px; }
.quad-thumbs { display: flex; flex-direction: column; gap: 8px; }
.quad-thumbs button { width: 46px; border: 1px solid var(--line); border-radius: 3px; padding: 3px; background: var(--surface); }
.quad-thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.quad-main { flex: 1; display: flex; justify-content: center; align-items: center; background: var(--soft); border-radius: var(--r-sm); }
.quad-main img { height: 88%; width: auto; box-shadow: 0 8px 16px rgba(20, 25, 40, .2); }
.carousel { position: relative; }
.carousel-track { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; gap: 16px; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-book { flex: 0 0 100%; scroll-snap-align: start; }
.carousel-book > a { display: flex; justify-content: center; align-items: center; height: 230px; background: var(--soft); border-radius: var(--r-sm); }
.carousel-book > a img { height: 88%; width: auto; box-shadow: 0 8px 16px rgba(20, 25, 40, .2); }
.carousel-btn {
	position: absolute; top: 115px; transform: translateY(-50%); z-index: 2; width: 34px; height: 34px; border-radius: 50%;
	display: grid; place-items: center; background: var(--surface); color: var(--store-text); box-shadow: var(--shadow);
}
.carousel-btn:hover { color: var(--store-primary); }
.carousel-btn.prev { inset-inline-start: 6px; }
.carousel-btn.next { inset-inline-end: 6px; }
.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.quad-cat { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.quad-img { display: block; aspect-ratio: 1; background: var(--soft); border-radius: var(--r-sm); overflow: hidden; }
.quad-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.quad-cat:hover .quad-img img { transform: scale(1.05); }

/* ------------------------------------------------------------------ شاهدتَه مؤخّرًا */
.recent-row { position: relative; display: flex; gap: 18px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.recent-item { flex: 0 0 auto; width: 98px; }
.recent-item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; transition: transform .2s; }
.recent-item:hover img { transform: translateY(-3px); }

/* ------------------------------------------------------------------ الوسوم */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { padding: 9px 20px; background: var(--soft); border-radius: var(--r-sm); font-size: 14px; }
.tag:hover { background: var(--store-primary); color: var(--on-primary); }

/* ------------------------------------------------------------------ البطاقات الترويجيّة */
.promo-carousel .carousel-btn { top: 50%; }
.promo-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px; }
.promo-card { position: relative; display: block; aspect-ratio: 640 / 720; border-radius: var(--r); overflow: hidden; background: var(--soft); color: var(--store-text); scroll-snap-align: start; }
.promo-card:hover { color: var(--store-text); }
.promo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.promo-card:hover img { transform: scale(1.03); }
.promo-body { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 18px 20px; }
.promo-body small { font-size: 13px; color: #3D4352; }
.promo-body b { font-size: 21px; font-weight: 800; line-height: 1.3; }
.promo-body > span { font-size: 14px; color: #3D4352; }

/* ------------------------------------------------------------------ النشرة البريديّة */
.newsletter {
	display: grid; grid-template-columns: 1fr 1fr minmax(0, 1.1fr); align-items: center; gap: 28px;
	background: var(--store-primary); color: var(--on-primary); border-radius: var(--r); padding: 34px 44px;
}
.nl-head h2 { font-size: 24px; font-weight: 700; }
.nl-head p { font-size: 15px; margin-top: 4px; }
.nl-promise { display: flex; align-items: center; gap: 14px; padding-inline-start: 28px; border-inline-start: 1px solid rgba(255, 255, 255, .35); font-size: 17px; font-weight: 500; }
.nl-promise .icon { width: 40px; height: 40px; stroke-width: 1.4; }
.nl-field { display: flex; height: 52px; background: var(--surface); border-radius: var(--r-sm); overflow: hidden; }
.nl-field input { flex: 1; min-width: 0; border: 0; padding: 0 18px; color: var(--store-text); }
.nl-field input::placeholder { color: var(--muted); }
.nl-field input:focus { outline: none; }
.nl-field button { padding: 0 28px; background: var(--store-accent); color: var(--on-accent); font-weight: 800; }
.nl-field button:hover { background: var(--accent-hover); }
body[data-show-newsletter="false"] .newsletter-section { display: none; }
[data-option]:empty { display: none; }
.nl-promise:not(:has([data-option]:not(:empty))) { display: none; }

/* ------------------------------------------------------------------ شريط الثقة والتذييل */
.trust-strip { background: var(--trust); color: #fff; margin-top: 36px; }
.trust-strip .container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-block: 28px; }
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item > .icon { width: 34px; height: 34px; color: var(--store-accent); stroke-width: 1.5; }
.trust-item h3 { font-size: 16px; font-weight: 700; }
.trust-item p { font-size: 14px; color: #C9CCD3; }
body[data-show-trust-bar="false"] .trust-strip { display: none; }
body[data-show-trust-bar="false"] .site-footer { margin-top: 36px; }

.site-footer { background: var(--footer); color: var(--footer-text); padding-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.4fr; gap: 28px; }
.footer-col h3 { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a:hover { color: var(--store-accent); }
.footer-phone { display: inline-flex; align-items: center; gap: 10px; color: var(--store-accent); font-size: 21px; font-weight: 700; margin-bottom: 12px; }
.footer-phone:hover { color: var(--store-accent); }
.footer-phone .icon { width: 28px; height: 28px; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact li .icon { margin-top: 3px; }
.social { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.social a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #3A3D44; border-radius: 50%; color: #fff; }
.social a:hover { background: var(--store-accent); border-color: var(--store-accent); color: var(--on-accent); }
.social .icon { width: 17px; height: 17px; }
.footer-about p { font-size: 14.5px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 34px; padding-block: 20px; border-top: 1px solid #2C2E33; font-size: 14px; }
.footer-bottom .brand, .footer-bottom .brand:hover { color: #fff; }
.footer-bottom .brand img { width: 40px; height: 40px; }

/* ------------------------------------------------------------------ عنوان الصفحات الداخليّة */
.box-title { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; padding: 20px 24px; }
.box-title h1 { font-size: 24px; font-weight: 800; }
.page-lead { color: var(--muted); font-size: 15px; flex-basis: 100%; order: 2; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: '‹'; margin-inline-end: 6px; }
.breadcrumb a:hover { color: var(--store-primary); }
.breadcrumb [aria-current] { color: var(--store-text); font-weight: 500; }
.section-first > .container > nav .breadcrumb { margin-bottom: 14px; }

/* ------------------------------------------------------------------ صفحة التصنيف */
.listing { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.filters-head h2 { font-size: 19px; }
.filters-head .hdr-icon { display: none; }
.filter-box { background: var(--surface); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.filter-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.filter-cats a { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14.5px; }
.check { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14.5px; cursor: pointer; }
.check input { accent-color: var(--store-primary); width: 16px; height: 16px; }
.count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.price-range { display: flex; align-items: center; gap: 8px; }
.field { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--store-text); }
textarea.field { height: auto; padding: 10px 12px; resize: vertical; }
.field:focus { outline: 2px solid var(--store-primary); outline-offset: -1px; }
.listing-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cat-banner { position: relative; border-radius: var(--r); overflow: hidden; min-height: 190px; display: flex; align-items: center; background: var(--soft); }
.cat-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-banner-body { position: relative; padding: 24px 30px; max-width: 60%; }
.cat-banner-body h2 { font-size: 30px; font-weight: 800; }
.cat-banner-body p { color: #3D4352; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.toolbar select { width: auto; min-width: 170px; }
.filters-toggle { display: none; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 8px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 500; }
.pagination span { border-color: transparent; }
.pagination a[aria-current="page"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--on-primary); }
.pagination a:hover:not([aria-current]) { border-color: var(--store-primary); }

/* ------------------------------------------------------------------ صفحة الكتاب */
.pdp { display: grid; grid-template-columns: 380px minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.gallery-sticky, .buy-sticky { position: sticky; top: 161px; }
.gallery-sticky { background: var(--surface); border-radius: var(--r); padding: 18px; }
.gallery-main { position: relative; background: var(--soft); border-radius: var(--r-sm); padding: 34px 50px; }
.gallery-main img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 14px 30px rgba(20, 25, 40, .25); }
.gallery-main .type-dot { top: 12px; inset-inline-start: 12px; width: 34px; height: 34px; }
.gallery-main .type-dot .icon { width: 18px; height: 18px; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; justify-content: center; }
.thumbs button { width: 62px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); box-shadow: 0 0 0 1px var(--store-primary); }
.pdp-info { background: var(--surface); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.pdp-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.type-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.type-label .type-dot { position: static; width: 24px; height: 24px; box-shadow: none; }
.type-label .type-dot .icon { width: 13px; height: 13px; }
.pdp-info h1 { font-size: 30px; font-weight: 800; line-height: 1.3; }
.pdp-author { color: var(--muted); }
.pdp-author a { color: var(--store-primary); font-weight: 700; }
.rating-lg .stars .icon { width: 18px; height: 18px; }
.pdp-price { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.price-lg { font-size: 26px; justify-content: flex-start; }
.pdp-meta-line { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pdp-meta-line b { color: var(--store-text); }
.pdp-lead { color: #3D4352; font-size: 15.5px; line-height: 1.8; }
.pdp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.pdp-facts li { background: var(--soft); border-radius: var(--r-sm); padding: 10px 14px; display: flex; flex-direction: column; }
.pdp-facts span { font-size: 13px; color: var(--muted); }
.pdp-facts b { font-size: 15px; }
.buy-sticky { background: var(--surface); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--store-primary); }
.buy-price .price { justify-content: flex-start; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: var(--price); font-weight: 700; font-size: 14px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); height: 44px; background: var(--surface); width: max-content; }
.qty button { width: 40px; height: 100%; display: grid; place-items: center; }
.qty button:hover { color: var(--store-primary); }
.qty input { width: 46px; height: 100%; border: 0; text-align: center; -moz-appearance: textfield; background: transparent; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ship-box { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.ship-box li { display: flex; align-items: center; gap: 8px; }
.ship-box .icon { color: var(--store-primary); }
.pdp-more { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.prose p + p { margin-top: 10px; }
.prose { color: #3D4352; line-height: 1.85; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec-table th, .spec-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.spec-table th { color: var(--muted); font-weight: 500; width: 42%; }
.spec-table tr:nth-child(odd) { background: #F7F8FB; }
.reviews-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
.reviews-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reviews-summary strong { font-size: 44px; font-weight: 800; line-height: 1; }
.rating-bars { margin: 14px 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.rating-bars li { display: grid; grid-template-columns: 54px 1fr 36px; gap: 8px; align-items: center; }
.bar { height: 8px; background: var(--soft); border-radius: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--star); }
.review-form { border: 1px dashed var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: #FAFBFD; }
.review-form h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.review-form p { font-size: 14px; color: var(--muted); }
.star-field { border: 0; margin: 0; padding: 0; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.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: 24px; height: 24px; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-primary); }
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-item { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.review-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.review-item p { color: #3D4352; }
.review-item small { color: var(--muted); font-size: 13px; }
.review-list-kit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
body[data-show-reviews="false"] .reviews-section { display: none; }

/* ------------------------------------------------------------------ صفحة المؤلّف */
.author-head { display: flex; gap: 28px; align-items: flex-start; padding: 28px; }
.author-head > img { width: 170px; height: 170px; border-radius: 50%; flex: none; object-fit: cover; border: 4px solid var(--soft); }
.author-info h2 { font-size: 28px; font-weight: 800; }
.author-stats { display: flex; gap: 12px; margin: 12px 0 16px; flex-wrap: wrap; }
.author-stats li { background: var(--soft); border-radius: var(--r-sm); padding: 8px 16px; display: flex; flex-direction: column; }
.author-stats b { font-size: 20px; color: var(--store-primary-dark); line-height: 1.3; }
.author-stats span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.cart-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; background: #FFFBDB; border: 1px solid #F3E58A; border-radius: var(--r-sm); font-size: 14.5px; }
.cart-note .icon { color: var(--store-primary-dark); }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: start; font-size: 14px; color: var(--muted); font-weight: 500; padding: 10px; background: var(--soft); }
.cart-table td { padding: 16px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-book { display: flex; gap: 14px; align-items: center; }
.cart-thumb { flex: none; width: 70px; background: var(--soft); padding: 6px; border-radius: var(--r-sm); }
.cart-book h3 { font-size: 15.5px; font-weight: 700; }
.cart-book p { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.cart-table .price { justify-content: flex-start; flex-direction: column; gap: 0; }
.cart-remove { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.cart-remove:hover { background: #FDECEC; color: var(--sale); }
.cart-under { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.summary { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 161px; }
.summary h2 { font-size: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.coupon { display: flex; gap: 8px; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; background: #EAF6EE; border-radius: var(--r-sm); font-size: 14px; color: #0F5E2B; }
.coupon-applied button { color: var(--sale); font-weight: 700; font-size: 13px; }
.summary-row { display: flex; justify-content: space-between; font-size: 15px; }
.summary-row .minus { color: var(--sale); }
.summary-total { font-size: 18px; font-weight: 800; padding-top: 10px; border-top: 1px solid var(--line); }
.summary-perks { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--muted); }
.summary-perks li { display: flex; gap: 8px; align-items: center; }
.empty-cart { text-align: center; padding: 30px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-cart[hidden] { display: none; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--store-primary); }
.empty-icon .icon { width: 34px; height: 34px; }
.empty-cart p { color: var(--muted); margin-bottom: 6px; }

/* ------------------------------------------------------------------ 404 */
.nf { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 22px 40px; }
.nf-art { width: 280px; max-width: 100%; height: auto; }
.nf-code { font-size: 64px; font-weight: 800; line-height: 1; color: var(--store-primary-dark); }
.nf h1 { font-size: 26px; font-weight: 800; }
.nf p { color: var(--muted); max-width: 460px; }
.nf-search { display: flex; gap: 8px; width: 100%; max-width: 480px; margin: 8px 0; }
.nf-search input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ------------------------------------------------------------------ components.html */
.kit-title { font-size: 17px; font-weight: 700; margin: 22px 0 12px; }
.kit .box > .kit-title:first-child, .kit .cat-strip > .kit-title:first-child { margin-top: 0; }
.kit-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.swatch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.kit-pair { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 10px; }
.kit-toolbar { padding: 0 0 14px; }
@media (max-width: 767px) { .kit-pair { grid-template-columns: 1fr; } }
.swatch span { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); }

/* ------------------------------------------------------------------ الاستجابة */
@media (max-width: 1260px) {
	.hdr-call { display: none; }
	.hero-zone { grid-template-columns: 200px minmax(0, 1fr) 270px; }
	.footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
	.footer-about { grid-column: 1 / -1; }
}
@media (max-width: 1199px) {
	body { --per: 4 !important; }
	body[data-books-per-row] .row-line > :nth-child(n+5) { display: none; }
	.row-split { grid-template-columns: minmax(0, 1fr) 240px; }
	.row-split.banner-first { grid-template-columns: 240px minmax(0, 1fr); }
	.pdp { grid-template-columns: 320px minmax(0, 1fr); }
	.buy-box { grid-column: 2; }
	.quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.author-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
	.menu-toggle { display: grid; }
	.hdr-nav { display: none; }
	.gallery-sticky, .buy-sticky { top: 82px; }
	.hdr-main .container { gap: 12px; min-height: 66px; }
	.hdr-account { display: none; }
	.hero-zone { grid-template-columns: minmax(0, 1fr) 260px; height: auto; }
	.hero-zone > .hero { height: 280px; }
	.deal-panel { display: none; }
	.hero-zone:not(:has(.deal-panel)) { grid-template-columns: minmax(0, 1fr) 260px; }
	.listing { grid-template-columns: 1fr; }
	.filters {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70; width: min(340px, 88vw);
		overflow-y: auto; background: var(--store-bg); padding: 18px;
		transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s;
	}
	.filters-open .filters { transform: none; visibility: visible; }
	.filters-head .hdr-icon { display: grid; }
	.filters-toggle { display: inline-flex; }
	.listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.newsletter { grid-template-columns: 1fr 1fr; padding: 28px; }
	.nl-field { grid-column: 1 / -1; }
	.trust-strip .container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.author-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.promo-track { grid-auto-columns: calc((100% - 2 * 20px) / 3); }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.reviews-layout { grid-template-columns: 1fr; }
	.pdp-more { grid-template-columns: 1fr; }
}
@media (max-width: 899px) {
	body { --per: 3 !important; }
	body[data-books-per-row] .row-line > :nth-child(n+4) { display: none; }
	.row-split, .row-split.banner-first { grid-template-columns: 1fr; }
	.side-banner { margin-top: 20px; min-height: 220px; }
	.row-split.banner-first .side-banner { order: 0; }
	.pdp { grid-template-columns: 280px minmax(0, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-contact { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
	.section { margin-top: 18px; }
	.box { padding: 16px; }
	.hdr-main .container { flex-wrap: wrap; padding-block: 10px; row-gap: 10px; }
	.brand-name { font-size: 19px; }
	.brand img { width: 38px; height: 38px; }
	.hdr-actions { margin-inline-start: auto; gap: 2px; }
	.hdr-search { order: 5; flex-basis: 100%; height: 44px; }
	.hdr-search select { display: none; }
	.top-strip { height: 48px; }
	.strip-text { font-size: 14px; margin-inline-end: 40px; }
	.strip-text > span { display: none; }
	.hero-zone { grid-template-columns: 1fr; }
	.hero-zone:not(:has(.deal-panel)) { grid-template-columns: 1fr; }
	.hero-zone > .hero { height: auto; }
	.slides { height: auto; align-items: stretch; }
	.slide { height: auto; display: flex; flex-direction: column; }
	.slide > img { position: relative; order: 2; height: 150px; object-position: 0 50%; }
	.slide-body { width: 100%; height: auto; padding: 22px 20px 12px; justify-content: flex-start; }
	.slide-body h1, .slide-body h2 { font-size: 23px; }
	.slide-eyebrow { font-size: 21px; }
	.slider-dots { inset-inline-start: auto; inset-inline-end: 16px; bottom: 10px; }
	.hero-pair { flex-direction: row; }
	.pair-banner { min-height: 130px; }
	.pair-body { max-width: 80%; }
	.pair-body h3 { font-size: 17px; }
	.sec-head { flex-wrap: wrap; gap: 4px 12px; }
	.sec-title { font-size: 18px; }
	.sec-sub { font-size: 15px; }
	.wide-body b { font-size: 22px; }
	.wide-body > span { font-size: 14px; }
	.quad { grid-template-columns: 1fr; }
	.quad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
	.quad-cat { font-size: 12.5px; }
	.pdp { grid-template-columns: 1fr; }
	.buy-box { grid-column: auto; }
	.gallery-main { padding: 24px 22%; }
	.pdp-info h1 { font-size: 24px; }
	.author-head { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
	.author-stats { justify-content: center; }
	.cat-banner-body { max-width: 80%; padding: 18px; }
	.cat-banner-body h2 { font-size: 24px; }
	.newsletter { grid-template-columns: 1fr; padding: 24px 20px; gap: 18px; }
	.nl-promise { padding-inline-start: 0; border-inline-start: 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .35); font-size: 15px; }
	.nl-field button { padding: 0 18px; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }
	.review-list-kit { grid-template-columns: 1fr; }
	/* الجدول يصير بطاقات */
	.cart-table thead { display: none; }
	.cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
	.cart-table tr { position: relative; border-bottom: 1px solid var(--line); padding: 12px 0; }
	.cart-table td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
	.cart-table td:first-child { display: block; padding-inline-end: 44px; }
	.cart-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 14px; }
	.cart-table .price { align-items: flex-end; }
	.cell-remove { position: absolute; top: 12px; inset-inline-end: 0; width: auto !important; padding: 0 !important; }
}
@media (max-width: 639px) {
	body { --per: 2 !important; }
	/* الصفوف تمرّ أفقيًّا في الهاتف */
	.book-grid:not(.listing-grid) { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; gap: 14px; }
	.book-grid:not(.listing-grid)::-webkit-scrollbar { display: none; }
	.book-grid:not(.listing-grid) > * { scroll-snap-align: start; }
	body[data-books-per-row] .row-line > :nth-child(n) { display: flex; }
	.listing-grid, .author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
	.book-media { padding: 12px 16%; }
	.hero-pair { flex-direction: column; }
	.feat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.feat-name { flex-direction: column; gap: 0; padding: 8px 10px; }
	.feat-name b { font-size: 14.5px; }
	.author-row { grid-template-columns: repeat(6, 110px); overflow-x: auto; scrollbar-width: none; }
	.author-card img { width: 96px; height: 96px; }
	.promo-track { grid-auto-columns: 78%; gap: 14px; }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
	.box-title h1 { font-size: 21px; }
	.toolbar p { font-size: 14px; }
	.toolbar select { min-width: 140px; }
	.coupon { flex-wrap: wrap; }
	.coupon .btn { flex: 1; }
	.nf-search { flex-direction: column; }
	.cart-under .btn { flex: 1; }
	.recent-item { width: 84px; }
}

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

/* ------------------------------------------------------------------ ميزات المنصّة المعتمدة */
/* العروض محدودة المدّة في الشريط العلويّ (offer.ends_at) */
.strip-timer { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 10px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); font-weight: 700; color: var(--store-primary-dark); white-space: nowrap; }
.strip-timer[hidden] { display: none; }
.strip-timer .icon { width: 17px; height: 17px; }
.offer-clock { font-variant-numeric: tabular-nums; }
.offer-clock b { font-weight: 800; }
/* قسيمة الترحيب تحت حقل النشرة (newsletter.offer) */
.nl-sub { min-width: 0; }
.nl-offer { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14.5px; font-weight: 700; }
.nl-offer .icon { width: 20px; height: 20px; flex: none; }
@media (max-width: 1023px) { .nl-sub { grid-column: 1 / -1; } }
@media (max-width: 767px) {
	.top-strip .strip-text > .strip-timer { display: inline-flex; margin-inline-start: 6px; padding-inline-start: 8px; }
	.strip-timer-label { display: none; }
}

/* ------------------------------------------------------------------ الإصدار الثاني: إضافات مستوى المتجر */
/* النظرة السريعة: تطفو فوق الغلاف فوق زرّ المفضّلة، ولا تحجز مكانًا */
.book-quick {
	position: absolute; bottom: 50px; inset-inline-end: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
	display: grid; place-items: center; background: var(--surface); color: var(--store-text); box-shadow: var(--shadow);
	opacity: 0; transition: opacity .15s;
}
.book-quick .icon { width: 18px; height: 18px; }
.book-quick:hover, .book-wish:hover { color: var(--store-primary); }
.book-card:hover .book-quick, .book-quick:focus-visible { opacity: 1; }
@media (hover: none) { .book-quick { opacity: 1; } }

/* تبويبات صفّ الكتب (القاعدة 16) */
.sec-head:has(.row-tabs) { flex-wrap: wrap; }
.row-tabs { display: flex; gap: 6px; flex: 1; justify-content: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.row-tabs::-webkit-scrollbar { display: none; }
.row-tabs [role="tab"] { flex: none; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--soft); font-size: 14px; font-weight: 500; color: var(--store-text); white-space: nowrap; }
.row-tabs [role="tab"]:hover { color: var(--store-primary); }
.row-tabs [role="tab"][aria-selected="true"] { background: var(--store-primary); color: var(--on-primary); }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* صندوقٌ بلونٍ خفيف لتمييز قسمٍ عن جاره */
.box-tint { background: color-mix(in srgb, var(--store-primary) 7%, var(--surface)); }
.box-tint .tag { background: var(--surface); }

/* آراء القرّاء في الرئيسيّة (reviews.items وتقييم المتجر) */
.rv-box { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; }
.rv-score { background: var(--store-primary); color: var(--on-primary); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rv-title { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.rv-score strong { font-size: 52px; font-weight: 800; line-height: 1; }
.rv-score .stars { color: var(--store-accent); }
.rv-score small { font-size: 14px; }
.rv-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rv-card { background: var(--surface); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.rv-top { display: flex; align-items: center; justify-content: space-between; }
.rv-quote { width: 30px; height: 30px; color: var(--store-primary); stroke-width: 2; }
.rv-card p { color: #3D4352; line-height: 1.75; }
.rv-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.rv-foot b { display: block; font-size: 15px; }
.rv-foot small { display: block; font-size: 13px; color: var(--muted); }
.rv-foot small a { color: var(--store-primary); font-weight: 700; }
.rv-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--store-accent); color: var(--on-accent); font-weight: 800; }
body[data-show-reviews="false"] .home-reviews { display: none; }

/* المدوّنة (latest_posts) */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.post-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s; }
.post-media { display: block; overflow: hidden; }
.post-card:hover .post-media img { transform: scale(1.03); }
.post-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.post-date .icon { width: 15px; height: 15px; }
.post-title { font-size: 17px; font-weight: 700; line-height: 1.45; }
.post-excerpt { font-size: 14px; color: #3D4352; }
.post-body .link-arrow { margin-top: auto; padding-top: 4px; }

@media (max-width: 1199px) {
	.row-tabs { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
@media (max-width: 1023px) {
	.rv-box { grid-template-columns: 1fr; }
	.rv-score { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 16px 20px; }
	.rv-title { margin: 0; flex-basis: 100%; }
	.rv-score strong { font-size: 40px; }
}
@media (max-width: 767px) {
	.rv-list, .post-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; }
	.rv-list::-webkit-scrollbar, .post-grid::-webkit-scrollbar { display: none; }
	.rv-list > *, .post-grid > * { scroll-snap-align: start; }
	/* شريط الثقة: صفٌّ واحد يُمرَّر أفقيًّا */
	.trust-strip .container { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 22px; padding-block: 16px; }
	.trust-strip .container::-webkit-scrollbar { display: none; }
	.trust-item { flex: 0 0 auto; max-width: 250px; scroll-snap-align: start; gap: 10px; }
	.trust-item > .icon { width: 28px; height: 28px; }
	.trust-item h3 { font-size: 15px; }
	.trust-item p { font-size: 13px; }
	/* صورة الشريحة تحت نصّها، وتُعرض رسومها لا فراغها */
	.slide > img { height: 190px; object-fit: cover; object-position: 0 50%; }
}

/* صفحة التصنيف: عمود التصفية بطول الشبكة، وبانرٌ يملأ ما تحت التصفية */
.listing { align-items: stretch; }
.filters { display: flex; flex-direction: column; }
.filters-banner { flex: 1 1 auto; margin-top: 16px; min-height: 320px; }
.filters-banner img { object-position: 50% 100%; }
body[data-books-per-row="6"] .listing-grid { --cols: 4; }
.toolbar > p { flex: none; }
.active-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 15px; background: var(--soft); font-size: 13.5px; font-weight: 500; }
.chip .icon { width: 14px; height: 14px; }
.chip:hover { background: var(--store-primary); color: var(--on-primary); }
.chip-clear { font-size: 13.5px; color: var(--sale); font-weight: 700; padding-inline: 4px; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.view-switch button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); }
.view-switch button + button { border-inline-start: 1px solid var(--line); }
.view-switch button[aria-pressed="true"] { background: var(--store-primary); color: var(--on-primary); }
.view-switch .icon { width: 20px; height: 20px; }
.book-desc { display: none; }
/* عرض القائمة: الغلاف بجانب النصّ، والنبذة ظاهرة */
.listing-grid.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.listing-grid.is-list .book-card { flex-direction: row; gap: 22px; align-items: center; padding-block: 16px; border-bottom: 1px solid var(--line); }
.listing-grid.is-list .book-card:nth-child(-n+2) { padding-top: 0; }
.listing-grid.is-list .book-card:nth-last-child(-n+2) { border-bottom: 0; padding-bottom: 0; }
.listing-grid.is-list .book-media { flex: 0 0 140px; padding: 12px 14px; }
.listing-grid.is-list .book-body { align-items: flex-start; text-align: start; padding-top: 0; flex: 1; min-width: 0; }
.listing-grid.is-list .book-title { font-size: 17px; font-weight: 700; }
.listing-grid.is-list .book-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #3D4352; font-size: 14px; line-height: 1.7; margin: 2px 0 6px; }
.listing-grid.is-list .price { justify-content: flex-start; font-size: 17px; }
body[data-card-style="framed"] .listing-grid.is-list .book-card { border: 1px solid var(--line); margin-bottom: 12px; padding: 12px; }
/* دوائر التصنيف تتوزّع على عرض الصندوق حين تتّسع لها، وتُمرَّر حين تضيق */
.cat-row { justify-content: space-between; }
@media (max-width: 899px) {
	.listing-grid.is-list { grid-template-columns: minmax(0, 1fr); }
	.listing-grid.is-list .book-card:nth-child(2) { padding-top: 16px; }
	.listing-grid.is-list .book-card:nth-last-child(2) { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
}
@media (max-width: 1023px) {
	.filters-banner { display: none; }
	.listing { align-items: start; }
}
@media (max-width: 639px) {
	.toolbar { padding: 12px 14px; }
	.toolbar-actions { width: 100%; }
	.toolbar-actions select { flex: 1; min-width: 0; }
	.listing-grid.is-list .book-media { flex-basis: 112px; padding: 10px; }
	.listing-grid.is-list .book-card { gap: 14px; }
	.listing-grid.is-list .book-desc { font-size: 13.5px; }
	.listing-grid.is-list .book-title { font-size: 16px; }
}

/* صفحات الكتاب: اختيار النسخة (book.formats)، تختفي إن لم يكن للعنوان غير نسخةٍ واحدة */
.formats { display: flex; flex-direction: column; gap: 8px; }
.formats-label { font-size: 14px; font-weight: 700; }
.formats-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.format-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); text-align: center; font-size: 13.5px; }
.format-opt .type-dot { position: static; width: 24px; height: 24px; box-shadow: none; margin-bottom: 2px; }
.format-opt .type-dot .icon { width: 13px; height: 13px; }
.format-name { font-weight: 700; }
.format-price { color: var(--price); font-weight: 700; font-size: 13px; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt[aria-current="page"] { border-color: var(--store-primary); box-shadow: inset 0 0 0 1px var(--store-primary); background: color-mix(in srgb, var(--store-primary) 6%, var(--surface)); }
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ .format-opt)) { display: none; }
/* الوصف ونبذة المؤلّف في عمود، والتفاصيل في عمود بالطول نفسه */
.pdp-more { align-items: stretch; }
.pdp-more-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.pdp-more-main > .author-mini { flex: 1; }
.prose ul { list-style: disc; padding-inline-start: 22px; margin: 6px 0; }
.prose li + li { margin-top: 4px; }
.author-mini { display: flex; gap: 20px; align-items: center; }
.author-mini > img, .author-mini-avatar { width: 96px; height: 96px; flex: none; border-radius: 50%; object-fit: cover; }
.author-mini-avatar { display: grid; place-items: center; background: var(--store-primary); color: var(--on-primary); font-size: 38px; font-weight: 800; }
.author-mini-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.author-mini-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.author-mini h2 { font-size: 19px; font-weight: 800; }
.author-mini p { color: #3D4352; font-size: 14.5px; }
@media (max-width: 639px) {
	.author-mini { flex-direction: column; align-items: flex-start; gap: 12px; }
	.author-mini > img, .author-mini-avatar { width: 72px; height: 72px; font-size: 28px; }
}

/* أعمال المؤلّف: صفٌّ واحد يُمرَّر أفقيًّا، فلا يبقى صفٌّ نصف فارغ */
.works-row { display: grid; gap: 22px 20px; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per) - 1) * 20px) / var(--per)); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 10px; }
.works-row > * { scroll-snap-align: start; }
.works-carousel .carousel-btn { top: 38%; }
@media (max-width: 639px) { .works-carousel .carousel-btn { display: none; } }

/* صفحتا المدوّنة والمقال */
.post-grid-page { row-gap: 26px; }
.post-article { padding: 28px 22px 32px; }
.post-narrow { max-width: 780px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.post-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm); }
.post-content { font-size: 16.5px; }
.post-content h2 { font-size: 21px; font-weight: 800; color: var(--store-text); margin: 22px 0 8px; }
.post-content p + p { margin-top: 12px; }
@media (max-width: 1023px) { .post-grid-page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .post-grid-page { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; } }

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