/* ==================================================================
   عُكاظ — قالب متجر كتب لمنصّة «ناشر»
   واجهةٌ متدرّجة من لون المتجر، وبطاقاتٌ مؤطَّرة بلوحٍ ملوّن يقف عليه الغلاف،
   وتذييلٌ داكن يحمل شريط الثقة.
   ================================================================== */

:root {
	/* ألوان الهويّة: يختارها الناشر، والقيم هنا تجريبيّة */
	--store-primary: #6C5CE7;
	--store-primary-dark: #4B3CC4;
	--store-accent: #1E1B2E;
	--store-bg: #FFFFFF;
	--store-text: #181D25;

	/* محايدات */
	--muted: #4E5562;
	--line: #E0E5EB;
	--soft: #F5F7FA;
	--blush: #FBD9EC;
	--sky: #E3E8FB;
	--gold: #F2A20C;

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

	/* مشتقّات من لون المتجر */
	--tint-1: color-mix(in srgb, var(--store-primary) 16%, #fff);
	--tint-2: color-mix(in srgb, var(--blush) 75%, #fff);
	--tint-3: color-mix(in srgb, var(--sky) 85%, #fff);
	--tint-4: color-mix(in srgb, var(--store-primary) 9%, var(--blush));
	--hero-grad: linear-gradient(100deg,
		color-mix(in srgb, var(--store-primary) 20%, #fff) 0%,
		color-mix(in srgb, var(--store-primary) 8%, var(--sky)) 48%,
		color-mix(in srgb, var(--blush) 80%, #fff) 100%);

	--r: 12px;
	--r-lg: 18px;
	--pill: 999px;
	--hh: 72px;
	--gap: 24px;
	--bpr: 4;
	--shadow: 0 10px 30px -12px rgba(24, 29, 37, .22);
}

body[data-corners="sharp"] { --r: 2px; --r-lg: 4px; --pill: 4px; }
body[data-books-per-row="3"] { --bpr: 3; }
body[data-books-per-row="4"] { --bpr: 4; }
body[data-books-per-row="5"] { --bpr: 5; }
body[data-books-per-row="6"] { --bpr: 6; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: "Tajawal", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--store-primary-dark); outline-offset: 2px; }

.container { width: 100%; max-width: 1296px; margin-inline: auto; padding-inline: 24px; }
.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: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: var(--gold); stroke: var(--gold); }
.icon-fill.off { fill: #E2E5EA; stroke: #E2E5EA; }
.star-gold { fill: var(--gold); stroke: var(--gold); }

/* ------------------------------------------------------------------ أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 22px; border-radius: var(--pill);
	font-weight: 700; font-size: 15px; white-space: nowrap;
	border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--store-primary-dark); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--store-primary-dark) 85%, #000); }
.btn-dark { background: var(--store-accent); color: #fff; }
.btn-dark:hover { background: color-mix(in srgb, var(--store-accent) 80%, var(--store-primary)); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--store-text); }
.btn-outline:hover { border-color: var(--store-text); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--store-text); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
	position: relative; display: inline-grid; place-items: center;
	width: 42px; height: 42px; border-radius: 50%; color: var(--store-text);
	transition: background .2s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--store-text) 7%, transparent); }
.icon-btn-line { border: 1px solid var(--line); background: #fff; }
.icon-btn[aria-pressed="true"] .icon { fill: #D6336C; stroke: #D6336C; }
.round-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
	border: 1px solid var(--line); background: #fff; color: var(--store-text); transition: border-color .2s;
}
.round-btn:hover { border-color: var(--store-text); }
.round-btn-dark { background: var(--store-accent); color: #fff; border-color: var(--store-accent); }
.count-badge {
	position: absolute; top: 2px; inset-inline-end: 0;
	min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
	background: var(--store-primary-dark); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.pills::-webkit-scrollbar { display: none; }
.pills button {
	flex: none; min-height: 40px; padding: 0 18px; border-radius: var(--pill);
	border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; color: var(--store-text);
}
.pills button[aria-selected="true"], .pills button[aria-pressed="true"] { border-color: var(--store-text); font-weight: 700; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
	display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: var(--pill);
	background: var(--soft); border: 1px solid var(--line); font-size: 14px; font-weight: 500;
}
.chip:hover { border-color: var(--store-text); }
.chip[aria-current="page"] { background: var(--store-accent); color: #fff; border-color: var(--store-accent); }

.field, .qty input, .subscribe input, .search-panel input, .drawer-search input, .nf-search input, select {
	min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--pill); background: #fff;
}
textarea.field { border-radius: var(--r); padding: 12px 16px; width: 100%; resize: vertical; }
.select-wrap select { appearance: none; padding-inline-end: 38px; font-weight: 500; font-size: 14px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E5562' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat left 12px center / 16px; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); background: #fff; }
.qty button { width: 38px; height: 42px; font-size: 18px; color: var(--store-text); }
.qty input { width: 48px; min-height: 42px; border: 0; padding: 0; text-align: center; -moz-appearance: textfield; background: transparent; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ------------------------------------------------------------------ نوع الكتاب والتقييم والسعر */
.type-dot {
	display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
	color: #fff; flex: none; box-shadow: 0 0 0 2px #fff;
}
.type-dot .icon { width: 16px; height: 16px; }
.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); }
.pdp-type { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.pdp-type .type-dot { width: 24px; height: 24px; box-shadow: none; }
.pdp-type .type-dot .icon { width: 13px; height: 13px; }

.rating { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: var(--store-text); white-space: nowrap; }
.rating .icon { width: 14px; height: 14px; }
.rating .rc { font-weight: 400; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; }
.rating-lg .icon { width: 20px; height: 20px; }

.price { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-weight: 800; color: var(--store-text); white-space: nowrap; }
.price del { font-weight: 400; font-size: .82em; color: #5F6672; }
.price-lg { font-size: 30px; }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; }
.badge-sale { background: var(--store-primary-dark); color: #fff; }
.badge-new { background: var(--store-accent); color: #fff; }
.badge-best { background: var(--gold); color: var(--store-accent); }  /* book.is_bestseller (ميزة المنصّة) */

/* ------------------------------------------------------------------ الرأس */
.site-header { position: sticky; top: 0; z-index: 40; background: transparent; transition: background .25s, box-shadow .25s; }
.site-header.is-stuck { background: #fff; box-shadow: 0 1px 0 var(--line), 0 8px 24px -18px rgba(24, 29, 37, .4); }
.header-row { display: flex; align-items: center; gap: 20px; height: var(--hh); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 20px; }
.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav > ul { display: flex; gap: 6px; align-items: center; }
.main-nav > ul > li > a, .main-nav > ul > li > button {
	display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; font-weight: 500; font-size: 15px; border-radius: var(--pill);
}
.main-nav > ul > li > a:hover, .main-nav > ul > li > button:hover { background: color-mix(in srgb, var(--store-text) 6%, transparent); }
.main-nav > ul > li:first-child > a { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
.main-nav .icon { width: 16px; height: 16px; }
.has-drop { position: relative; }
.drop {
	position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 210px; padding: 8px;
	background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.drop a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.drop a:hover { background: var(--soft); }
.has-drop:hover .drop, .has-drop:focus-within .drop, .has-drop.open .drop { opacity: 1; visibility: visible; transform: none; }
.header-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.menu-toggle { display: none; }

.search-panel { display: none; padding: 0 0 16px; }
.search-open .search-panel { display: block; }
.search-panel .container { display: flex; gap: 8px; }
.search-panel input { flex: 1; min-width: 0; }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 14, 25, .45); z-index: 60; opacity: 0; visibility: hidden; transition: .25s; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 61; width: min(320px, 86vw);
	background: #fff; padding: 16px; overflow-y: auto; transform: translateX(100%); transition: transform .3s; visibility: hidden;
}
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-search { display: flex; gap: 6px; margin-bottom: 10px; }
.drawer-search input { flex: 1; min-width: 0; }
.drawer-nav > li { border-bottom: 1px solid var(--line); }
.drawer-nav a, .drawer-label { display: block; padding: 12px 4px; font-weight: 500; }
.drawer-label { color: var(--muted); font-size: 14px; padding-bottom: 4px; }
.drawer-nav ul { padding: 0 12px 8px; }
.drawer-nav ul a { padding: 8px 4px; font-weight: 400; }

/* ------------------------------------------------------------------ الواجهة والتدرّج تحت الرأس */
.under-header { margin-top: calc(-1 * var(--hh)); padding-top: calc(var(--hh) + 40px); background: var(--hero-grad); }
.hero { padding-bottom: 72px; }
/* إن أخفى الناشر كلّ ما في الواجهة، تُخفى ويبقى الرأس على الخلفيّة البيضاء */
.hero:not(:has(.hero-cats, .hero-art, .formats, [data-option]:not(:empty))) { display: none; }
body[data-show-formats="false"] .hero:not(:has(.hero-cats, .hero-art, [data-option]:not(:empty))) { display: none; }
.hero-title { font-size: clamp(32px, 4.6vw, 62px); font-weight: 800; letter-spacing: -.5px; max-width: 19ch; line-height: 1.2; padding-top: 32px; }
.hero-text { margin-top: 18px; font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); max-width: 56ch; }
[data-option]:empty { display: none; }
.hero-cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 48px; }
.hcat { display: flex; flex-direction: column; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(24, 29, 37, .05); transition: transform .25s, box-shadow .25s; }
.hcat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.hcat img { width: 100%; aspect-ratio: 400 / 260; object-fit: cover; }
.hcat span { padding: 13px 10px; text-align: center; font-weight: 500; font-size: 15px; }
.formats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.formats-label { font-size: 14px; font-weight: 700; }
.formats ul { display: flex; gap: 8px; flex-wrap: wrap; }
.formats a { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--pill); background: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 500; }
.formats a:hover { background: #fff; }
.formats .type-dot { width: 26px; height: 26px; box-shadow: none; }
.formats .type-dot .icon { width: 14px; height: 14px; }
body[data-show-formats="false"] .formats { display: none; }

.page-head { padding-bottom: 40px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; margin-top: 10px; }
.page-head p { margin-top: 8px; color: var(--muted); max-width: 62ch; }
.page-head-sm { padding-bottom: 28px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; color: #8A909A; }
.breadcrumb a:hover { color: var(--store-text); }
.breadcrumb [aria-current] { color: var(--store-text); font-weight: 500; }

/* ------------------------------------------------------------------ الأقسام */
.section { padding-block: 64px; }
.section-tight { padding-block: 36px; }
.section-flush { padding-top: 8px; }
.page-head + .section-flush { padding-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-title { font-size: clamp(22px, 2.2vw, 30px); font-weight: 800; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; color: var(--store-primary-dark); }
.link-more .icon { width: 18px; height: 18px; }
.center-row { display: flex; justify-content: center; margin-top: 36px; }
.carousel-nav { display: flex; gap: 8px; }
.block-title { font-size: 20px; font-weight: 800; margin-bottom: 14px; }

/* ------------------------------------------------------------------ بطاقة الكتاب */
.book-grid { display: grid; grid-template-columns: repeat(var(--bpr), minmax(0, 1fr)); gap: var(--gap); }
.book-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: box-shadow .25s, transform .25s; min-width: 0; }
.book-card:hover { box-shadow: var(--shadow); }
.book-media { position: relative; aspect-ratio: 4 / 3; background: var(--tint-1); display: grid; place-items: center; overflow: hidden; }
.book-card:nth-child(4n+2) .book-media { background: var(--tint-2); }
.book-card:nth-child(4n+3) .book-media { background: var(--tint-3); }
.book-card:nth-child(4n+4) .book-media { background: var(--tint-4); }
.book-cover { position: absolute; top: 10%; bottom: 10%; left: 50%; transform: translateX(-50%); aspect-ratio: 2 / 3; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 14px 22px -10px rgba(24, 29, 37, .45), 0 2px 4px rgba(24, 29, 37, .12); transition: transform .3s; }
.book-card:hover .book-cover img { transform: translateY(-4px) rotate(-1deg); }
.book-media > .type-dot { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; }
.book-badges { position: absolute; top: 14px; inset-inline-end: 12px; z-index: 2; display: flex; gap: 6px; }
.book-actions { position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 2; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateY(6px); transition: .2s; }
.book-actions .icon-btn { width: 38px; height: 38px; background: #fff; box-shadow: 0 2px 8px rgba(24, 29, 37, .14); }
.book-actions .icon-btn .icon { width: 18px; height: 18px; }
.book-card:hover .book-actions, .book-card:focus-within .book-actions { opacity: 1; transform: none; }
@media (hover: none) { .book-actions { opacity: 1; transform: none; } }
.stock-band { position: absolute; inset-inline: 0; bottom: 0; z-index: 1; padding: 6px; text-align: center; font-size: 13px; font-weight: 700; background: rgba(24, 29, 37, .82); color: #fff; }
.book-card.is-out .book-cover img { filter: grayscale(.85); opacity: .7; }
.book-card.is-out .book-actions { bottom: 40px; }

.book-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.book-line { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; }
.book-title { flex: 1 1 120px; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.book-title a:hover { color: var(--store-primary-dark); }
.book-line .rating { flex: none; }
/* صفّ السعر وزرّ السلّة: ظاهرٌ دائمًا، ويُدفع وحده إلى أسفل البطاقة (الملحق، البند 7) */
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.book-foot .price { font-size: 16px; min-width: 0; }
.cart-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--store-accent); color: #fff; transition: background .2s; }
.cart-btn .icon { width: 18px; height: 18px; }
.cart-btn:hover { background: var(--store-primary-dark); }
.cart-btn[disabled] { background: var(--soft); color: #6B7280; border: 1px solid var(--line); cursor: not-allowed; }
.book-meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.by { flex: 1 1 auto; min-width: 0; }
.by a { color: var(--store-text); font-weight: 500; }
.by a:hover { text-decoration: underline; }

/* أشكال البطاقة (خيار card_style) */
body[data-card-style="plain"] .book-card { border-color: transparent; background: transparent; }
body[data-card-style="plain"] .book-media { border-radius: var(--r); }
body[data-card-style="plain"] .book-body { padding-inline: 2px; }
body[data-card-style="shadow"] .book-card { border-color: transparent; box-shadow: 0 6px 22px -12px rgba(24, 29, 37, .3); }

/* البطاقة العريضة والدوّار */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - var(--gap)) / 2); gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; padding-bottom: 4px; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; }
.book-card.is-wide .book-media { aspect-ratio: 16 / 10; }
.book-card.is-wide .book-cover { top: 11%; bottom: 11%; }
.book-card.is-wide .book-body { padding: 16px 20px 18px; }
.book-card.is-wide .book-title { font-size: 17px; }
.book-card.is-wide .book-foot .price { font-size: 20px; }
.book-card.is-wide .cart-btn { width: 40px; height: 40px; }

/* «شاهدتَه مؤخّرًا» */
.recent-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.book-card.is-compact .book-body { padding: 10px 12px 12px; }
.book-card.is-compact .book-title { font-size: 14px; flex-basis: 100%; }
.book-card.is-compact .price { font-size: 14px; }
.book-card.is-compact .cart-btn { width: 34px; height: 34px; }
.book-card.is-compact .cart-btn .icon { width: 16px; height: 16px; }
.book-card.is-compact .book-actions { display: none; }
.book-card.is-compact .type-dot { width: 26px; height: 26px; top: 8px; inset-inline-start: 8px; }
.book-card.is-compact .type-dot .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ التبويبات والفسيفساء */

.collections { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.collection { display: block; min-width: 0; }
.mosaic { display: grid; gap: 6px; }
.m-big { width: 100%; aspect-ratio: 600 / 320; object-fit: cover; border-radius: var(--r) var(--r) 4px 4px; }
.m-covers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.m-covers img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: 12px 0; background: var(--tint-1); border-radius: 4px 4px 4px var(--r); }
.m-covers img + img { background: var(--tint-2); border-radius: 4px 4px var(--r) 4px; }
.collection:hover .m-big { filter: saturate(1.15); }
.collection-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 12px; }
.collection-foot h3 { font-size: 17px; font-weight: 700; }
.collection-foot .muted { font-size: 13px; }

/* ------------------------------------------------------------------ التذييل */
.site-footer { background: var(--store-accent); color: #C9C7D3; }
.site-footer a:hover { color: #fff; }
.trust-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding: 56px 0 44px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.trust-icon { width: 26px; height: 26px; color: #fff; stroke-width: 1.5; }
.trust-bar h3 { margin-top: 14px; font-size: 17px; color: #fff; }
.trust-bar p { margin-top: 6px; font-size: 14px; line-height: 1.7; }
body[data-show-trust-bar="false"] .trust-bar { display: none; }
.footer-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.1fr; gap: 32px; padding: 44px 0; }
.footer-main h2 { font-size: 16px; color: #fff; margin-bottom: 16px; }
.newsletter h2 { font-size: 17px; max-width: 34ch; }
.subscribe { display: flex; gap: 8px; max-width: 440px; }
.subscribe input { flex: 1; min-width: 0; background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
.subscribe input::placeholder { color: #A9A6B8; }
.site-footer .btn-primary { background: var(--store-primary); }
.site-footer .btn-primary:hover { background: var(--store-primary-dark); }
body[data-show-newsletter="false"] .newsletter { display: none; }
.social { display: flex; gap: 10px; margin-top: 26px; }
.social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; }
.social a:hover { background: rgba(255, 255, 255, .16); }
.social .icon { width: 18px; height: 18px; }
.footer-col li + li { margin-top: 10px; }
.footer-col a, .footer-col span { font-size: 15px; }
.contact-list li { display: flex; align-items: center; gap: 10px; }
.contact-list .icon { width: 17px; height: 17px; color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 0 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px; }
.pay-note { display: inline-flex; align-items: center; gap: 6px; }
.pay-note .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ التصنيف */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.listing-count { margin-inline-end: auto; color: var(--muted); font-size: 15px; }
.listing-count b { color: var(--store-text); }
.toolbar-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-panel { display: none; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 22px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--soft); }
.filters-open .filter-panel { display: grid; }
.filter-panel legend { font-weight: 700; margin-bottom: 10px; }
.filter-panel label { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 3px 0; }
.filter-panel input[type="checkbox"], .filter-panel input[type="radio"] { width: 17px; height: 17px; accent-color: var(--store-primary-dark); }
.range { display: flex; align-items: center; gap: 8px; }
.range .field { width: 100%; min-width: 0; }
.range label { flex: 1; padding: 0; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 50%; font-weight: 500; border: 1px solid transparent; }
.pagination a:hover { border-color: var(--line); }
.pagination a[aria-current] { background: var(--store-accent); color: #fff; }
.pagination .icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ صفحات الكتاب */
.pdp-section { padding: 24px 0 40px; }
.pdp-head { margin-top: 18px; }
.pdp-head h1 { font-size: clamp(28px, 3.6vw, 46px); font-weight: 800; }
.pdp-byline { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; font-size: 15px; color: var(--muted); }
.pdp-byline .mini-avatar { width: 32px; height: 32px; }
.pdp-byline span a { color: var(--store-text); font-weight: 700; }
.rating-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--pill); border: 1px solid var(--line); color: var(--store-text); font-size: 14px; }
.rating-pill .icon { width: 15px; height: 15px; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px; margin-top: 28px; align-items: start; }
.gallery { display: grid; gap: 12px; }
.gallery-main { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-lg); background: var(--hero-grad); }
.gallery-main img { position: absolute; top: 9%; height: 82%; left: 50%; transform: translateX(-50%); width: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 40px -18px rgba(24, 29, 37, .55); }
.gallery-main > .type-dot { position: absolute; top: 16px; inset-inline-start: 16px; width: 36px; height: 36px; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery-thumbs button { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: var(--r); background: var(--tint-3); border: 2px solid transparent; }
.gallery-thumbs button:nth-child(2) { background: var(--tint-2); }
.gallery-thumbs button:nth-child(3) { background: var(--tint-1); }
.gallery-thumbs button[aria-pressed="true"] { border-color: var(--store-text); }
.gallery-thumbs img { position: absolute; top: 10%; height: 80%; left: 50%; transform: translateX(-50%); width: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 12px -6px rgba(24, 29, 37, .4); }
.sample-player { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--pill); background: #fff; }
.sp-body { flex: 1; display: grid; gap: 6px; font-size: 14px; }
.sp-bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sp-bar span { display: block; height: 100%; background: var(--store-primary-dark); }
.sp-time { font-size: 13px; color: var(--muted); }

.buy-box { position: sticky; top: calc(var(--hh) + 16px); display: grid; gap: 18px; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.buy-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stock { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #23704F; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.opt-group { display: grid; gap: 8px; }
.opt-label { font-size: 14px; font-weight: 700; }
.opt-group .qty { justify-self: start; }
.opt-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-pills button { min-height: 42px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line); font-size: 14px; }
.opt-pills button[aria-checked="true"] { border-color: var(--store-text); font-weight: 700; box-shadow: inset 0 0 0 1px var(--store-text); }
.format-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.format-chips span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--pill); background: var(--soft); font-size: 14px; }
.format-chips .icon { width: 17px; height: 17px; color: var(--muted); }
.buy-buttons { display: grid; gap: 10px; }
.perks { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks .icon { width: 18px; height: 18px; color: var(--store-text); }

.pdp-details { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px; margin-top: 48px; }
.prose { color: #333D4C; font-size: 16px; line-height: 1.9; }
.prose p + p { margin-top: 12px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 11px 0; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.spec-table th { width: 42%; font-weight: 400; color: var(--muted); }
.spec-table td a { font-weight: 500; color: var(--store-primary-dark); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; font-size: 14px; }
.tags a { padding: 5px 12px; border-radius: var(--pill); background: var(--soft); border: 1px solid var(--line); }
.tags a:hover { border-color: var(--store-text); }

/* الآراء */
.reviews-section { border-top: 1px solid var(--line); }
body[data-show-reviews="false"] .reviews-section { display: none; }
.reviews-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start; }
.reviews-summary { display: grid; gap: 6px; padding: 24px; border-radius: var(--r-lg); background: var(--hero-grad); }
.reviews-summary strong { font-size: 52px; font-weight: 800; line-height: 1; }
.rating-bars { display: grid; gap: 8px; margin-top: 12px; font-size: 13px; }
.rating-bars li { display: grid; grid-template-columns: 12px 14px 1fr 36px; align-items: center; gap: 6px; }
.rating-bars .icon { width: 13px; height: 13px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .8); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.note { font-size: 13px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.note .icon { width: 15px; height: 15px; }
.review-list { display: grid; gap: 14px; }
.review { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.review-head { display: flex; align-items: center; gap: 12px; }
.review-head > div { display: grid; flex: 1; line-height: 1.4; }
.review-head small { color: var(--muted); font-size: 13px; }
.review-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--tint-1); font-weight: 800; color: var(--store-text); }
.review p { margin-top: 12px; color: #333D4C; }
.review-form { display: grid; gap: 12px; padding: 22px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--soft); }
.review-form[hidden] { display: none; }
.review-form h3 { font-size: 17px; }
.review-form .btn { justify-self: start; }
.star-input { display: flex; gap: 4px; }
.star-input button .icon { width: 26px; height: 26px; }
.star-input button[aria-checked="true"] ~ button .icon { fill: #E2E5EA; stroke: #E2E5EA; }

/* ------------------------------------------------------------------ المؤلّف */
.author-head { padding-bottom: 56px; }
.author-hero { display: flex; gap: 32px; align-items: center; margin-top: 24px; }
.author-photo { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; flex: none; border: 5px solid #fff; box-shadow: var(--shadow); }
.author-hero h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; }
.author-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: 15px; color: var(--muted); }
.author-stats li { display: inline-flex; align-items: center; gap: 6px; }
.author-stats b { color: var(--store-text); }
.author-stats .icon { width: 17px; height: 17px; }
.author-stats .type-dot { width: 26px; height: 26px; }
.author-stats .type-dot .icon { width: 14px; height: 14px; }
.author-bio { margin-top: 14px; max-width: 70ch; color: #333D4C; }
.author-bio p + p { margin-top: 8px; }

/* ------------------------------------------------------------------ السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.cart-list { display: grid; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) 120px 130px 110px 42px; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.cart-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--r); background: var(--tint-1); }
.cart-item:nth-child(2) .cart-thumb { background: var(--tint-2); }
.cart-item:nth-child(3) .cart-thumb { background: var(--tint-3); }
.cart-item:nth-child(4) .cart-thumb { background: var(--tint-4); }
.cart-thumb img { position: absolute; top: 10%; height: 80%; left: 50%; transform: translateX(-50%); width: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 12px -6px rgba(24, 29, 37, .45); }
.cart-info h3 { font-size: 16px; font-weight: 700; }
.cart-info p { font-size: 14px; margin: 2px 0 6px; }
.cart-price .price { font-size: 15px; flex-direction: column; gap: 0; }
.cart-total { font-size: 16px; font-weight: 800; white-space: nowrap; }
.digital-note { font-size: 13px; color: var(--muted); }
.cart-remove { color: var(--muted); }
.cart-under { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.empty-cart { text-align: center; padding: 48px 24px; border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty-cart[hidden] { display: none; }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--tint-1); }
.empty-cart h2 { margin-top: 14px; }
.empty-cart p { margin: 6px 0 18px; color: var(--muted); }
.summary { position: sticky; top: calc(var(--hh) + 16px); display: grid; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.summary h2 { font-size: 20px; font-weight: 800; }
.coupon { display: flex; gap: 8px; }
.coupon .field { flex: 1; min-width: 0; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--pill); background: var(--tint-1); font-size: 14px; }
.coupon-applied button { font-weight: 700; color: var(--store-text); text-decoration: underline; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--muted); }
.summary-row b { color: var(--store-text); }
.summary-total { padding-top: 14px; border-top: 1px solid var(--line); font-size: 18px; color: var(--store-text); font-weight: 800; }

/* ------------------------------------------------------------------ 404 */
.nf-panel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 56px; border-radius: 28px; background: var(--hero-grad); overflow: hidden; }
.nf-code { display: block; font-size: clamp(80px, 12vw, 150px); font-weight: 800; line-height: 1; color: var(--store-text); letter-spacing: 2px; }
.nf-text h1 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; margin-top: 8px; }
.nf-text p { margin-top: 10px; color: var(--muted); max-width: 48ch; }
.nf-search { display: flex; gap: 8px; margin: 24px 0 14px; max-width: 460px; }
.nf-search input { flex: 1; min-width: 0; }
.nf-stack { position: relative; height: 340px; }
.nf-stack img { position: absolute; top: 50%; left: 50%; width: 170px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 40px -18px rgba(24, 29, 37, .6); }
.nf-stack img:nth-child(1) { transform: translate(-110%, -48%) rotate(-12deg); }
.nf-stack img:nth-child(2) { transform: translate(-50%, -54%) rotate(2deg); z-index: 2; }
.nf-stack img:nth-child(3) { transform: translate(10%, -46%) rotate(13deg); }

/* ------------------------------------------------------------------ البانر العريض والمؤلّفون */
.promo { position: relative; display: flex; align-items: center; min-height: 300px; padding: 40px; border-radius: var(--r-lg); overflow: hidden; background: var(--hero-grad); }
.promo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.promo-text { position: relative; display: grid; gap: 10px; justify-items: start; max-width: 460px; padding: 28px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .9); box-shadow: var(--shadow); }
.promo-title { font-size: clamp(22px, 2.4vw, 32px); font-weight: 800; line-height: 1.3; }
.promo-sub { color: var(--muted); font-size: 15px; }
.promo .btn { margin-top: 6px; }
.promo:hover .btn { background: color-mix(in srgb, var(--store-accent) 80%, var(--store-primary)); }

.author-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.author-card { display: grid; justify-items: center; gap: 4px; padding: 22px 12px; text-align: center; border: 1px solid var(--line); border-radius: var(--r); background: #fff; transition: box-shadow .25s; }
.author-card:hover { box-shadow: var(--shadow); }
.author-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; box-shadow: 0 0 0 4px var(--tint-1); }
.author-card:nth-child(3n+2) img { box-shadow: 0 0 0 4px var(--tint-2); }
.author-card:nth-child(3n+3) img { box-shadow: 0 0 0 4px var(--tint-3); }
.author-card h3 { font-size: 15px; font-weight: 700; }
.author-card .muted { font-size: 13px; }

/* ------------------------------------------------------------------ components.html */
.kit-title { font-size: 18px; font-weight: 800; margin: 44px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.kit-title:first-child { margin-top: 0; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.demo-header { position: relative; border-radius: var(--r-lg); border: 1px solid var(--line); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.swatches div { display: grid; gap: 6px; font-size: 13px; }
.sw { display: block; height: 64px; border-radius: var(--r); }
.sw-line { border: 1px solid var(--line); }
.sw-grad { background: var(--hero-grad); }
.kit-hero { padding: 24px; border-radius: var(--r-lg); background: var(--hero-grad); margin-bottom: 24px; }
.kit-hero .hero-cats { margin-top: 0; }
.kit-band { padding: 24px; border-radius: var(--r-lg); background: var(--soft); }
.kit-narrow { max-width: 460px; }

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

/* ------------------------------------------------------------------ العروض */
@media (max-width: 1199px) {
	.main-nav > ul > li > a, .main-nav > ul > li > button { padding: 8px 8px; font-size: 14px; }
	.book-grid { grid-template-columns: repeat(min(var(--bpr), 4), minmax(0, 1fr)); }
	.recent-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.recent-row > :nth-child(n+5) { display: none; }
}

@media (max-width: 991px) {
	:root { --hh: 64px; --gap: 16px; }
	.main-nav, .hide-sm { display: none; }
	.menu-toggle { display: inline-grid; }
	.header-row { gap: 8px; }
	.brand { margin-inline-end: auto; }
	.hero-cats { grid-template-columns: repeat(3, 1fr); }
	.collections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.trust-bar { grid-template-columns: repeat(2, 1fr); }
	.footer-main { grid-template-columns: 1fr 1fr 1fr; }
	.footer-about { grid-column: 1 / -1; }
	.filter-panel { grid-template-columns: repeat(2, 1fr); }
	.pdp, .pdp-details { grid-template-columns: 1fr; }
	.buy-box { position: static; }
	.reviews-layout { grid-template-columns: 1fr; gap: 20px; }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.cart-item { grid-template-columns: 84px minmax(0, 1fr) auto 42px; grid-template-areas: "t i i r" "t p q s"; row-gap: 8px; }
	.cart-thumb { grid-area: t; }
	.cart-info { grid-area: i; }
	.cart-price { grid-area: p; }
	.cart-qty { grid-area: q; justify-self: end; }
	.cart-total { grid-area: s; display: none; }
	.cart-remove { grid-area: r; align-self: start; }
	.nf-panel { grid-template-columns: 1fr; padding: 36px 28px; }
	.nf-stack { height: 260px; order: -1; }
	.nf-stack img { width: 130px; }
	.swatches { grid-template-columns: repeat(3, 1fr); }
	.author-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.promo { min-height: 260px; padding: 28px; }
}

@media (max-width: 767px) {
	.container { padding-inline: 16px; }
	.section { padding-block: 44px; }
	.section-tight { padding-block: 24px; }
	.hero { padding-bottom: 44px; }
	.hero-title { padding-top: 12px; }
	.hero-cats { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 30px; }
	.book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.book-body { padding: 10px 12px 12px; gap: 8px; }
	.book-title { font-size: 14px; flex-basis: 100%; }
	.book-foot .price { font-size: 15px; }
	.cart-btn, .book-card.is-compact .cart-btn { width: 40px; height: 40px; } /* لمسٌ مريح في الجوّال */
	.book-meta { font-size: 12px; }
	.book-meta .mini-avatar { display: none; }
	.book-media > .type-dot { top: 8px; inset-inline-start: 8px; width: 26px; height: 26px; }
	.book-media > .type-dot .icon { width: 14px; height: 14px; }
	.book-badges { top: 9px; inset-inline-end: 8px; }
	.book-actions { bottom: 6px; inset-inline-end: 6px; }
	.book-actions .icon-btn { width: 34px; height: 34px; }
	.carousel { grid-auto-columns: 88%; }
	.book-card.is-wide .book-meta .mini-avatar { display: block; }
	.recent-row { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 42%; overflow-x: auto; scrollbar-width: none; }
	.recent-row > :nth-child(n+5) { display: flex; }
	.collections { grid-template-columns: 1fr 1fr; gap: 16px; }
	.collection-foot { flex-direction: column; gap: 0; }
	.collection-foot h3 { font-size: 15px; }
	.trust-bar { grid-template-columns: 1fr 1fr; gap: 22px 16px; padding: 40px 0 32px; }
	.trust-bar p { font-size: 13px; }
	.footer-main { grid-template-columns: 1fr 1fr; }
	.footer-main .footer-col:last-child { grid-column: 1 / -1; }
	.toolbar { gap: 10px; }
	.listing-count { width: 100%; }
	[data-region="category_strip"] .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	[data-region="category_strip"] .chip { flex: none; }
	.filter-panel { grid-template-columns: 1fr; padding: 18px; }
	.pdp-section { padding-top: 16px; }
	.gallery-main { aspect-ratio: 1; }
	.buy-box { padding: 20px; }
	.reviews-summary strong { font-size: 44px; }
	.author-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
	.author-photo { width: 120px; height: 120px; }
	.cart-item { grid-template-columns: 72px minmax(0, 1fr) 36px; grid-template-areas: "t i r" "t p p" "q q s"; gap: 8px 12px; }
	.cart-qty { justify-self: start; }
	.cart-total { display: block; justify-self: end; align-self: center; }
	.nf-panel { padding: 28px 18px; border-radius: 20px; }
	.nf-stack { height: 210px; }
	.nf-stack img { width: 104px; }
	.nf-search { flex-direction: column; }
	.swatches { grid-template-columns: repeat(2, 1fr); }
	.kit-hero { padding: 14px; }
	.author-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 40%; overflow-x: auto; scrollbar-width: none; gap: 12px; }
	.promo { flex-direction: column; align-items: stretch; justify-content: flex-end; min-height: 0; padding: 150px 14px 14px; }
	.promo > img { height: 180px; bottom: auto; }
	.promo-text { max-width: none; padding: 20px; }
}

@media (max-width: 420px) {
	.brand-name { font-size: 17px; }
}

/* ------------------------------------------------------------------ الإصدار الثاني: أقسام الرئيسيّة */
.band-soft { background: var(--soft); }
.section-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }

/* الواجهة: العنوان بجانب صورةٍ من الناشر (منطقة home_hero_banner) */
.hero-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-top:not(:has(.hero-art)) { grid-template-columns: minmax(0, 1fr); }
.hero-art { display: block; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.hero-art img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .4s; }
.hero-art:hover img { transform: scale(1.02); }

/* عروض السوق: عرضٌ كبير وقائمةٌ مدمجة، وعدّادٌ واحد للقسم */
.countdown { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.countdown[hidden] { display: none; }
.cd-label { font-size: 14px; font-weight: 700; color: var(--muted); margin-inline-end: 4px; }
.cd-unit { display: grid; justify-items: center; min-width: 54px; padding: 6px 6px 5px; border-radius: 12px; background: var(--store-accent); color: #fff; line-height: 1.2; }
.cd-unit b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 11px; color: #D9D6E6; }
.deal-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.deal-card { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); min-width: 0; transition: box-shadow .25s; }
.deal-card:hover { box-shadow: var(--shadow); }
.deal-media { position: relative; aspect-ratio: 3 / 4; border-radius: calc(var(--r) - 4px); background: var(--tint-2); overflow: hidden; }
.deal-card:nth-child(3) .deal-media { background: var(--tint-3); }
.deal-card:nth-child(4) .deal-media { background: var(--tint-4); }
.deal-media .book-cover { top: 12%; bottom: 12%; }
.deal-media > .type-dot { position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; width: 24px; height: 24px; box-shadow: none; }
.deal-media > .type-dot .icon { width: 13px; height: 13px; }
.deal-media .book-badges { top: auto; bottom: 6px; inset-inline-end: 6px; }
.deal-media .badge { height: 20px; padding: 0 7px; font-size: 11px; }
.deal-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.deal-body .book-title { flex: none; font-size: 15px; }
.deal-body .book-meta .mini-avatar { display: none; }
.deal-desc { display: none; }
.deal-body .rating { align-self: flex-start; }
.deal-body .book-foot { margin-top: 2px; }
.cart-btn-text { display: none; }
/* العرض الأوّل كبير: الغلاف على لوحٍ متدرّج، والوصف وزرٌّ بنصّ */
.deal-card:first-child { grid-row: span 3; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0; padding: 0; align-items: stretch; overflow: hidden; }
.deal-card:first-child .deal-media { aspect-ratio: auto; min-height: 380px; border-radius: 0; background: var(--hero-grad); }
.deal-card:first-child .deal-media .book-cover { top: 11%; bottom: 11%; }
.deal-card:first-child .deal-media > .type-dot { top: 14px; inset-inline-start: 14px; width: 34px; height: 34px; }
.deal-card:first-child .deal-media > .type-dot .icon { width: 17px; height: 17px; }
.deal-card:first-child .deal-media .book-badges { top: 16px; bottom: auto; inset-inline-end: 14px; }
.deal-card:first-child .deal-media .badge { height: 26px; padding: 0 11px; font-size: 13px; }
.deal-card:first-child .deal-body { justify-content: center; gap: 12px; padding: 32px 28px; }
.deal-card:first-child .book-title { font-size: clamp(20px, 2vw, 26px); font-weight: 800; white-space: normal; }
.deal-card:first-child .book-meta .mini-avatar { display: block; }
.deal-card:first-child .deal-desc { display: block; color: #333D4C; font-size: 15px; line-height: 1.85; }
.deal-card:first-child .book-foot { margin-top: 8px; }
.deal-card:first-child .book-foot { justify-content: flex-start; gap: 20px; flex-wrap: wrap; }
.deal-card:first-child .book-foot .price { font-size: 24px; }
.deal-card:first-child .cart-btn { width: auto; height: 46px; padding: 0 20px; border-radius: var(--pill); display: inline-flex; gap: 8px; font-weight: 700; }
.deal-card:first-child .cart-btn-text { display: inline; }

/* آراء القرّاء في الرئيسيّة */
.home-reviews { border-top: 0; }
.home-reviews:not(:has([data-repeat="review"])) { display: none; }
.store-score { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--pill); background: #fff; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.store-score b { font-size: 17px; font-weight: 800; color: var(--store-text); }
.store-score .icon { width: 18px; height: 18px; }
.review-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.review-card { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.review-card .stars .icon { width: 17px; height: 17px; }
.review-card blockquote { margin: 0; flex: 1; color: #333D4C; font-size: 15px; line-height: 1.85; }
.review-card figcaption { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-card figcaption > span:last-child { display: grid; line-height: 1.45; }
.review-card figcaption small { color: var(--muted); font-size: 13px; }
.review-card:nth-child(2) .review-avatar { background: var(--tint-2); }
.review-card:nth-child(3) .review-avatar { background: var(--tint-3); }

/* المقالات (latest_posts) والمدوّنة */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-width: 0; transition: box-shadow .25s; }
.post-card:hover { box-shadow: var(--shadow); }
.post-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-body { display: grid; gap: 8px; padding: 16px 18px 20px; }
.post-date { font-size: 13px; color: var(--muted); }
.post-title { font-size: 17px; font-weight: 700; line-height: 1.5; }
.post-title a:hover { color: var(--store-primary-dark); }
.post-excerpt { font-size: 14px; color: var(--muted); line-height: 1.8; }
.post-grid.is-blog, .post-grid.is-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-grid.is-blog > :first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.post-grid.is-blog > :first-child .post-media img { height: 100%; }
.post-grid.is-blog > :first-child .post-body { align-content: center; padding: 32px; }
.post-grid.is-blog > :first-child .post-title { font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; }
.post-grid.is-blog > :first-child .post-excerpt { font-size: 16px; }
.article { max-width: 780px; padding-bottom: 24px; }
.article-head { padding-top: 8px; }
.article-title { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; margin-top: 8px; }
.article-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); margin: 28px 0; }
.article-body { color: #333D4C; font-size: 17px; line-height: 2; }
.article-body p + p, .article-body h2 + p { margin-top: 12px; }
.article-body h2 { font-size: 22px; font-weight: 800; color: var(--store-text); margin-top: 32px; }
.article-body blockquote { margin: 28px 0; padding: 20px 24px; border-radius: var(--r-lg); background: var(--hero-grad); font-size: 19px; font-weight: 700; color: var(--store-text); }
.article-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* صفحات الكتاب: اختيار الصيغة (book.formats)، ونبذة المؤلّف بجانب الوصف */
.format-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.format-opt { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; transition: border-color .2s; }
.format-opt:hover { border-color: var(--store-text); }
.format-opt[aria-current="page"] { border-color: var(--store-text); box-shadow: inset 0 0 0 1px var(--store-text); }
.format-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.format-name .type-dot { width: 20px; height: 20px; box-shadow: none; }
.format-name .type-dot .icon { width: 11px; height: 11px; }
.format-opt [data-slot="book.price"] { color: var(--muted); font-size: 13px; }
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ [data-preview-copy])) { display: none; }
.pdp-author { display: flex; gap: 16px; align-items: flex-start; margin-top: 28px; padding: 20px; border-radius: var(--r-lg); background: var(--soft); }
.pdp-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.pdp-author h3 { font-size: 17px; font-weight: 800; }
.pdp-author p { margin-top: 6px; color: #333D4C; font-size: 15px; line-height: 1.8; }
.pdp-author .link-more { margin-top: 8px; font-size: 14px; }

/* صفحة التصنيف: المرشّحات المختارة، والتبديل بين الشبكة والقائمة */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 22px; }
.active-filters:not(:has(.chip)) { display: none; }
.active-filters .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; font-size: 14px; }
.active-filters .chip .icon { width: 14px; height: 14px; }
.active-filters .clear-all { font-size: 14px; font-weight: 700; color: var(--store-primary-dark); padding: 6px 4px; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; background: #fff; }
.view-switch button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--store-accent); color: #fff; }
.book-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.book-grid.is-list .book-card { flex-direction: row; }
.book-grid.is-list .book-media { width: 220px; flex: none; aspect-ratio: 4 / 3; }
.book-grid.is-list .book-body { justify-content: center; padding: 18px 22px; }
.book-grid.is-list .book-foot { margin-top: 4px; justify-content: flex-start; gap: 16px; }

/* صفحة المؤلّف: أوّل كتابٍ عريض، فتمتلئ الصفوف بسبعة كتب */
.works-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.works-grid > .book-card:first-child { grid-column: span 2; }
.work-desc { display: none; }
.works-grid > .book-card:first-child { flex-direction: row; }
.works-grid > .book-card:first-child .book-media { aspect-ratio: auto; width: 46%; flex: none; }
.works-grid > .book-card:first-child .book-cover { top: 12%; bottom: 12%; }
.works-grid > .book-card:first-child .book-body { justify-content: center; padding: 24px; }
.works-grid > .book-card:first-child .book-title { font-size: 20px; font-weight: 800; white-space: normal; }
.works-grid > .book-card:first-child .work-desc { display: block; color: #333D4C; font-size: 14px; line-height: 1.8; }
.works-grid > .book-card:first-child .book-foot { margin-top: 6px; }

@media (max-width: 991px) {
	.hero-top { gap: 28px; }
	.hero-art { border-radius: 20px; }
	.deal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.deal-card:first-child { grid-row: auto; grid-column: 1 / -1; }
	.deal-card:not(:first-child) { grid-template-columns: minmax(0, 1fr); align-items: stretch; align-content: start; }
	.deal-card:not(:first-child) .deal-media { aspect-ratio: 4 / 3; }
	.deal-card:first-child .deal-media { min-height: 320px; }
	.review-cards, .post-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
	.review-cards > *, .post-grid > * { scroll-snap-align: start; }
	.post-grid.is-blog { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
	.works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.hero-top { grid-template-columns: minmax(0, 1fr); }
	.hero-art { display: none; }
	.hero-cats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 40%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
	.hero-cats::-webkit-scrollbar { display: none; }
	.hero-cats > * { scroll-snap-align: start; }
	.hcat span { padding: 10px 6px; font-size: 14px; }
	.formats { margin-top: 20px; gap: 10px; }
	.trust-bar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding: 22px 0; }
	.trust-bar::-webkit-scrollbar { display: none; }
	.trust-bar li { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-content: start; scroll-snap-align: start; padding: 14px; border-radius: var(--r); background: rgba(255, 255, 255, .06); }
	.trust-bar .trust-icon { grid-row: span 2; }
	.trust-bar h3 { margin-top: 0; font-size: 15px; }
	.trust-bar p { margin-top: 2px; }
	.countdown { width: 100%; }
	.cd-unit { min-width: 0; flex: 1; }
	.cd-label { width: 100%; }
	.deal-grid { grid-template-columns: minmax(0, 1fr); }
	.deal-card, .deal-card:not(:first-child) { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px; align-items: center; }
	.deal-card:not(:first-child) .deal-media { aspect-ratio: 3 / 4; }
	.deal-card:first-child { grid-template-columns: minmax(0, 1fr); padding: 0; }
	.deal-card:first-child .deal-media { min-height: 0; aspect-ratio: 4 / 3; }
	.deal-card:first-child .deal-body { padding: 18px 16px 20px; gap: 10px; }
	.deal-card:first-child .book-foot .price { font-size: 21px; }
	.review-cards, .post-grid { grid-auto-columns: 86%; gap: 12px; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
	.review-card { padding: 18px; }
	.post-grid.is-blog { grid-template-columns: minmax(0, 1fr); margin-inline: 0; padding-inline: 0; gap: 16px; }
	.post-grid.is-blog > :first-child { grid-template-columns: minmax(0, 1fr); }
	.post-grid.is-blog > :first-child .post-body { padding: 18px; }
	.article-body { font-size: 16px; }
	.book-grid.is-list .book-media { width: 128px; aspect-ratio: 3 / 4; }
	.book-grid.is-list .book-body { padding: 12px 14px; }
	.pdp-author { padding: 16px; }
	.section-flush { padding-top: 8px; }
	.format-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.format-opt { padding: 8px 10px; }
	.works-grid > .book-card:first-child { flex-direction: column; }
	.works-grid > .book-card:first-child .book-media { width: auto; aspect-ratio: 16 / 9; }
	.works-grid > .book-card:first-child .book-body { padding: 14px 16px 16px; }
	.works-grid > .book-card:first-child .book-title { font-size: 18px; }
}

/* تبويبات صفّ الكتب (القاعدة 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; }
