/* ==========================================================================
   ذُروة (dhurwa) — قالب متجر كتب لمنصّة «ناشر»
   ألوان الهويّة متغيّراتٌ في :root يختارها الناشر، وكلّ ما عداها محايد.
   ========================================================================== */

:root {
	--store-primary: #FFA500;
	--store-primary-dark: #A35F00;
	--store-accent: #0A1A3C;
	--store-bg: #FFFFFF;
	--store-text: #333333;

	/* محايدات */
	--soft: #F5F5F5;
	--line: #E5E5E5;
	--muted: #5F5F5F;
	--white: #FFFFFF;
	--gold: #F4B400;
	--danger: #B42318;
	--ok-bg: #E6F4EA;
	--ok-text: #1D6B34;

	/* مشتقّات من ألوان المتجر */
	--tint-nav: color-mix(in srgb, var(--store-accent) 6%, #FFFFFF);
	--tint-primary: color-mix(in srgb, var(--store-primary) 16%, #FFFFFF);
	--tint-primary-2: color-mix(in srgb, var(--store-primary) 9%, #FFFFFF);
	--tint-accent: color-mix(in srgb, var(--store-accent) 8%, #FFFFFF);
	--tint-accent-2: color-mix(in srgb, var(--store-accent) 4%, #FFFFFF);

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

	--r: 12px;
	--r-sm: 8px;
	--gap: 24px;
	--per: 4;
	--shadow: 0 3px 22px rgb(149 157 165 / 18%);
	--font: "Tajawal", system-ui, sans-serif;
	--container: 1296px;
}

body[data-corners="sharp"] { --r: 0px; --r-sm: 0px; }
body[data-books-per-row="3"] { --per: 3; }
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%; scroll-behavior: smooth; scroll-padding-top: 165px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.65;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
del { color: var(--muted); font-weight: 400; }
code { font-size: .9em; background: var(--soft); padding: 1px 6px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--store-accent); outline-offset: 2px; }
.container { width: 100%; max-width: calc(var(--container) + 32px); margin-inline: auto; padding-inline: 16px; }
.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-accent); color: var(--white); padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { top: 12px; }

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

/* ---------------------------------------------------------------- الأزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 10px 22px;
	border: 1.5px solid transparent; border-radius: var(--r-sm);
	font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--store-primary); color: var(--store-accent); }
.btn-primary:hover { background: var(--store-primary-dark); color: var(--white); }
.btn-dark { background: var(--store-accent); color: var(--white); }
.btn-dark:hover { background: var(--store-primary); color: var(--store-accent); }
.btn-outline { background: var(--white); border-color: var(--line); color: var(--store-text); }
.btn-outline:hover { border-color: var(--store-accent); }
.btn-lg { min-height: 52px; padding-inline: 28px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px;
	border: 0; border-radius: 50%; background: var(--white); color: var(--store-text);
	box-shadow: var(--shadow);
}
.icon-btn:hover { background: var(--store-primary); color: var(--store-accent); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { color: var(--danger); }
.link-btn, .text-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
	border: 0; background: none; font-weight: 700; font-size: 14px; color: var(--store-text);
	border-bottom: 1.5px solid currentColor;
}
.link-btn .icon { width: 16px; height: 16px; }
.text-btn { border-bottom: 0; font-weight: 500; color: var(--muted); }
.text-btn:hover, .link-btn:hover { color: var(--store-primary-dark); }
.text-btn[aria-pressed="true"] .icon { fill: var(--danger); stroke: var(--danger); }

/* ---------------------------------------------------------------- الرأس */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); }
.header-top { background: var(--white); }
.header-top .container { display: flex; align-items: center; gap: 28px; min-height: 90px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand-name { font-size: 24px; font-weight: 800; color: var(--store-accent); letter-spacing: -.2px; }
.header-search {
	flex: 1; max-width: 600px; display: flex; align-items: center;
	height: 48px; padding: 4px; padding-inline-start: 18px;
	background: var(--soft); border: 1px solid var(--line); border-radius: 999px;
}
.header-search select {
	flex: none; width: 168px; height: 100%; border: 0; border-inline-end: 1px solid #D6D6D6;
	background: transparent; font-size: 14px; padding-inline-end: 8px; cursor: pointer;
}
.header-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding-inline: 16px; font-size: 14px; outline-offset: -2px; }
.search-btn {
	flex: none; display: grid; place-items: center; width: 40px; height: 40px;
	border: 0; border-radius: 50%; background: var(--store-accent); color: var(--white);
}
.search-btn:hover { background: var(--store-primary); color: var(--store-accent); }
.search-btn .icon { width: 18px; height: 18px; }
.hotline { display: inline-flex; align-items: center; gap: 12px; margin-inline-start: auto; flex: none; }
.hotline-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; }
.hotline small { display: block; font-size: 13px; color: var(--muted); line-height: 1.2; }
.hotline b { font-size: 16px; font-weight: 700; color: var(--store-text); }
.menu-toggle, .mobile-icons { display: none; }

.header-nav { background: var(--tint-nav); }
.header-nav .container { display: flex; align-items: center; gap: 28px; min-height: 60px; }
.browse { position: relative; flex: none; width: 280px; align-self: stretch; }
.browse-btn {
	display: flex; align-items: center; gap: 12px; width: 100%; height: 100%; min-height: 60px;
	padding-inline: 24px; border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0;
	background: var(--store-primary); color: var(--store-accent); font-weight: 700; font-size: 16px;
}
.browse-chev { margin-inline-start: auto; transition: transform .2s; }
.browse-btn[aria-expanded="true"] .browse-chev { transform: rotate(180deg); }
.cat-drop {
	position: absolute; top: 100%; inset-inline: 0; z-index: 40;
	background: var(--white); border-radius: 0 0 var(--r-sm) var(--r-sm); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s;
}
.browse.open .cat-drop { opacity: 1; visibility: visible; transform: none; }
.nav-list { display: flex; align-items: center; gap: 26px; flex: 1; }
.nav-list a { display: block; padding: 6px 0; font-weight: 500; font-size: 16px; color: var(--store-text); }
.nav-list a:hover { color: var(--store-accent); }
.nav-list a[aria-current="page"] { font-weight: 700; color: var(--store-accent); box-shadow: inset 0 -2px 0 var(--store-primary); }
.nav-icons { display: flex; align-items: center; gap: 18px; }
.icon-link { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--store-text); }
.icon-link .icon { width: 24px; height: 24px; }
.count-bubble {
	position: absolute; top: -4px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding-inline: 4px;
	display: grid; place-items: center; border-radius: 999px; background: var(--store-primary); color: var(--store-accent);
	font-size: 11.5px; font-weight: 700; line-height: 1;
}
.account { display: inline-flex; align-items: center; gap: 10px; padding-inline-start: 22px; border-inline-start: 1px solid #D3D9E3; align-self: stretch; font-weight: 700; }
.account-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); color: var(--store-primary-dark); }

/* قائمة التصنيفات (منسدلة، وفي الواجهة، وفي الدرج) */
.cat-menu li a { display: flex; align-items: center; gap: 14px; padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 15px; transition: background .15s; }
.cat-menu li a:hover { background: var(--soft); color: var(--store-primary-dark); }
.cm-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tint-primary); color: var(--store-primary-dark); flex: none; }
.cm-icon .icon { width: 17px; height: 17px; }
.cm-chev { width: 15px; height: 15px; margin-inline-start: auto; color: var(--muted); }
.cm-all { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px 16px; font-weight: 700; font-size: 15px; }
.cm-all .icon { width: 17px; height: 17px; }
.cm-all:hover { color: var(--store-primary-dark); }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgb(10 15 30 / 45%); opacity: 0; visibility: hidden; transition: .25s; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 90; width: min(340px, 88vw);
	display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow-y: auto;
	background: var(--white); transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
}
.drawer-open .drawer, .drawer-open .drawer-backdrop, .filters-open .drawer-backdrop { visibility: visible; opacity: 1; }
.drawer-open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head .brand-name { font-size: 20px; }
.drawer-nav a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer-nav a[aria-current="page"] { color: var(--store-primary-dark); }
.drawer-label { font-weight: 800; color: var(--store-accent); margin-top: 6px; }
.drawer-cats { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.drawer-cats .cat-menu li a { padding: 9px 14px; }
.drawer-links { display: grid; gap: 4px; }
.drawer-links a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.drawer .hotline { margin: 0; }

/* ---------------------------------------------------------------- عنوان القسم والعلامة المرسومة */
.section { padding-block: 44px; }
.section-head { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.section-title { font-size: 30px; font-weight: 700; color: var(--store-text); }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 1; }
.head-tools { order: 2; display: flex; align-items: center; gap: 18px; }
.ring { position: relative; display: inline-block; padding-inline: .12em; z-index: 0; }
.ring::before, .ring::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.ring::before { inset: -.16em -.3em -.14em -.26em; border: 2px solid var(--store-primary); transform: rotate(-4deg); }
.ring::after { inset: -.06em -.18em -.24em -.38em; border: 1.5px solid var(--store-primary); border-top-color: transparent; border-inline-end-color: transparent; transform: rotate(5deg); }
.view-all { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.view-all .icon { width: 20px; height: 20px; }
.view-all:hover { color: var(--store-primary-dark); }
.row-arrows { display: flex; gap: 10px; }
.arrow-btn {
	display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
	background: var(--white); color: var(--store-text); box-shadow: var(--shadow); transition: .2s;
}
.arrow-btn:hover { background: var(--store-primary); color: var(--store-accent); }
.arrow-btn .icon { width: 17px; height: 17px; }
.arrow-btn:disabled { opacity: .45; cursor: default; background: var(--white); color: var(--store-text); }

/* ---------------------------------------------------------------- الواجهة */
.hero-row { padding-block: 25px 20px; }
.hero-grid { display: flex; gap: 25px; align-items: stretch; }
.hero-cats {
	flex: none; width: 280px; margin-top: -25px; align-self: flex-start;
	background: var(--white); border-radius: 0 0 var(--r-sm) var(--r-sm); box-shadow: var(--shadow);
}
.page-home .browse-chev { display: none; }
/* إن أُخفي السلايدر والبانر معًا تُطوى الواجهة، ويعود زرّ التصنيفات منسدلًا */
.hero-grid:not(:has(.hero-slider, .promo-side)) { display: none; }
.page-home:has(.hero-grid:not(:has(.hero-slider, .promo-side))) .browse-chev { display: block; }
.hero-slider { flex: 2.15 1 0; min-width: 0; }
.slider { position: relative; height: 100%; min-height: 480px; border-radius: var(--r); overflow: hidden; background: var(--soft); }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; min-height: 480px; scroll-snap-align: start; display: flex; align-items: center; }
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.slide-body { position: relative; width: 58%; padding: 40px 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.eyebrow { font-size: 15px; font-weight: 700; color: var(--store-primary-dark); }
.slide-body h1, .slide-body h2 { font-size: 38px; font-weight: 800; line-height: 1.22; color: var(--store-accent); }
.slide-body p { font-size: 16px; color: #4A4A4A; max-width: 400px; }
.slide-body .btn { margin-top: 12px; }
.slider-dots { position: absolute; bottom: 30px; inset-inline: 0; display: flex; justify-content: center; gap: 8px; }
.slider-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--store-primary) 40%, #FFFFFF); }
.slider-dots button[aria-current="true"] { background: var(--store-primary); width: 24px; border-radius: 9px; }

/* البانرات */
.promo { position: relative; display: block; overflow: hidden; border-radius: var(--r); background: var(--soft); isolation: isolate; }
.promo > img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.promo:hover > img { transform: scale(1.04); }
.promo-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 30px; }
.promo-body strong { font-size: 25px; font-weight: 800; line-height: 1.3; color: var(--store-accent); }
.promo-text { font-size: 15px; color: #3D3D3D; }
.promo-accent { font-size: 19px; font-weight: 800; color: var(--store-accent); }
.promo-chip { display: inline-block; padding: 3px 16px; border-radius: 999px; background: var(--white); color: var(--store-primary-dark); font-weight: 800; font-size: 15px; }
.promo .btn { margin-top: 6px; }
.promo-side { flex: 1 1 0; min-width: 0; min-height: 480px; }
.promo-side > img { object-position: center bottom; }

/* ---------------------------------------------------------------- شريط الثقة */
.trust-bar { padding-block: 30px 10px; }
.trust-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.trust-item {
	display: flex; align-items: center; gap: 20px; margin-inline-start: 35px; min-height: 124px;
	padding: 20px; padding-inline-start: 0; border-radius: var(--r); background: var(--tint-primary);
}
.trust-item:nth-child(2) { background: var(--tint-accent); }
.trust-item:nth-child(3) { background: var(--tint-primary-2); }
.trust-item:nth-child(4) { background: var(--tint-accent-2); }
.trust-icon {
	flex: none; display: grid; place-items: center; width: 70px; height: 70px; margin-inline-start: -35px;
	border-radius: var(--r-sm); background: var(--store-primary); color: var(--store-accent);
}
.trust-item:nth-child(2) .trust-icon { background: var(--store-accent); color: var(--white); }
.trust-item:nth-child(3) .trust-icon { background: var(--store-primary-dark); color: var(--white); }
.trust-item:nth-child(4) .trust-icon { background: color-mix(in srgb, var(--store-accent) 78%, #FFFFFF); color: var(--white); }
.trust-icon .icon { width: 34px; height: 34px; stroke-width: 1.5; }
.trust-item b { display: block; font-size: 21px; font-weight: 700; color: var(--store-text); }
.trust-item small { display: block; font-size: 15px; color: #4F4F4F; }
body[data-show-trust-bar="false"] .trust-bar { display: none; }

/* ---------------------------------------------------------------- بطاقة الكتاب */
.book-card {
	position: relative; display: flex; flex-direction: column; min-width: 0;
	padding: 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
	transition: box-shadow .25s, border-color .25s;
}
.book-card:hover { box-shadow: var(--shadow); border-color: transparent; }
.book-media {
	position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.02;
	background: var(--soft); border-radius: calc(var(--r) - 4px); overflow: hidden;
}
.book-cover { display: block; height: 82%; aspect-ratio: 2 / 3; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; box-shadow: 0 10px 18px rgb(0 0 0 / 16%); transition: transform .35s; }
.book-card:hover .book-cover img { transform: translateY(-4px) scale(1.03); }
.book-badges { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.badge { display: inline-flex; align-items: center; padding: 2px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.6; }
.badge-sale { background: var(--store-primary-dark); color: var(--white); }
.badge-new { background: var(--store-accent); color: var(--white); }
.type-dot {
	position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 2;
	display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
	color: #FFFFFF; box-shadow: 0 0 0 3px var(--white);
}
.type-dot .icon { width: 17px; height: 17px; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-educational); }
.type-dot-sm { position: static; width: 22px; height: 22px; box-shadow: none; }
.type-dot-sm .icon { width: 13px; height: 13px; }
.book-actions {
	position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2;
	display: flex; flex-direction: column; gap: 8px; opacity: 0; transform: translateX(-8px); transition: .25s;
}
.book-card:hover .book-actions, .book-card:focus-within .book-actions { opacity: 1; transform: none; }
@media (hover: none) { .book-actions { opacity: 1; transform: none; } }
.book-actions .icon-btn { width: 36px; height: 36px; }
.stock-tag {
	position: absolute; bottom: 14%; inset-inline: 0; margin-inline: auto; width: max-content; z-index: 2;
	padding: 4px 14px; border-radius: 6px; background: var(--danger); color: var(--white); font-size: 13.5px; font-weight: 700;
}
.book-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 6px 6px; flex: 1; }
.book-title { font-size: 16px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-title a:hover { color: var(--store-primary-dark); }
.book-author { font-size: 13.5px; color: var(--muted); }
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-weight: 700; font-size: 16px; color: var(--store-primary-dark); }
.price del { font-size: 13.5px; }
.price-lg { font-size: 20px; }
.rating { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 15px; height: 15px; }
.stars .off { color: #D9D9D9; }
.rating-lg .stars .icon { width: 18px; height: 18px; }

.book-card.is-out { background: #ECECEC; border-color: #DDDDDD; }
.book-card.is-out .book-media { background: #DEDEDE; }
.book-card.is-out .book-cover img { filter: grayscale(.6); opacity: .8; }
.book-card.is-out .price { color: var(--store-text); }
.book-card.is-out .book-author, .book-card.is-out .rating, .book-card.is-out del { color: #505050; }

/* زرّ السلّة: ظاهرٌ دائمًا ومدمج، شريطٌ فاتح من لون المتجر يمتلئ عند التحويم (البند 7) */
.card-cart {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	width: 100%; min-height: 40px; margin-top: auto; padding: 6px 10px;
	border: 1px solid color-mix(in srgb, var(--store-primary) 45%, #FFFFFF); border-radius: var(--r-sm);
	background: var(--tint-primary-2); color: var(--store-accent); font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap;
	transition: background-color .2s, border-color .2s;
}
.book-body .card-cart { margin-top: auto; }
.book-body > :nth-last-child(2) { margin-bottom: 8px; }
.card-cart .icon { width: 17px; height: 17px; }
.card-cart:hover { background: var(--store-primary); border-color: var(--store-primary); }
.card-cart:disabled { cursor: not-allowed; background: #E2E2E2; border-color: #D2D2D2; color: #4D4D4D; }
.card-cart--sm { width: auto; min-height: 34px; padding: 4px 14px; font-size: 13.5px; align-self: flex-start; }
.book-card--mini .card-cart--sm { width: 100%; }
.book-card--h .card-cart--sm { margin-top: 2px; }
.book-card--h .book-body > :nth-last-child(2) { margin-bottom: 0; }

/* أشكال البطاقة */
body[data-card-style="soft"] .book-card { background: var(--soft); border-color: transparent; }
body[data-card-style="soft"] .book-card .book-media { background: var(--white); }
body[data-card-style="soft"] .book-card.is-out { background: #ECECEC; }
body[data-card-style="minimal"] .book-card { border-color: transparent; padding: 0; background: transparent; }
body[data-card-style="minimal"] .book-card:hover { box-shadow: none; }
body[data-card-style="minimal"] .book-card .book-body { padding-inline: 2px; }

/* شبكة وصفّ */
.book-grid { display: grid; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); gap: var(--gap); }
.book-row, .cat-row {
	display: grid; grid-auto-flow: column; gap: var(--gap);
	grid-auto-columns: calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
	padding-block: 4px 14px; margin-block: -4px -14px;
}
.book-row::-webkit-scrollbar, .cat-row::-webkit-scrollbar { display: none; }
.book-row > *, .cat-row > * { scroll-snap-align: start; }
.book-row--mini { --per-mini: calc(var(--per) + 2); grid-auto-columns: calc((100% - (var(--per-mini) - 1) * 18px) / var(--per-mini)); gap: 18px; }
.book-card--mini { padding: 8px; }
.book-card--mini .book-body { padding: 10px 4px 4px; }
.book-card--mini .book-title { font-size: 14.5px; }
.book-card--mini .price { font-size: 14.5px; }
.book-card--mini .type-dot { width: 26px; height: 26px; bottom: 8px; inset-inline-end: 8px; }
.book-card--mini .type-dot .icon { width: 14px; height: 14px; }

/* البطاقة الأفقيّة */
.featured-grid { display: flex; gap: var(--gap); align-items: stretch; }
.promo-tall { flex: 0 0 330px; min-height: 560px; }
.promo-tall > img { object-position: center bottom; }
.featured-main { flex: 1 1 0; min-width: 0; }
.hcard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px var(--gap); }
.book-card--h { flex-direction: row; align-items: center; gap: 16px; padding: 12px; }
.book-card--h .book-media { flex: none; width: 104px; aspect-ratio: 1; }
.book-card--h .book-cover { height: 84%; }
.book-card--h .type-dot { width: 24px; height: 24px; bottom: 5px; inset-inline-end: 5px; box-shadow: 0 0 0 2px var(--white); }
.book-card--h .type-dot .icon { width: 13px; height: 13px; }
.book-card--h .book-body { padding: 0; gap: 6px; }
.book-card--h .book-title { font-size: 15.5px; -webkit-line-clamp: 1; }
.save-tag {
	position: absolute; top: -10px; inset-inline-end: 14px; z-index: 2;
	padding: 1px 12px; border-radius: 999px; background: var(--store-primary-dark); color: var(--white); font-size: 12.5px; font-weight: 700;
}

/* البطاقة الملوّنة والأكثر مبيعًا */
.best-grid { display: flex; gap: var(--gap); align-items: stretch; }
.best-main { flex: 3 1 0; min-width: 0; }
.best-grid .section-head::after { display: none; }
.tint-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.book-card--tint { border: 0; background: var(--tint-primary-2); overflow: hidden; isolation: isolate; padding: 14px; }
.book-card--tint:nth-child(2) { background: var(--tint-accent); }
.book-card--tint::before, .book-card--tint::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; border: 14px solid color-mix(in srgb, var(--store-primary) 22%, transparent); }
.book-card--tint::before { width: 110px; height: 110px; top: -50px; inset-inline-start: -46px; }
.book-card--tint::after { width: 90px; height: 90px; bottom: -42px; inset-inline-end: -40px; }
.book-card--tint .book-media { background: transparent; aspect-ratio: 1 / .92; }
.book-card--tint .book-cover { height: 90%; transform: rotate(-4deg); }
.book-card--tint .book-body { padding: 12px 2px 2px; }
.book-card--tint .price { color: var(--store-text); }
.book-card--tint .link-btn { align-self: flex-start; margin-top: 6px; }
.promo-offer { flex: 2.15 1 0; min-width: 0; min-height: 360px; display: flex; align-items: center; }
.promo-offer { background: #E9EEF8; }
.promo-offer > img { inset: 0 auto 0 0; width: 46%; object-position: 0 100%; }
.promo-offer .promo-body { width: 56%; }
.tint-row--kit { max-width: 860px; }

/* اختياراتنا */
.picks-grid { display: flex; gap: var(--gap); align-items: stretch; }
.promo-narrow { flex: 0 0 300px; min-height: 460px; }
.promo-narrow > img { object-position: center bottom; }
.picks-main { flex: 1 1 0; min-width: 0; }
.book-row--picks { --per: 4; }

/* ---------------------------------------------------------------- التصنيفات */
.cat-row { --cper: 7; grid-auto-columns: calc((100% - (var(--cper) - 1) * var(--gap)) / var(--cper)); }
.cat-blob { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.blob { display: block; width: 100%; max-width: 168px; aspect-ratio: 1; overflow: hidden; background: var(--soft); border-radius: 58% 42% 55% 45% / 46% 58% 42% 54%; transition: border-radius .5s; }
.cat-blob:nth-child(3n+2) .blob { border-radius: 44% 56% 40% 60% / 58% 44% 56% 42%; }
.cat-blob:nth-child(3n) .blob { border-radius: 52% 48% 62% 38% / 40% 55% 45% 60%; }
.cat-blob:hover .blob { border-radius: 50%; }
.blob img { width: 100%; height: 100%; object-fit: cover; }
.cat-name { font-weight: 700; font-size: 16px; margin-top: 6px; }
.cat-blob small { font-size: 13px; color: var(--muted); margin-top: -6px; }
.cat-blob:hover .cat-name { color: var(--store-primary-dark); }
.cat-row--sm { --cper: 6; }
.cat-row--sm .cat-name { font-size: 14.5px; }
.cat-row--kit { --cper: 6; margin-bottom: 26px; }

/* ---------------------------------------------------------------- المؤلّفون */
.author-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.author-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px 18px; border-radius: var(--r-sm); background: var(--soft); text-align: center; transition: .25s; }
.author-tile img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; box-shadow: 0 0 0 4px var(--white); }
.author-tile b { font-size: 16px; }
.author-tile small { font-size: 13px; color: var(--muted); }
.author-tile:hover { background: var(--tint-primary); }
.author-grid--kit { grid-template-columns: repeat(3, minmax(0, 200px)); }

/* شاهدتَه مؤخّرًا */
.section-recent { padding-bottom: 56px; }

/* ---------------------------------------------------------------- النشرة */
.newsletter { position: relative; overflow: hidden; background: #EFEBE3; padding-block: 64px; }
.nl-art { position: absolute; bottom: 0; width: 240px; height: 240px; object-fit: cover; border-radius: 50% 50% 0 0; }
.nl-art-start { inset-inline-start: 0; border-start-start-radius: 0; }
.nl-art-end { inset-inline-end: 0; border-start-end-radius: 0; }
.nl-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 640px; }
.newsletter h2 { font-size: 32px; font-weight: 800; color: var(--store-text); }
.newsletter p { color: #4A4A4A; }
.nl-field { display: flex; width: 100%; max-width: 520px; gap: 8px; margin-top: 14px; padding: 6px; background: var(--white); border-radius: var(--r-sm); }
.nl-field input { flex: 1; min-width: 0; border: 0; padding-inline: 14px; background: transparent; outline-offset: -2px; }
.nl-field .btn { min-height: 44px; }
body[data-show-newsletter="false"] .newsletter { display: none; }

/* ---------------------------------------------------------------- التذييل */
.site-footer { background: var(--store-accent); color: rgb(255 255 255 / 82%); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.45fr; gap: 36px; padding-block: 72px 48px; }
.site-footer .brand-name { color: var(--white); }
.footer-about p { margin-top: 18px; max-width: 280px; font-size: 15px; }
.social { display: flex; align-items: center; gap: 10px; margin-top: 22px; color: var(--white); font-weight: 700; }
.social a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--store-primary); color: var(--store-accent); }
.social a:hover { background: var(--white); }
.social .icon { width: 16px; height: 16px; }
.footer-title { font-size: 18px; color: var(--white); margin-bottom: 18px; }
.footer-links { display: grid; gap: 10px; }
.footer-links a { font-size: 15px; }
.footer-links a:hover { color: var(--store-primary); }
.footer-note { font-size: 14.5px; margin-bottom: 14px; }
.footer-contact { display: grid; gap: 12px; font-size: 15px; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--store-primary); }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / 14%); }
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 72px; padding-block: 14px; font-size: 14.5px; }
.footer-bottom b { color: var(--store-primary); }
.pay-note { display: inline-flex; align-items: center; gap: 8px; }
.pay-note .icon { width: 18px; height: 18px; color: var(--store-primary); }

/* ---------------------------------------------------------------- رأس الصفحات الداخليّة */
.page-head { position: relative; overflow: hidden; padding-block: 52px; text-align: center; background: color-mix(in srgb, var(--store-accent) 5%, #F1F1F1); }
.page-title { font-size: 40px; font-weight: 800; color: var(--store-accent); }
.breadcrumb { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 15px; color: #474747; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "‹"; color: var(--muted); }
.breadcrumb a { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb a:hover { color: var(--store-primary-dark); }
.breadcrumb .icon { width: 16px; height: 16px; }
.ph-art { position: absolute; top: 50%; width: 130px; height: 130px; transform: translateY(-50%); fill: none; stroke: color-mix(in srgb, var(--store-accent) 22%, #F1F1F1); stroke-width: 2; }
.ph-art-start { inset-inline-start: 6%; }
.ph-art-end { inset-inline-end: 6%; transform: translateY(-50%) scaleX(-1); }

/* ---------------------------------------------------------------- التصنيف */
.listing { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.filters { position: sticky; top: 170px; display: grid; gap: 4px; }
.filters-head { display: none; }
.filter-block { padding-block: 18px; border-bottom: 1px solid var(--line); }
.filter-block:first-of-type { padding-top: 0; }
.filter-block h2 { font-size: 17px; margin-bottom: 14px; }
.check-list { display: grid; gap: 9px; }
.check-list label { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check-list input { width: 16px; height: 16px; accent-color: var(--store-accent); margin: 0; flex: none; }
.check-list small { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.rating-list .stars .icon { width: 14px; height: 14px; }
.range-track { position: relative; height: 4px; margin: 6px 8px 18px; border-radius: 4px; background: var(--line); }
.range-track span { position: absolute; inset-block: 0; inset-inline: 15% 25%; background: var(--store-primary); }
.range-track span::before, .range-track span::after { content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--white); border: 3px solid var(--store-primary); }
.range-track span::before { inset-inline-start: -8px; }
.range-track span::after { inset-inline-end: -8px; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-fields label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.range-fields input, .toolbar select, .coupon input, .review-form textarea, .nf-search input {
	width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white);
}
.listing-main { min-width: 0; }
.cat-strip { margin-bottom: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.strip-title { font-size: 20px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.view-switch { display: flex; gap: 8px; }
.view-switch button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--store-accent); }
.view-switch .icon { width: 18px; height: 18px; }
.toolbar-count { font-size: 14.5px; color: var(--muted); }
.toolbar-selects { display: flex; gap: 10px; margin-inline-start: auto; }
.toolbar select { width: auto; min-width: 150px; font-size: 14px; }
.toolbar select#per-page { min-width: 110px; }
.filters-toggle { display: none; }
.book-grid--listing { --per-l: var(--per); grid-template-columns: repeat(var(--per-l), minmax(0, 1fr)); }
/* اثنا عشر كتابًا تملأ 2 و3 و4 و6 أعمدة؛ والخمسة تصير أربعةً بجانب التصفية حتّى لا يبقى صفٌّ ناقص */
@media (min-width: 1100px) { body[data-books-per-row="5"] .book-grid--listing { --per-l: 4; } }
.book-grid.is-list { grid-template-columns: 1fr; }
.book-grid.is-list .book-card { flex-direction: row; gap: 20px; align-items: center; }
.book-grid.is-list .book-media { width: 180px; flex: none; }
.book-grid.is-list .book-body { padding: 0; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 40px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 44px; height: 44px; padding-inline: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); font-weight: 700; }
.pagination span { border-color: transparent; }
.pagination a:hover { border-color: var(--store-accent); }
.pagination a[aria-current="page"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--store-accent); }
.pagination .icon { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- صفحة الكتاب */
.section-pdp { padding-top: 50px; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr) 260px; gap: 34px; align-items: start; }
.gallery { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; }
.thumbs { display: grid; gap: 12px; align-content: start; }
.thumbs button { padding: 6px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--soft); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.thumbs img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; }
.gallery-main { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.08; border-radius: var(--r); background: var(--soft); }
.gallery-main > img { height: 84%; width: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 16px 30px rgb(0 0 0 / 18%); }
.gallery-main .type-dot { width: 40px; height: 40px; bottom: 16px; inset-inline-end: 16px; }
.gallery-main .type-dot .icon { width: 21px; height: 21px; }
.pdp-info { display: flex; flex-direction: column; gap: 14px; }
.pdp-cat { font-size: 14.5px; color: var(--muted); }
/* اختيار الصيغة (book.formats): بطاقاتٌ صغيرة بدائرة النوع والسعر، وتُخفى إن لم يكن للعنوان غير صيغة */
.formats-box { display: grid; gap: 8px; }
.formats-box:not(:has([data-repeat="format"] ~ .format-opt)) { display: none; }
.formats-label { font-size: 14px; font-weight: 700; }
.formats { display: flex; flex-wrap: wrap; gap: 10px; }
.format-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 10px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white); font-size: 14px; transition: border-color .2s; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt[aria-current="page"] { border-color: var(--store-primary); background: var(--tint-primary-2); }
.fo-name { font-weight: 700; }
.fo-price { color: var(--store-primary-dark); font-weight: 700; }
.pdp-cat:hover { color: var(--store-primary-dark); }
.pdp-info h1 { font-size: 34px; font-weight: 800; color: var(--store-text); margin-top: -6px; }
.pdp-line { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.stock-pill { display: inline-block; padding: 2px 12px; border-radius: 6px; background: var(--ok-bg); color: var(--ok-text); font-size: 13.5px; font-weight: 700; }
.pdp-author { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 15px; }
.pdp-author .icon { width: 17px; height: 17px; }
.pdp-author a { color: var(--store-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pdp-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; font-size: 30px; font-weight: 800; color: var(--store-text); }
.pdp-price del { font-size: 17px; }
.pdp-price .badge { align-self: center; }
.pdp-lead { color: #4D4D4D; }
.pdp-buy { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; height: 46px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }
.qty button { width: 38px; height: 100%; border: 0; background: none; font-size: 19px; font-weight: 700; }
.qty input { width: 44px; height: 100%; border: 0; text-align: center; font-weight: 700; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pdp-links { display: flex; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pdp-meta { display: grid; gap: 6px; font-size: 14.5px; }
.pdp-meta li { display: flex; gap: 8px; }
.pdp-meta span { color: var(--muted); min-width: 110px; }
.sample-player { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r); background: var(--tint-accent); }
.play-btn { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--store-accent); color: var(--white); }
.play-btn .icon { width: 18px; height: 18px; margin-inline-start: -2px; transform: scaleX(-1); }
.sp-track { flex: 1; display: grid; gap: 4px; font-size: 14px; }
.sp-bar { position: relative; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--store-accent) 18%, #FFFFFF); overflow: hidden; }
.sp-bar span { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--store-primary); }
.sp-track small { color: #464C58; text-align: end; }
.pdp-side { display: grid; gap: 18px; }
.perk-box { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); }
.perk-box li { display: flex; gap: 12px; align-items: flex-start; }
.perk-box .icon { width: 22px; height: 22px; color: var(--store-primary-dark); margin-top: 2px; }
.perk-box b { display: block; font-size: 14.5px; }
.perk-box small { display: block; font-size: 13px; color: var(--muted); }
.help-box { display: grid; gap: 8px; padding: 18px; border-radius: var(--r); background: var(--tint-nav); font-size: 14.5px; }
.help-box b { font-size: 16px; }
.help-box p { color: #4A4F5A; font-size: 14px; }
.help-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.help-link .icon { color: var(--store-primary-dark); width: 18px; height: 18px; }

.pdp-tabs { margin-top: 54px; padding: 30px 36px 36px; border: 1px solid var(--line); border-radius: var(--r); }
.pill-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.pill-nav a { padding: 7px 20px; border: 1px solid var(--line); border-radius: 999px; font-size: 14.5px; color: #474747; }
.pill-nav a[aria-current="true"], .pill-nav a:hover { border-color: var(--store-primary); color: var(--store-primary-dark); font-weight: 700; }
.pdp-block { padding-top: 26px; scroll-margin-top: 20px; }
.pdp-block + .pdp-block { margin-top: 10px; border-top: 1px solid var(--line); }
.pdp-block > h2 { font-size: 23px; margin-bottom: 14px; }
.prose { display: grid; gap: 12px; color: #4A4A4A; max-width: 860px; }
/* الوصف والتفاصيل عمودان متجاوران، فلا يبقى نصف القسم فارغًا */
.pdp-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 44px; }
.pdp-pair .prose, .pdp-pair .spec-table { max-width: none; }
.box-list { margin-top: 22px; padding: 18px 20px; border-radius: var(--r); background: var(--tint-nav); }
.box-list b { display: block; margin-bottom: 8px; font-size: 16px; }
.box-list ul { display: grid; gap: 6px; font-size: 14.5px; color: #4A4F5A; }
.box-list li { position: relative; padding-inline-start: 18px; }
.box-list li::before { content: ""; position: absolute; inset-inline-start: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--store-primary); }
.author-mini { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 22px; padding: 18px; border-radius: var(--r); background: var(--tint-nav); }
.author-mini img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--white); }
.author-mini small { display: block; font-size: 13px; color: var(--muted); }
.author-mini b { display: block; font-size: 17px; }
.author-mini p { margin-block: 4px 8px; font-size: 14px; color: #4A4F5A; }
.pdp-pair + .pdp-block { margin-top: 30px; border-top: 1px solid var(--line); }
.spec-table { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); }
.spec-table th { width: 34%; font-weight: 500; color: var(--muted); background: var(--soft); }
.reviews-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; }
.reviews-summary { display: grid; gap: 6px; align-content: start; padding: 22px; border-radius: var(--r); background: var(--soft); text-align: center; justify-items: center; }
.reviews-summary strong { font-size: 46px; line-height: 1; font-weight: 800; }
.reviews-summary small { color: var(--muted); }
.rating-bars { display: grid; gap: 6px; width: 100%; margin-top: 10px; font-size: 13px; color: #4A4A4A; }
.rating-bars li { display: grid; grid-template-columns: 14px 1fr 36px; gap: 8px; align-items: center; }
.bar { height: 6px; border-radius: 6px; background: #E2E2E2; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.review-list { display: grid; gap: 4px; }
.review { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.review:first-child { padding-top: 0; }
.review-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--tint-primary); color: var(--store-accent); font-weight: 800; }
.review-top { display: flex; justify-content: space-between; gap: 10px; }
.review-top small { color: var(--muted); font-size: 13px; }
.review p { margin-top: 6px; color: #4A4A4A; }
.review-form { display: grid; gap: 12px; margin-top: 26px; padding: 24px; border-radius: var(--r); background: var(--tint-primary-2); }
.review-form h3 { font-size: 19px; }
.note { font-size: 13.5px; color: #555555; }
.note .icon { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 4px; }
.star-pick { display: flex; gap: 4px; }
.star-pick button { padding: 2px; border: 0; background: none; color: #C9C9C9; }
.star-pick button .icon { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.star-pick button[aria-pressed="true"] { color: var(--gold); }
.review-form .btn { justify-self: start; }
body[data-show-reviews="false"] .reviews-section, body[data-show-reviews="false"] .reviews-pill { display: none; }

/* ---------------------------------------------------------------- المؤلّف */
.author-hero { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 44px; align-items: center; padding: 34px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 48px; }
.author-photo { display: block; aspect-ratio: 1; overflow: hidden; background: var(--soft); border-radius: 58% 42% 55% 45% / 46% 58% 42% 54%; }
.author-photo img { width: 100%; height: 100%; object-fit: cover; }
.author-info { display: grid; gap: 12px; }
.author-info h1 { font-size: 36px; font-weight: 800; }
.author-stats { display: flex; flex-wrap: wrap; gap: 14px; }
.author-stats li { display: grid; padding: 10px 20px; border-radius: var(--r-sm); background: var(--soft); min-width: 130px; }
.author-stats b { font-size: 22px; font-weight: 800; color: var(--store-accent); }
.author-stats span { font-size: 13.5px; color: var(--muted); }
.author-bio { color: #4A4A4A; max-width: 760px; }

/* ---------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 30px; align-items: start; }
.cart-card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { padding: 14px 18px; text-align: start; font-size: 14.5px; background: var(--soft); }
.cart-table td { padding: 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.cart-book { display: flex; gap: 16px; align-items: center; }
.cart-book img { width: 70px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 6px 12px rgb(0 0 0 / 12%); }
.cart-book h3 { font-size: 16px; }
.cart-book p { font-size: 13.5px; color: var(--muted); }
.cart-type { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.cart-type .type-dot { position: static; width: 22px; height: 22px; box-shadow: none; }
.cart-type .type-dot .icon { width: 13px; height: 13px; }
.cart-table .qty { height: 42px; }
.cart-remove { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--muted); }
.cart-remove:hover { color: var(--danger); border-color: var(--danger); }
.cart-remove .icon { width: 17px; height: 17px; }
.cart-under { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.summary { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: sticky; top: 170px; }
.summary h2 { padding: 16px 22px; font-size: 19px; background: var(--soft); }
.summary-body { display: grid; gap: 14px; padding: 22px; }
.coupon { display: flex; gap: 8px; }
.coupon .btn { min-height: 42px; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--tint-primary-2); font-size: 14px; }
.coupon-applied span { display: inline-flex; align-items: center; gap: 6px; }
.coupon-applied .icon { width: 16px; height: 16px; color: var(--store-primary-dark); }
.coupon-applied button { border: 0; background: none; font-weight: 700; text-decoration: underline; font-size: 13.5px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.summary-row > span:first-child { color: var(--muted); }
.summary-total { padding-top: 14px; border-top: 1px dashed #CFCFCF; font-size: 18px; font-weight: 800; }
.summary-total > span:first-child { color: var(--store-text); }
.empty-cart { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; border: 1px dashed #CFCFCF; border-radius: var(--r); text-align: center; }
.empty-cart[hidden] { display: none; }
.empty-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--tint-primary); color: var(--store-primary-dark); }
.empty-icon .icon { width: 34px; height: 34px; }
.empty-cart p { color: var(--muted); }

/* ---------------------------------------------------------------- 404 */
.notfound { padding-block: 70px 30px; }
.nf-box { display: grid; justify-items: center; gap: 14px; max-width: 640px; margin-inline: auto; text-align: center; }
.nf-code { font-size: 150px; line-height: 1; font-weight: 800; color: var(--store-accent); letter-spacing: 4px; }
.nf-zero { position: relative; display: inline-block; color: var(--store-primary-dark); }
.nf-zero::after { content: ""; position: absolute; inset: 12% -14% 4%; border: 3px solid var(--store-primary); border-radius: 50%; transform: rotate(-12deg); }
.nf-box h1 { font-size: 30px; }
.nf-box > p { color: var(--muted); }
.nf-search { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 480px; margin-top: 8px; padding: 4px; padding-inline-start: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); }
.nf-search input { border: 0; background: transparent; min-height: 40px; }
.nf-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ---------------------------------------------------------------- صفحة المكوّنات */
.kit { padding-block: 44px 60px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.kit-intro { display: grid; gap: 12px; }
.kit-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kit-switches span { font-weight: 700; margin-inline-start: 8px; }
.kit-block { padding: 26px; border: 1px solid var(--line); border-radius: var(--r); }
.kit-title { font-size: 20px; }
.kit-note { color: var(--muted); font-size: 14px; margin: 4px 0 20px; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.kit-type { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.kit-type .type-dot { position: static; }
.kit .hcard-grid { padding-top: 10px; }
.trust-bar--kit { padding: 0; }
.trust-bar--kit .container { padding: 0; }
.kit .book-row--mini { max-width: 680px; --per: 1; }
.kit .empty-cart { max-width: 520px; }

/* ---------------------------------------------------------------- الحاسوب الصغير */
@media (max-width: 1279px) {
	.header-top .container { gap: 20px; }
	.nav-list { gap: 18px; }
	.nav-list a { font-size: 15px; }
	.browse, .hero-cats { width: 250px; }
	.footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; }
	.footer-grid > div:nth-child(4) { display: none; }
	.pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
	.pdp-side { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
	.author-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.trust-item b { font-size: 18px; }
	.trust-item small { font-size: 14px; }
}

/* ---------------------------------------------------------------- الجهاز اللوحيّ */
@media (max-width: 1099px) {
	:root { --gap: 18px; }
	body[data-books-per-row] { --per: 3; }
	.header-nav, .hotline { display: none; }
	.menu-toggle { display: inline-grid; }
	.mobile-icons { display: flex; margin-inline-start: auto; }
	.header-top .container { flex-wrap: wrap; gap: 12px 14px; min-height: 0; padding-block: 12px; }
	.header-search { order: 3; flex-basis: 100%; max-width: none; }
	.hero-cats { display: none; }
	.hero-row { padding-top: 16px; }
	.slider, .slide { min-height: 470px; }
	.slide { align-items: flex-start; background: #F4F4F4; }
	.slide > img { top: auto; height: 50%; object-position: 8% 100%; }
	.slide-body { width: 100%; padding: 30px 30px 80px; }
	.slide-body h1, .slide-body h2 { font-size: 32px; }
	.promo-side { min-height: 470px; }
	.promo-body { padding: 22px; }
	.promo-body strong { font-size: 21px; }
	.trust-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.trust-item { min-height: 100px; }
	.section { padding-block: 34px; }
	.section-title { font-size: 25px; }
	.featured-grid, .best-grid, .picks-grid { flex-direction: column; }
	.promo-tall, .promo-offer, .promo-narrow, .best-main, .featured-main, .picks-main { flex: none; }
	.promo-tall { min-height: 280px; }
	.promo-tall > img { object-position: center 85%; }
	.promo-offer { min-height: 300px; }
	.promo-narrow { min-height: 260px; order: 2; }
	.promo-narrow > img { object-position: center 90%; }
	.book-row--picks { --per: 3; }
	.cat-row { --cper: 5; }
	.cat-row--sm { --cper: 4; }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; padding-block: 50px 36px; }
	.footer-grid > div:nth-child(4) { display: block; }
	.footer-about { grid-column: 1 / -1; }
	.listing { grid-template-columns: 1fr; }
	.filters {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 90; width: min(330px, 88vw);
		padding: 16px; overflow-y: auto; background: var(--white); align-content: start;
		transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
	}
	.filters-open .filters { transform: none; visibility: visible; }
	.filters-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; font-size: 18px; }
	.filter-block:first-of-type { padding-top: 18px; }
	.filters-toggle { display: inline-flex; min-height: 40px; padding: 6px 14px; }
	.pdp { grid-template-columns: 1fr 1fr; gap: 26px; }
	.pdp-info h1 { font-size: 28px; }
	.pdp-tabs { padding: 22px; }
	.reviews-layout { grid-template-columns: 1fr; gap: 22px; }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.author-hero { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; padding: 24px; }
}

/* ---------------------------------------------------------------- الهاتف */
@media (max-width: 699px) {
	:root { --gap: 12px; }
	body[data-books-per-row] { --per: 2; }
	body { font-size: 14.5px; }
	.brand-name { font-size: 20px; }
	.brand img { width: 40px; height: 40px; }
	.header-search { height: 46px; padding-inline-start: 12px; }
	.header-search select { width: 108px; font-size: 13px; }
	.header-search input { padding-inline: 10px; }
	.hero-grid { flex-direction: column; gap: 14px; }
	.hero-slider { flex: none; }
	.slider, .slide { min-height: 470px; }
	.slide { align-items: flex-start; background: #F4F4F4; }
	.slide > img { top: auto; height: 52%; object-position: 8% 100%; }
	.slide-body { width: 100%; padding: 26px 22px 80px; gap: 10px; }
	.slide-body h1, .slide-body h2 { font-size: 27px; }
	.slide-body p { font-size: 14.5px; max-width: 260px; }
	.slide-body .btn { margin-top: 4px; }
	.promo-side { flex: none; min-height: 440px; }
	.promo-side > img { object-position: center bottom; }
	.trust-list { grid-template-columns: 1fr; gap: 12px; }
	.trust-item { min-height: 0; padding-block: 14px; gap: 14px; margin-inline-start: 26px; }
	.trust-icon { width: 54px; height: 54px; margin-inline-start: -26px; }
	.trust-icon .icon { width: 26px; height: 26px; }
	.trust-item b { font-size: 17px; }
	.section { padding-block: 28px; }
	.section-head { flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
	.section-head::after { display: none; }
	.head-tools { margin-inline-start: auto; gap: 10px; }
	.section-title { font-size: 22px; }
	.arrow-btn { width: 34px; height: 34px; }
	.book-row { grid-auto-columns: calc((100% - var(--gap)) / 2); }
	.book-row--mini { grid-auto-columns: calc((100% - 2 * 12px) / 2.6); gap: 12px; }
	.book-card { padding: 7px; }
	.book-body { padding: 10px 3px 3px; }
	.book-title { font-size: 14.5px; }
	.price { font-size: 14.5px; }
	.price del { font-size: 12.5px; }
	.badge { font-size: 12px; padding-inline: 8px; }
	.book-badges { top: 8px; inset-inline-start: 8px; }
	.type-dot { width: 28px; height: 28px; bottom: 7px; inset-inline-end: 7px; }
	.type-dot .icon { width: 15px; height: 15px; }
	.book-actions { top: 7px; inset-inline-end: 7px; gap: 6px; }
	.book-actions .icon-btn { width: 32px; height: 32px; }
	.rating .count { display: none; }
	.hcard-grid { grid-template-columns: 1fr; gap: 16px; }
	.tint-row { grid-template-columns: repeat(3, minmax(150px, 1fr)); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
	.tint-row > * { scroll-snap-align: start; }
	.tint-row::-webkit-scrollbar { display: none; }
	.book-row--picks { --per: 2; }
	.cat-row { --cper: 3.3; }
	.cat-row--sm { --cper: 3.3; }
	.cat-name { font-size: 14.5px; }
	.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.newsletter { padding-block: 44px; }
	.nl-art { display: none; }
	.newsletter h2 { font-size: 24px; }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
	.footer-grid > div:last-child { grid-column: 1 / -1; }
	.footer-bottom .container { justify-content: center; text-align: center; }
	.page-head { padding-block: 34px; }
	.page-title { font-size: 28px; }
	.ph-art { display: none; }
	.toolbar { gap: 10px; }
	.toolbar-count { order: 3; flex-basis: 100%; }
	.toolbar-selects { flex-basis: 100%; margin: 0; }
	.toolbar select { min-width: 0; flex: 1; }
	.view-switch { margin-inline-start: auto; }
	.book-grid.is-list .book-media { width: 120px; }
	.pdp { grid-template-columns: minmax(0, 1fr); }
	.pdp-side { grid-template-columns: 1fr; }
	.gallery { grid-template-columns: minmax(0, 1fr); }
	.thumbs { grid-auto-flow: column; grid-auto-columns: 64px; order: 2; }
	.pdp-info h1 { font-size: 25px; }
	.pdp-price { font-size: 25px; }
	.pdp-buy .btn { flex: 1 1 40%; padding-inline: 12px; }
	.pdp-meta span { min-width: 96px; }
	.pdp-tabs { margin-top: 34px; padding: 18px 14px; }
	.spec-table th, .spec-table td { padding: 9px 10px; }
	.author-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 16px; }
	.author-photo { width: 170px; }
	.author-stats { justify-content: center; }
	.author-stats li { min-width: 0; padding: 8px 14px; }
	.author-info h1 { font-size: 28px; }
	.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; padding: 14px; border-top: 1px solid var(--line); }
	.cart-table tr:first-child { border-top: 0; }
	.cart-table td { padding: 6px 0; border: 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: 13.5px; }
	.cart-table .cell-remove { position: absolute; top: 14px; inset-inline-end: 14px; width: auto; padding: 0; }
	.cart-under .btn { flex: 1; }
	.nf-code { font-size: 104px; }
	.nf-box h1 { font-size: 23px; }
	.kit-block { padding: 16px; }
	.author-grid--kit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kit .book-row--mini { grid-auto-columns: 40%; }
}

/* الهاتف: أربع بطاقاتٍ أفقيّة تكفي في «مختارات الرفوف» */
@media (max-width: 699px) {
	.section-featured .hcard-grid > :nth-child(n+5) { display: none; }
}

/* ---------------------------------------------------------------- صفوفٌ كاملة دائمًا */
/* «وصل حديثًا» صفٌّ واحد، و«الرائج» صفّان، بأيّ عددٍ للكتب في الصفّ (3–6) */
.book-grid--one > :nth-child(n+5) { display: none; }
body[data-books-per-row="3"] .book-grid--one > :nth-child(n+4) { display: none; }
body[data-books-per-row="5"] .book-grid--one > :nth-child(5) { display: flex; }
body[data-books-per-row="6"] .book-grid--one > :nth-child(n+5) { display: flex; }
body[data-books-per-row="3"] .book-grid--two > :nth-child(n+7),
body[data-books-per-row="5"] .book-grid--two > :nth-child(n+6),
body[data-books-per-row="6"] .book-grid--two > :nth-child(n+7) { display: none; }

/* ---------------------------------------------------------------- كتاب الأسبوع */
.section-spotlight { background: var(--tint-accent-2); }
.spot-book {
	position: relative; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 48px; align-items: center;
	padding: 34px; border-radius: var(--r); background: var(--white); box-shadow: var(--shadow); overflow: hidden; isolation: isolate;
}
.spot-book::before { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; inset-block-end: -120px; inset-inline-end: -90px; border-radius: 50%; border: 26px solid var(--tint-primary); }
.spot-media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / .9; border-radius: var(--r); background: var(--tint-primary-2); }
.spot-cover { display: block; height: 82%; aspect-ratio: 2 / 3; transform: rotate(-4deg); }
.spot-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 18px 30px rgb(0 0 0 / 20%); }
.spot-media .type-dot { width: 40px; height: 40px; bottom: 18px; inset-inline-end: 18px; }
.spot-media .type-dot .icon { width: 21px; height: 21px; }
.spot-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.spot-kicker { font-size: 22px; font-weight: 800; color: var(--store-primary-dark); margin-bottom: 4px; }
.spot-title { font-size: 34px; font-weight: 800; color: var(--store-accent); }
.spot-title a:hover { color: var(--store-primary-dark); }
.spot-author { color: var(--muted); }
.spot-author a { font-weight: 700; color: var(--store-text); border-bottom: 1.5px solid currentColor; }
.spot-desc { display: grid; gap: 10px; color: #4A4A4A; }
.spot-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.spot-facts li { padding: 4px 14px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 500; }
.spot-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 6px; }
.spot-price { font-size: 26px; }
.spot-price del { font-size: 16px; }

/* ---------------------------------------------------------------- آراء القرّاء */
.section-reviews { background: var(--soft); }
.rv-score { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.rv-score b { font-size: 22px; font-weight: 800; color: var(--store-text); }
.rv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.rv-card { position: relative; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 22px 24px 22px; border-radius: var(--r); background: var(--white); }
.rv-card > .rating { min-height: 40px; }
.rv-quote { position: absolute; top: 22px; inset-inline-end: 22px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--store-primary); color: var(--store-accent); }
.rv-quote .icon { width: 22px; height: 22px; }
.rv-card blockquote { margin: 0; font-size: 15.5px; line-height: 1.8; color: #3F3F3F; }
.rv-who { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }
.rv-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--tint-accent); color: var(--store-accent); font-weight: 800; }
.rv-who b { display: block; font-size: 15.5px; }
.rv-who small { display: block; font-size: 13px; color: var(--muted); }
body[data-show-reviews="false"] .section-reviews { display: none; }

/* ---------------------------------------------------------------- أعمال المؤلّف: صفٌّ أفقيّ بلا صفٍّ ناقص */
.author-works .section-head { margin-bottom: 20px; }
.works-count { font-size: 14.5px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------- التصفية الحاليّة */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.active-filters[hidden] { display: none; }
.active-filters > span { font-size: 14px; font-weight: 700; margin-inline-end: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px 4px 14px; border: 1px solid color-mix(in srgb, var(--store-primary) 45%, #FFFFFF); border-radius: 999px; background: var(--tint-primary-2); font-size: 13.5px; font-weight: 500; }
.chip .icon { width: 14px; height: 14px; }
.chip:hover { border-color: var(--store-primary); }
.chip-clear { font-size: 13.5px; font-weight: 700; color: var(--store-primary-dark); border-bottom: 1.5px solid currentColor; margin-inline-start: 4px; }

@media (max-width: 1099px) {
	.book-grid--one > :nth-child(n+4), body[data-books-per-row] .book-grid--one > :nth-child(n+4) { display: none; }
	body[data-books-per-row] .book-grid--two > :nth-child(n+7) { display: none; }
	body[data-books-per-row] .book-grid--two > :nth-child(-n+6) { display: flex; }
	.spot-book { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 24px; }
	.spot-title { font-size: 28px; }
	.rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rv-grid > :nth-child(3) { display: none; }
	.pdp-pair { grid-template-columns: 1fr; }
	.pdp-pair .pdp-block + .pdp-block { margin-top: 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 699px) {
	body[data-books-per-row] .book-grid--one > :nth-child(-n+4) { display: flex; }
	body[data-books-per-row] .book-grid--two > :nth-child(-n+6) { display: flex; }
	.slide-body { width: 100%; }
	.spot-book { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
	.spot-media { aspect-ratio: auto; height: 250px; }
	.spot-cover { height: 214px; }
	.spot-title { font-size: 24px; }
	.spot-desc p + p { display: none; }
	.spot-buy { width: 100%; }
	.spot-buy .btn { flex: 1; }
	.rv-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.rv-grid::-webkit-scrollbar { display: none; }
	.rv-grid > * { scroll-snap-align: start; }
	.rv-grid > :nth-child(3) { display: flex; }
	.rv-score small { display: none; }
	/* الهاتف: الشريحة أقصر وصورتها تحت النصّ، والبانر الجانبيّ صفٌّ مدمج، وشريط المزايا يُمرَّر */
	.slider, .slide { min-height: 400px; }
	.slide-body { padding-bottom: 60px; }
	.promo-side { min-height: 0; }
	.promo-side > img { width: 42%; }
	.promo-side .promo-body, .promo-tall .promo-body, .promo-narrow .promo-body, .promo-offer .promo-body { width: 60%; padding: 20px 16px; gap: 8px; }
	.promo-side .promo-body strong, .promo-tall .promo-body strong, .promo-narrow .promo-body strong, .promo-offer .promo-body strong { font-size: 18px; }
	.promo-text { font-size: 13.5px; }
	.promo-chip { font-size: 13.5px; }
	.promo-tall, .promo-narrow, .promo-offer { min-height: 0; }
	.promo-tall > img, .promo-narrow > img, .promo-offer > img { width: 42%; }
	.trust-bar { padding-block: 16px 0; }
	.trust-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-inline-start: 22px; }
	.trust-list::-webkit-scrollbar { display: none; }
	.trust-item { scroll-snap-align: start; scroll-margin-inline-start: 22px; padding-block: 10px; margin-inline-start: 22px; }
	.trust-icon { width: 46px; height: 46px; margin-inline-start: -22px; }
	.trust-icon .icon { width: 22px; height: 22px; }
	.trust-item b { font-size: 15.5px; }
	.trust-item small { font-size: 13px; }
	.post-grid:not(.post-grid--blog) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.post-grid:not(.post-grid--blog)::-webkit-scrollbar { display: none; }
	.post-grid:not(.post-grid--blog) > * { scroll-snap-align: start; }
	.card-cart { font-size: 13px; gap: 5px; min-height: 40px; padding-inline: 6px; }
	.card-cart .icon { width: 15px; height: 15px; }
}

/* اللوح والهاتف: صور البانرات العريضة في الطرف الأيسر بجانب النصّ لا تحته */
@media (max-width: 1099px) {
	.promo-tall, .promo-narrow, .promo-offer { display: flex; align-items: center; min-height: 240px; }
	.promo-tall > img, .promo-narrow > img, .promo-offer > img { inset: 0 auto 0 0; width: 40%; object-position: 50% 100%; }
	.promo-tall .promo-body, .promo-narrow .promo-body, .promo-offer .promo-body { width: 58%; }
	.promo-tall { background: #FDEBE2; }
	.promo-narrow { background: #F0E9F9; }
	.promo-offer { background: #E9EEF8; }
	.promo-offer > img { object-position: 0 100%; }
}
@media (max-width: 699px) {
	.promo-side > img { inset: 0 auto 0 0; object-position: 50% 100%; }
	.promo-side { background: #F3ECE2; }
}

/* اللوح والهاتف: صورة الشريحة مربّعٌ في الركن الأيسر السفليّ، يحمل موضوعها كاملًا، والنقاط في الطرف الأيمن */
@media (max-width: 1099px) {
	.slide > img { inset: auto auto 18px 18px; width: auto; height: 46%; aspect-ratio: 1; object-position: 0 100%; border-radius: var(--r-sm); }
	.slider-dots { justify-content: flex-start; padding-inline-start: 30px; }
}
@media (max-width: 699px) {
	.slider-dots { padding-inline-start: 22px; bottom: 22px; }
}

/* ================================================================ ميزات المنصّة المعتمدة */
/* عدّاد «عروض الأسبوع» (offer.ends_at): يرسمه theme.js، ويُخفى إن غاب التاريخ أو انقضى */
.flash-timer { display: flex; gap: 6px; direction: rtl; }
.flash-timer[hidden] { display: none; }
.flash-timer span { display: grid; justify-items: center; min-width: 50px; padding: 5px 4px 4px; border-radius: var(--r-sm); background: var(--store-accent); color: var(--white); line-height: 1.1; }
.flash-timer b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.flash-timer small { font-size: 11px; color: color-mix(in srgb, var(--white) 80%, var(--store-accent)); }

/* تبويبات «الرائج» (section.tabs، القاعدة 16) */
.row-tabs { display: flex; flex-wrap: wrap; gap: 8px; order: 1; }
.row-tabs + .head-tools { margin-inline-start: auto; }
.section-head:has(.row-tabs)::after { display: none; }
.row-tab { padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 14px; color: #474747; cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.row-tab:hover { border-color: var(--store-primary); color: var(--store-primary-dark); }
.row-tab[aria-selected="true"] { border-color: var(--store-primary); background: var(--store-primary); color: var(--store-accent); font-weight: 700; }

/* أحدث المقالات وصفحتا المدوّنة (latest_posts، post.*) */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.post-card { display: flex; flex-direction: column; padding: 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); transition: box-shadow .25s, border-color .25s; }
.post-card:hover { box-shadow: var(--shadow); border-color: transparent; }
.post-media { display: block; overflow: hidden; border-radius: calc(var(--r) - 4px); background: var(--soft); aspect-ratio: 16 / 9; }
.post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-media img { transform: scale(1.04); }
.post-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 6px 6px; flex: 1; }
.post-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.post-meta .icon { width: 16px; height: 16px; color: var(--store-primary-dark); }
.post-title { font-size: 18px; font-weight: 700; line-height: 1.45; color: var(--store-text); }
.post-title a:hover { color: var(--store-primary-dark); }
.post-excerpt { font-size: 14.5px; color: var(--muted); }
.post-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-size: 14px; font-weight: 700; color: var(--store-text); }
.post-more .icon { width: 18px; height: 18px; }
.post-more:hover { color: var(--store-primary-dark); }
.icon-flip { transform: scaleX(-1); }
.blog-intro { margin-bottom: 22px; color: var(--muted); text-align: center; }
.page-head--post .breadcrumb { margin: 0 0 12px; }
.post-page-title { max-width: 820px; margin-inline: auto; font-size: 36px; line-height: 1.35; }
.post-meta--head { margin-top: 10px; justify-content: center; }
.article { max-width: 820px; margin-inline: auto; }
.article-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); }
.article-body { margin-top: 26px; font-size: 17px; line-height: 1.95; }
.article-body p + p { margin-top: 16px; }
.article-back { margin-top: 26px; }

/* الأسئلة الشائعة (faq) */
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--gap); align-items: start; }
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, box-shadow .2s; }
.faq-item[open] { border-color: var(--store-primary); box-shadow: var(--shadow); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; font-size: 16px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint-primary); color: var(--store-accent); font-size: 19px; line-height: 1; }
.faq-item[open] summary::after { content: "−"; background: var(--store-primary); }
.faq-item p { padding: 0 18px 16px; font-size: 14.5px; color: var(--muted); }

/* قسيمة الترحيب تحت حقل النشرة (newsletter.offer) */
.nl-offer { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14.5px; font-weight: 700; color: var(--store-text); }
.nl-offer .icon { width: 18px; height: 18px; color: var(--store-primary-dark); }

@media (max-width: 1099px) {
	.section-head:has(.row-tabs) { flex-wrap: wrap; }
	.row-tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
	.row-tab { white-space: nowrap; }
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid:not(.post-grid--blog) > :nth-child(3) { display: none; }
	.faq-list { grid-template-columns: 1fr; }
}
@media (max-width: 699px) {
	.section-head:has(.flash-timer) { flex-wrap: wrap; }
	.flash-timer { order: 3; width: 100%; }
	.flash-timer span { min-width: 0; flex: 1; }
	.section-head:has(.row-tabs) { flex-wrap: wrap; }
	.row-tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
	.row-tab { white-space: nowrap; }
	.post-grid, .post-grid--blog { grid-template-columns: 1fr; }
	.post-grid:not(.post-grid--blog) > :nth-child(3) { display: flex; }
	.post-page-title { font-size: 26px; }
	.article-body { font-size: 16px; }
}

/* تبويبات صفّ الكتب (القاعدة 16): يختفي الشريط إن لم يختر الناشر غير مصدرٍ واحد */
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

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