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

:root {
	--store-primary: #2F4F46;
	--store-primary-dark: #1E3530;
	--store-accent: #C8794A;
	--store-bg: #F6F4F0;
	--store-text: #1F2421;

	--white: #FFFFFF;
	--line: #E0E5EB;
	--line-strong: #CDD3DA;
	--muted: #4E5562;
	--star: #F2B01E;
	--star-off: #DEE2E7;
	--ok: #2D6B47;

	--tile: color-mix(in srgb, var(--store-bg) 82%, var(--store-primary) 4%);
	--disc: color-mix(in srgb, var(--store-bg) 88%, var(--store-primary) 6%);
	--soft-btn: color-mix(in srgb, var(--store-text) 6%, var(--white));

	--radius: 16px;
	--radius-lg: 22px;
	--pill: 999px;
	--shadow-cap: 0 10px 30px rgba(24, 32, 28, .08);
	--shadow-cover: 0 14px 30px rgba(24, 32, 28, .18);
	--container: 1296px;
	--per-row: 4;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: "Tajawal", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--store-text);
	background: var(--white);
	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; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
:focus-visible { outline: 2px solid var(--store-accent); outline-offset: 2px; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}
.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }

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

/* ---------------------------------------------------------------- buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 44px; padding: 0 22px;
	border: 1.5px solid transparent; border-radius: var(--pill);
	font-size: 14px; font-weight: 700; line-height: 1;
	white-space: nowrap;
	background: transparent;
	transition: background-color .2s, border-color .2s, color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--store-primary); color: var(--white); }
.btn-dark:hover { background: var(--store-primary-dark); }
.btn-line { background: var(--white); border-color: var(--line-strong); color: var(--store-text); }
.btn-line:hover { border-color: var(--store-text); }
.btn-muted, .btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-outline-light { border-color: var(--white); color: var(--white); }
.btn-outline-light:hover { background: var(--white); color: var(--store-primary); }

.icon-btn {
	position: relative;
	display: inline-grid; place-items: center;
	width: 44px; height: 44px; flex: none;
	border: 0; border-radius: 50%;
	background: transparent; color: var(--store-text);
	transition: background-color .2s, color .2s;
}
.icon-btn-soft { background: var(--soft-btn); }
.icon-btn-soft:hover { background: var(--line); }
.icon-btn-line { background: var(--white); border: 1px solid var(--line-strong); }
.icon-btn-line:hover { border-color: var(--store-text); }
.icon-btn-dark { background: var(--store-primary); color: var(--white); }
.icon-btn-lg { width: 52px; height: 52px; }
[data-action="wishlist"][aria-pressed="true"] .icon { fill: var(--store-accent); stroke: var(--store-accent); }

.link-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 0; border: 0; background: none;
	font-size: 14px; font-weight: 500; color: var(--store-text);
	text-decoration: underline; text-underline-offset: 3px;
}
.link-btn .icon { width: 16px; height: 16px; }

.field {
	width: 100%; height: 44px; padding: 0 16px;
	border: 1px solid var(--line-strong); border-radius: 12px;
	background: var(--white); color: var(--store-text);
}
textarea.field { height: auto; padding: 12px 16px; resize: vertical; }
.field-pill { border-radius: var(--pill); padding-inline: 20px; }
.field::placeholder { color: #5F6672; }

/* ---------------------------------------------------------------- rating, price, badges, type */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 2px; }
.stars .icon { width: 14px; height: 14px; fill: var(--star); stroke: var(--star); stroke-width: 1; }
.stars .icon.off { fill: var(--star-off); stroke: var(--star-off); }
.rating-lg .stars .icon { width: 18px; height: 18px; }
.rating-lg { font-size: 14px; }

.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-weight: 700; font-size: 16px; color: var(--store-text); }
.price del { font-weight: 400; font-size: .85em; color: var(--muted); }
.price-lg { font-size: 24px; }

.badge {
	display: inline-flex; align-items: center;
	height: 24px; padding: 0 10px;
	border-radius: var(--pill);
	font-size: 12px; font-weight: 700; line-height: 1;
}
.badge-sale { background: var(--store-accent); color: var(--store-text); }
.badge-new { background: #2F5D8A; color: var(--white); }

.type-dot {
	display: inline-grid; place-items: center;
	width: 30px; height: 30px; border-radius: 50%;
	color: var(--white);
	box-shadow: 0 0 0 2px var(--white);
	flex: none;
}
.type-dot .icon { width: 16px; height: 16px; stroke-width: 1.9; }
.type-dot[data-type="print"] { background: #DB7056; }
.type-dot[data-type="ebook"] { background: #5675A3; }
.type-dot[data-type="audio"] { background: #986AB0; }
.type-dot[data-type="educational"] { background: #3f8f6b; }

/* ---------------------------------------------------------------- top bar */
.topbar { background: var(--store-bg); font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.topbar-contact a { font-weight: 700; }
.topbar-msg { text-align: center; }
.topbar-msg:empty { display: none; }
.topbar-links { display: flex; gap: 20px; }
.topbar-links a:hover { text-decoration: underline; }
.pill-count {
	display: inline-grid; place-items: center;
	min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: var(--pill); background: var(--white);
	font-size: 11px; font-weight: 700;
}

/* ---------------------------------------------------------------- floating capsule header */
.site-header {
	position: sticky; top: 0; z-index: 50;
	padding: 6px 0 10px;
	background: var(--store-bg);
	transition: background-color .25s;
}
.site-header.is-scrolled { background: transparent; }
.header-capsule {
	display: flex; align-items: center; gap: 16px;
	height: 64px;
	padding-inline: 24px 10px;
	background: var(--white);
	border-radius: var(--pill);
	box-shadow: var(--shadow-cap);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.main-nav { margin-inline: auto; }
.main-nav > ul { display: flex; align-items: center; gap: 4px; }
.main-nav > ul > li > a,
.main-nav .has-drop > button {
	display: inline-flex; align-items: center; gap: 4px;
	height: 40px; padding: 0 14px;
	border: 0; background: none;
	font-size: 15px; font-weight: 500;
	border-radius: var(--pill);
}
.main-nav > ul > li > a:hover, .main-nav .has-drop > button:hover { background: var(--store-bg); }
.main-nav .has-drop { position: relative; }
.main-nav .has-drop .icon { width: 16px; height: 16px; transition: transform .2s; }
.main-nav .drop {
	position: absolute; top: calc(100% + 12px); inset-inline-start: 0;
	min-width: 220px; padding: 10px;
	background: var(--white); border-radius: var(--radius);
	box-shadow: 0 18px 40px rgba(24, 32, 28, .14);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .2s, transform .2s, visibility .2s;
}
.main-nav .drop a { display: block; padding: 8px 14px; border-radius: 10px; font-size: 15px; }
.main-nav .drop a:hover { background: var(--store-bg); }
.main-nav .has-drop:hover .drop,
.main-nav .has-drop:focus-within .drop,
.main-nav .has-drop.open .drop { opacity: 1; visibility: visible; transform: none; }
.main-nav .has-drop.open > button .icon { transform: rotate(180deg); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.main-nav + .header-actions { margin-inline-start: 0; }
.cart-count {
	position: absolute; top: 2px; inset-inline-end: 0;
	display: grid; place-items: center;
	min-width: 18px; height: 18px; padding: 0 4px;
	border-radius: var(--pill);
	background: var(--store-accent); color: var(--store-text);
	font-size: 11px; font-weight: 700; line-height: 1;
}
.menu-toggle { display: none; }

.search-panel {
	display: flex; gap: 10px;
	margin-top: 10px; padding: 8px;
	background: var(--white); border-radius: var(--pill);
	box-shadow: var(--shadow-cap);
}
.search-panel[hidden] { display: none; }
.search-panel .field { border-color: transparent; background: var(--store-bg); }

/* drawer */
.drawer-backdrop, .filters-backdrop {
	position: fixed; inset: 0; z-index: 80;
	background: rgba(15, 20, 18, .45);
	opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.drawer, .filters-panel {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 90;
	width: min(340px, 88vw);
	padding: 18px 20px 24px;
	background: var(--white);
	overflow-y: auto;
	transform: translateX(100%);
	visibility: hidden;
	transition: transform .3s, visibility .3s;
}
body.drawer-open .drawer, body.filters-open .filters-panel { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop, body.filters-open .filters-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.drawer-head h2 { font-size: 20px; }
.drawer-nav > li > a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); font-weight: 500; }
.drawer-sub { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer-sub a { padding: 6px 14px; border-radius: var(--pill); background: var(--store-bg); font-size: 14px; }
.drawer-phone { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-weight: 700; }

/* ---------------------------------------------------------------- sections */
.section { padding: 64px 0; }
.section-tight { padding: 44px 0; }
.section-soft { background: var(--store-bg); }
.section-head {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
	padding-bottom: 16px; margin-bottom: 28px;
	border-bottom: 1px solid var(--line);
}
.section-soft .section-head { border-color: var(--line-strong); }
.section-title { font-size: 28px; font-weight: 700; line-height: 1.3; }
.section-title.center { text-align: center; }
.view-all { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.view-all .icon { width: 16px; height: 16px; }
.view-all:hover { text-decoration: underline; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 500; letter-spacing: .04em; }

/* ---------------------------------------------------------------- hero: cover carousel */
.hero { background: var(--store-bg); padding: 36px 0 72px; overflow: hidden; }
.hero-title {
	max-width: 780px; margin-inline: auto;
	text-align: center;
	font-size: clamp(30px, 4.4vw, 58px); font-weight: 800; line-height: 1.25; letter-spacing: -.01em;
}
.hero-title:empty { display: none; }
.hero-stage { position: relative; margin-top: 36px; --cover-w: 260px; --disc: 270px; --info-top: 450px; height: 610px; }
.hero-track { position: absolute; inset: 0; }
.hero-item { position: absolute; inset: 0; pointer-events: none; }
.hero-item.is-active { z-index: 1; }
.hero-disc {
	position: absolute; top: 10px; left: calc(50% - var(--cover-w) / 2);
	width: var(--cover-w); height: calc(var(--cover-w) * 1.5);
	display: grid; place-items: center;
	border-radius: 6px;
	opacity: 0; transform: scale(.85);
	transition: left .45s ease, top .45s ease, width .45s ease, height .45s ease, border-radius .45s ease, background-color .45s, opacity .35s, transform .45s;
}
.hero-disc img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-cover); transition: width .45s, height .45s, box-shadow .45s; }
.hero-disc .type-dot { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; transition: opacity .3s; }
.hero-item.is-active .hero-disc { opacity: 1; transform: none; pointer-events: auto; }
.hero-item.is-next .hero-disc, .hero-item.is-prev .hero-disc {
	opacity: 1; transform: none; pointer-events: auto;
	top: calc(10px + var(--cover-w) * .75 - var(--disc) / 2);
	width: var(--disc); height: var(--disc);
	border-radius: 50%;
	background: var(--disc-bg, color-mix(in srgb, var(--white) 55%, var(--store-bg)));
}
.hero-item.is-next .hero-disc img, .hero-item.is-prev .hero-disc img { width: 34%; height: 51%; box-shadow: 0 8px 18px rgba(24, 32, 28, .18); }
.hero-item.is-next .type-dot, .hero-item.is-prev .type-dot { opacity: 0; }
/* RTL: the next book waits on the left, the previous on the right */
.hero-item.is-next .hero-disc { left: calc(50% - 46vw); }
.hero-item.is-prev .hero-disc { left: calc(50% + 46vw - var(--disc)); }
.hero-info {
	position: absolute; top: var(--info-top); left: 0; right: 0;
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	text-align: center;
	opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.hero-item.is-active .hero-info { opacity: 1; visibility: visible; pointer-events: auto; }
.hero-meta { font-size: 16px; color: var(--muted); }
.hero-info .btn { margin-top: 6px; }
.hero-arrow { position: absolute; top: calc(10px + var(--cover-w) * .75 - 22px); z-index: 2; }
.hero-prev { left: calc(50% + var(--cover-w) / 2 + 48px); }
.hero-next { left: calc(50% - var(--cover-w) / 2 - 92px); }

/* ---------------------------------------------------------------- category circles */
.section-cats { padding: 72px 0 40px; }
.cat-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.cat-disc { display: block; width: min(160px, 100%); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--disc); transition: transform .25s; }
.cat-disc img { width: 100%; height: 100%; object-fit: cover; }
.cat:hover .cat-disc { transform: translateY(-4px); }
.cat-name { font-size: 16px; font-weight: 700; }

/* ---------------------------------------------------------------- book card */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 36px 24px; }
body[data-books-per-row="3"] { --per-row: 3; }
body[data-books-per-row="4"] { --per-row: 4; }
body[data-books-per-row="5"] { --per-row: 5; }
.bcard { display: flex; flex-direction: column; min-width: 0; }
.bcard-media { position: relative; padding: 26px 21%; background: var(--tile); border-radius: var(--radius); }
.bcard-media .type-dot { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; }
.bcard-media .badge { position: absolute; top: 14px; inset-inline-start: 12px; z-index: 1; }
.bcard-cover { position: relative; display: block; }
.bcard-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-cover); transition: transform .3s, opacity .3s; }
.bcard-cover .cover-back { position: absolute; inset: 0; height: 100%; opacity: 0; }
.bcard-cover.has-back:hover .cover-back { opacity: 1; }
.bcard:hover .bcard-cover img:first-child { transform: translateY(-4px); }
.bcard-author { margin-top: 16px; font-size: 13px; color: var(--muted); }
.bcard-title { margin-top: 2px; font-size: 15px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard-title a:hover { text-decoration: underline; }
.bcard .rating { margin-top: 4px; }
.bcard.is-out .bcard-cover img:first-child { filter: grayscale(.6); opacity: .8; }

/* compact card (recent) */
.recent-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.mcard { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mcard-cover { position: relative; display: block; padding: 16px 18%; background: var(--tile); border-radius: 14px; }
.mcard-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 8px 18px rgba(24, 32, 28, .16); }
.mcard-cover .type-dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 26px; height: 26px; }
.mcard-cover .type-dot .icon { width: 14px; height: 14px; }
.mcard-title { font-size: 14px; font-weight: 700; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .price { font-size: 14px; }

/* ---------------------------------------------------------------- gallery mosaic */
.section-gallery { padding-top: 24px; }
.gal-row { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; }
.gal-row + .gal-row { margin-top: 20px; }
.gal-row-flip { grid-template-columns: 7fr 5fr; }
.gal-heading { grid-column: 1 / -1; margin-bottom: 8px; }
.gal-item { position: relative; display: block; height: 440px; border-radius: var(--radius); overflow: hidden; background: var(--tile); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gal-item:hover img { transform: scale(1.03); }
.gal-cap {
	position: absolute; bottom: 18px; inset-inline-start: 18px;
	display: inline-flex; align-items: center; gap: 14px;
	max-width: calc(100% - 36px);
	padding: 10px 14px 10px 20px;
	padding-inline: 20px 14px;
	background: var(--white); border-radius: var(--pill);
	box-shadow: 0 6px 18px rgba(24, 32, 28, .12);
}
.gal-cap b { display: block; font-size: 15px; line-height: 1.4; }
.gal-cap small { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.gal-cap .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- trust bar */
body[data-show-trust-bar="false"] .trust { display: none; }

/* ---------------------------------------------------------------- split panel (spotlight, author) */
.split-wrap { position: relative; }
.split-eyebrow { position: absolute; top: 52px; left: 0; width: 50%; z-index: 1; text-align: center; color: rgba(255, 255, 255, .86); }
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: 540px; border-radius: var(--radius-lg); overflow: hidden; }
.split-light { display: grid; place-items: center; padding: 48px; background: color-mix(in srgb, var(--store-bg) 80%, var(--store-primary) 8%); }
.split-cover { position: relative; display: block; width: min(270px, 70%); }
.split-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; box-shadow: 0 24px 48px rgba(24, 32, 28, .25); }
.split-cover .type-dot { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; }
.split-dark {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	padding: 96px 48px 56px;
	background: var(--store-primary); color: var(--white); text-align: center;
}
.split-title { font-size: 28px; font-weight: 700; line-height: 1.35; max-width: 420px; }
.split-author { color: rgba(255, 255, 255, .86); }
.split-dark .rating { color: rgba(255, 255, 255, .86); }
.split-dark .price { color: var(--white); }
.split-dark .price del { color: rgba(255, 255, 255, .78); }
.split-dark .btn { margin-top: 8px; }
.split-author.split, .split.split-author { min-height: 420px; }
.split-author .split-dark { padding-top: 56px; align-items: flex-start; text-align: start; }
.split-author .eyebrow { color: rgba(255, 255, 255, .86); }
.author-photo { width: 240px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: 0 18px 40px rgba(24, 32, 28, .18); }
.split-bio { max-width: 520px; color: rgba(255, 255, 255, .9); }
.split-count b { font-size: 22px; }

/* authors row */
.author-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.acard { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--white); border-radius: var(--radius); }
.acard img { flex: none; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.acard b { display: block; font-size: 16px; }
.acard small { font-size: 13px; color: var(--muted); }
.acard:hover b { text-decoration: underline; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: 0; padding: 72px 0 28px; background: var(--store-primary-dark); color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 40px; align-items: start; text-align: center; }
.footer-col li + li { margin-top: 10px; }
.footer-col a { font-size: 15px; color: rgba(255, 255, 255, .86); }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-news h2 { font-size: 28px; font-weight: 700; }
.footer-news p { margin-top: 8px; color: rgba(255, 255, 255, .86); }
.news-field { position: relative; max-width: 460px; margin: 22px auto 0; }
.news-field input {
	width: 100%; height: 50px; padding-inline: 22px 58px;
	border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--pill);
	background: transparent; color: var(--white);
}
.news-field input::placeholder { color: rgba(255, 255, 255, .8); }
.news-field button {
	position: absolute; top: 5px; inset-inline-end: 5px;
	width: 40px; height: 40px; border: 0; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--white); color: var(--store-primary-dark);
}
.news-field button .icon { width: 18px; height: 18px; }
.social { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--white); transition: background-color .2s; }
.social a:hover { background: rgba(255, 255, 255, .12); }
.social .icon { width: 18px; height: 18px; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 44px; font-size: 14px; color: rgba(255, 255, 255, .86); }
.footer-contact li { display: inline-flex; align-items: center; gap: 8px; }
.footer-contact .icon { width: 17px; height: 17px; }
.copyright { margin-top: 22px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); text-align: center; font-size: 13px; color: rgba(255, 255, 255, .86); }

/* ---------------------------------------------------------------- page heads, breadcrumb, chips */
.page-head { padding: 28px 0 8px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; color: var(--line-strong); }
.breadcrumb a:hover { color: var(--store-text); text-decoration: underline; }
.page-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; }
.page-title { font-size: 34px; font-weight: 800; line-height: 1.3; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
	display: inline-flex; align-items: center; gap: 6px;
	height: 36px; padding: 0 16px;
	border: 1px solid var(--line-strong); border-radius: var(--pill);
	background: var(--white); font-size: 14px;
}
a.chip:hover { border-color: var(--store-text); }
.chip-on { background: var(--store-bg); border-color: transparent; padding-inline-end: 6px; }
.chip-on button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--white); }
.chip-on .icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- listing */
.section-listing { padding-top: 24px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-select { position: relative; }
.pill-select select {
	appearance: none; -webkit-appearance: none;
	height: 44px; padding-inline: 18px 40px;
	border: 1px solid var(--line-strong); border-radius: var(--pill);
	background: var(--white); font-size: 14px; font-weight: 500;
	cursor: pointer;
}
.pill-select .icon { position: absolute; top: 13px; inset-inline-end: 14px; width: 16px; height: 16px; pointer-events: none; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 28px; }
.listing-count { margin-inline-start: auto; font-size: 14px; color: var(--muted); }
.section-head .listing-count { margin: 0; }
.filter-group { padding: 16px 0; border-top: 1px solid var(--line); }
.filter-group legend { padding: 0; margin-bottom: 10px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--store-primary); }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters-panel .btn { margin-top: 16px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 52px; }
.pagination a, .pagination span {
	display: grid; place-items: center;
	min-width: 44px; height: 44px; padding: 0 6px;
	border-radius: 50%; font-weight: 700; font-size: 15px;
}
.pagination a:hover { background: var(--store-bg); }
.pagination a[aria-current="page"] { background: var(--store-primary); color: var(--white); }
.pagination .page-arrow { border: 1px solid var(--line-strong); }

/* ---------------------------------------------------------------- product page */
.section-pdp { padding: 24px 0 64px; }
.pdp { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; margin-top: 20px; }
.pdp-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gal-tile { position: relative; padding: 28px; background: var(--tile); border-radius: var(--radius); }
.gal-tile img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-cover); }
.gal-tile .type-dot { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 1; }
.pdp-info { position: sticky; top: 100px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pdp-isbn { font-size: 13px; color: var(--muted); }
.pdp-type { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pdp-type .type-dot { width: 26px; height: 26px; box-shadow: none; }
.pdp-type .type-dot .icon { width: 14px; height: 14px; }
.pdp-title { font-size: 34px; font-weight: 800; line-height: 1.3; }
.pdp-author a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pdp-price { display: flex; align-items: center; gap: 12px; }
.pdp-lead { color: var(--muted); font-size: 15px; }
.pdp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; width: 100%; padding: 16px 0; border-block: 1px solid var(--line); }
.pdp-meta li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; font-size: 14px; }
.pdp-meta .icon { grid-row: span 2; width: 22px; height: 22px; color: var(--store-primary); }
.pdp-meta span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pdp-meta b { line-height: 1.5; }
.stock-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ok); }
.stock-ok .icon { width: 18px; height: 18px; }
.pdp-buttons { display: flex; gap: 10px; width: 100%; }
.pdp-buttons-2 { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.pdp-buttons-2 .btn { flex: 1; }

.pdp-block { margin-top: 64px; }
.block-title { font-size: 24px; font-weight: 700; padding-bottom: 14px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.pdp-about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
.prose p + p { margin-top: 14px; }
.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: 500; color: var(--muted); }

.reviews-layout { display: grid; grid-template-columns: 360px 1fr; gap: 48px; align-items: start; }
.reviews-summary { display: flex; align-items: center; gap: 16px; }
.reviews-summary strong { font-size: 52px; line-height: 1; font-weight: 800; }
.reviews-summary small { display: block; font-size: 14px; color: var(--muted); }
.rating-bars { margin-top: 18px; }
.rating-bars li { display: grid; grid-template-columns: 60px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 3px 0; }
.rating-bars .bar { height: 8px; border-radius: var(--pill); background: var(--line); overflow: hidden; }
.rating-bars .bar span { display: block; height: 100%; background: var(--star); border-radius: inherit; }
.review-form { margin-top: 24px; padding: 20px; background: var(--store-bg); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.review-form h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; }
.review-form p { font-size: 14px; color: var(--muted); }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: var(--star-off); }
.star-input label .icon { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-accent); border-radius: 4px; }
.review { padding: 20px 0; border-bottom: 1px solid var(--line); }
.review:first-child { padding-top: 0; }
.review-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-top b { display: block; line-height: 1.4; }
.review-top small { font-size: 13px; color: var(--muted); }
.review-top .rating { margin-inline-start: auto; }
.review-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--store-bg); font-weight: 700; }

/* ---------------------------------------------------------------- cart */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; margin-top: 28px; }
.cart-list { border-top: 1px solid var(--line); }
.cart-item {
	display: grid; grid-template-columns: 90px 1fr auto 110px auto;
	align-items: center; gap: 20px;
	padding: 20px 0; border-bottom: 1px solid var(--line);
}
.cart-cover { display: block; padding: 10px; background: var(--tile); border-radius: 12px; }
.cart-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; }
.cart-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cart-info h3 { font-size: 16px; line-height: 1.5; }
.cart-info .muted { font-size: 13px; }
.cart-info .price { font-size: 14px; }
.cart-info .pdp-type { font-size: 13px; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty .icon-btn { width: 36px; height: 36px; }
.qty .icon-btn .icon { width: 16px; height: 16px; }
.qty input {
	width: 48px; height: 36px; text-align: center;
	border: 1px solid var(--line-strong); border-radius: var(--pill);
	-moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart-line { text-align: end; font-size: 16px; }
.cart-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.cart-empty { padding: 56px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cart-empty[hidden] { display: none; }
.empty-icon { width: 56px; height: 56px; stroke-width: 1.2; }
.cart-summary { position: sticky; top: 100px; padding: 28px; background: var(--store-bg); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 16px; }
.cart-summary h2 { font-size: 22px; }
.cart-summary dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 15px; }
.cart-summary dt { color: var(--muted); }
.cart-summary dd { font-weight: 700; }
.sum-total { margin-top: 6px; padding-top: 14px !important; border-top: 1px solid var(--line-strong); font-size: 18px !important; }
.sum-total dt { color: var(--store-text) !important; font-weight: 700; }
.coupon { display: flex; gap: 8px; }
.coupon .field { background: var(--white); }
.coupon-on { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.coupon-on .icon { width: 16px; height: 16px; }
.sum-notes { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.sum-notes li { display: flex; align-items: center; gap: 8px; }
.sum-notes .icon { width: 16px; height: 16px; }
.sum-notes a { color: var(--store-text); font-weight: 700; text-decoration: underline; }

/* ---------------------------------------------------------------- 404 */
.nf { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; margin-top: 12px; }
.nf-text { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 32px 0; }
.nf-code { font-size: 150px; font-weight: 300; line-height: 1; color: var(--store-primary); letter-spacing: .02em; }
.nf-text h1 { font-size: 36px; font-weight: 800; }
.nf-search { display: flex; gap: 8px; max-width: 460px; margin-top: 6px; }
.nf-search .icon-btn { width: 44px; height: 44px; }
.nf-links { max-width: 460px; margin-top: 10px; }
.nf-links a { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.nf-links a:hover { color: var(--store-primary); }
.nf-art { display: grid; place-items: center; min-height: 480px; padding: 40px; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--store-bg) 80%, var(--store-primary) 10%); }
.nf-art img { width: min(240px, 60%); border-radius: 5px; box-shadow: 0 24px 48px rgba(24, 32, 28, .25); transform: rotate(-4deg); }

/* ---------------------------------------------------------------- components page */
.kit { padding: 40px 0; border-bottom: 1px solid var(--line); }
.kit-title { font-size: 22px; margin-bottom: 6px; }
.kit-note { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.kit-title + .book-grid, .kit-title + .kit-row, .kit-title + .cat-row, .kit-title + .split-wrap, .kit-title + .section-head { margin-top: 20px; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.kit-dark { display: inline-flex; padding: 12px; background: var(--store-primary); border-radius: var(--radius); }
.kit-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.kit-toggles [aria-pressed="false"] { color: var(--muted); }
.post-grid.kit-post { grid-template-columns: minmax(0, 420px); }
.kit-pdp { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }

/* ---------------------------------------------------------------- options */
body[data-show-ratings="false"] .bcard .rating,
body[data-show-ratings="false"] .split .rating { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
	.main-nav > ul > li > a, .main-nav .has-drop > button { padding: 0 10px; font-size: 14px; }
	.main-nav > ul > li:last-child { display: none; }
	.hero-stage { --disc: 210px; }
}

@media (max-width: 1023px) {
	.menu-toggle { display: inline-grid; }
	.main-nav { display: none; }
	.header-capsule { padding-inline: 8px; gap: 8px; }
	.main-nav + .header-actions { margin-inline-start: auto; }
	.book-grid { --per-row: 3 !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.recent-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.recent-row > :nth-child(n+5) { display: none; }
	.cat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
	.author-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hero-stage { --cover-w: 220px; --disc: 170px; --info-top: 380px; height: 540px; }
	.hero-prev { left: calc(50% + var(--cover-w) / 2 + 18px); }
	.hero-next { left: calc(50% - var(--cover-w) / 2 - 62px); }
	.pdp { grid-template-columns: 1fr; gap: 32px; }
	.pdp-info { position: static; }
	.pdp-about { grid-template-columns: 1fr; gap: 28px; }
	.reviews-layout { grid-template-columns: 1fr; gap: 32px; }
	.cart-layout { grid-template-columns: 1fr; }
	.cart-summary { position: static; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-news { grid-column: 1 / -1; order: -1; }
	.gal-item { height: 340px; }
	.split { min-height: 460px; }
}

@media (max-width: 767px) {
	.topbar-msg, .topbar-links a:not(:first-child) { display: none; }
	.topbar .container { min-height: 36px; font-size: 12px; }
	.section { padding: 48px 0; }
	.section-title { font-size: 22px; }
	.brand-name { font-size: 18px; }
	.header-capsule { height: 58px; }
	.brand img { width: 34px; height: 34px; }

	.hero { padding: 28px 0 48px; }
	.hero-stage { --cover-w: 190px; --info-top: 320px; height: 500px; margin-top: 24px; }
	.hero-item.is-next .hero-disc, .hero-item.is-prev .hero-disc { opacity: 0; pointer-events: none; }
	.hero-prev { left: calc(50% + var(--cover-w) / 2 + 10px); }
	.hero-next { left: calc(50% - var(--cover-w) / 2 - 54px); }
	.price-lg { font-size: 21px; }

	.section-cats { padding: 48px 0 24px; }
	.cat-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
	.cat { flex: 0 0 132px; scroll-snap-align: start; }
	.cat-disc { width: 132px; }

	.book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
	.bcard-media { padding: 20px 14%; }

	.recent-row { display: flex; overflow-x: auto; gap: 14px; padding-bottom: 8px; scroll-snap-type: x mandatory; }
	.recent-row > * { flex: 0 0 132px; scroll-snap-align: start; }
	.recent-row > :nth-child(n+5) { display: flex; }

	.gal-row, .gal-row-flip { grid-template-columns: 1fr; gap: 14px; }
	.gal-row + .gal-row { margin-top: 14px; }
	.gal-item { height: 280px; }


	.split, .split.split-author { grid-template-columns: 1fr; min-height: 0; }
	.split-light { padding: 36px; }
	.split-cover { width: min(200px, 60%); }
	.split-dark { padding: 36px 24px; }
	.split-title { font-size: 23px; }
	.author-photo { width: 180px; }

	.author-row { grid-template-columns: 1fr; }

	.footer-grid { grid-template-columns: 1fr; gap: 32px; }
	.footer-news h2 { font-size: 23px; }
	.site-footer { padding-top: 52px; }

	.page-title, .pdp-title { font-size: 27px; }
	.filter-sort { width: 100%; }
	.filter-sort .pill-select select { width: 100%; }
	.listing-count { width: 100%; margin-inline-start: 0; }

	.pdp-gallery { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.gal-tile { flex: 0 0 66%; scroll-snap-align: start; padding: 20px; }

	.cart-item {
		grid-template-columns: 72px 1fr auto;
		grid-template-areas: "c i r" "c q t";
		gap: 10px 14px;
	}
	.cart-cover { grid-area: c; align-self: start; padding: 6px; }
	.cart-info { grid-area: i; }
	.cart-remove { grid-area: r; align-self: start; }
	.qty { grid-area: q; }
	.cart-line { grid-area: t; }
	.cart-summary { padding: 22px; }

	.nf { grid-template-columns: 1fr; }
	.nf-code { font-size: 110px; }
	.nf-text h1 { font-size: 28px; }
	.nf-art { min-height: 300px; order: -1; }
	.nf-art img { width: 150px; }
}

@media (hover: none) {
	.bcard-cover.has-back:hover .cover-back { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

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

/* مقالٌ كبير وبجانبه مقالان */
.post-grid--feature { grid-template-columns: 2fr 1fr 1fr; align-items: start; }
.post-grid--feature > .post-card:first-child .post-title { font-size: 1.3rem; }
@media (max-width: 991px) {
	.post-grid--feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid--feature > .post-card:first-child { grid-column: 1 / -1; }
	.post-grid--feature > .post-card:nth-child(3):last-child { display: flex; }
}
@media (max-width: 600px) { .post-grid--feature { grid-template-columns: minmax(0, 1fr); } }

.section-blog .post-grid--feature > .post-card:first-child .post-title { font-size: 22px; }
.post-date { letter-spacing: .01em; }
.post-page-title { font-size: clamp(27px, 3.2vw, 38px); }
.post-grid-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991px) { .post-grid-page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid-page { grid-template-columns: minmax(0, 1fr); } }

/* ==== الإصدار الثاني: بطاقةٌ مدمجة، وتبويبات، ودوّارٌ أفقيّ، وعدّاد، وآراء القرّاء ==== */

/* بطاقة الكتاب: المفضّلة والنظرة السريعة تطفوان فوق الغلاف، وزرّ السلّة دائرةٌ بجانب السعر */
.bcard-tools {
	position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 2;
	display: flex; gap: 6px;
	opacity: 0; transform: translateY(6px);
	transition: opacity .2s, transform .2s;
}
.bcard:hover .bcard-tools, .bcard:focus-within .bcard-tools { opacity: 1; transform: none; }
.tool-btn {
	display: grid; place-items: center;
	width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: 50%;
	background: var(--white); color: var(--store-text);
	box-shadow: 0 4px 14px rgba(24, 32, 28, .14);
	transition: background-color .2s, color .2s;
}
.tool-btn:hover { background: var(--store-primary); color: var(--white); }
.tool-btn .icon { width: 18px; height: 18px; }
.bcard-out {
	position: absolute; top: 14px; inset-inline-start: 12px; z-index: 1;
	display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
	border-radius: var(--pill); background: var(--store-text); color: var(--white);
	font-size: 12px; font-weight: 700; line-height: 1;
}
/* زرّ السلّة على البطاقة: الزرّ الأصليّ للقالب، داكنٌ بعرض البطاقة ونصّه ظاهر */
.bcard .price { margin-top: auto; padding-top: 6px; }
.bcard-actions { display: flex; gap: 8px; margin-top: 12px; }
.bcard-actions .btn { height: 42px; padding: 0 14px; flex: 1; min-width: 0; }
@media (hover: none) { .bcard-tools { opacity: 1; transform: none; } }

/* شريط الثقة: صفٌّ مدمج تحت الواجهة */
.trust { padding: 22px 0; background: var(--white); border-bottom: 1px solid var(--line); }
.trust-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.trust-list li { display: flex; align-items: center; justify-content: center; gap: 14px; }
.trust-disc { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--disc); color: var(--store-primary); }
.trust-disc .icon { width: 24px; height: 24px; stroke-width: 1.5; }
.trust-list h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.trust-list p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.section-cats { padding-top: 56px; }

/* تبويبات صفّ الكتب (القاعدة 16) */
.section-head.has-tabs { flex-wrap: wrap; align-items: center; }
.row-tabs { display: flex; gap: 6px; padding: 4px; margin-inline: auto 0; background: var(--store-bg); border-radius: var(--pill); overflow-x: auto; scrollbar-width: none; }
.row-tabs::-webkit-scrollbar { display: none; }
.row-tab {
	flex: none; height: 38px; padding: 0 18px;
	border: 0; border-radius: var(--pill); background: transparent;
	font-size: 14px; font-weight: 500; color: var(--store-text); white-space: nowrap;
	transition: background-color .2s, color .2s;
}
.row-tab:hover { background: var(--white); }
.row-tab[aria-selected="true"] { background: var(--store-primary); color: var(--white); }
.section-head.has-tabs .view-all { margin-inline-start: 18px; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* فسيفساء الصور: أقصر، وفي الهاتف صورتان في كلّ صفّ */
.section-gallery { padding-top: 64px; }
.gal-item { height: 360px; }
.gal-heading { margin-bottom: 4px; }

/* الكتاب المميّز بعرضٍ محدود المدّة */
.section-spot .split { min-height: 520px; }
.split-dark { gap: 12px; padding: 88px 56px 52px; }
.split-desc { max-width: 430px; font-size: 15px; line-height: 1.8; color: rgba(255, 255, 255, .9); }
.split-price { display: flex; align-items: center; justify-content: center; gap: 12px; }
.btn-light { background: var(--white); color: var(--store-primary); }
.btn-light:hover { background: var(--store-bg); }
.countdown { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.countdown[hidden] { display: none; }
.cd-label { width: 100%; font-size: 13px; color: rgba(255, 255, 255, .86); }
.cd-unit { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); line-height: 1.15; }
.cd-unit b { font-size: 20px; font-weight: 800; }
.cd-unit small { font-size: 11px; color: rgba(255, 255, 255, .86); }

/* الدوّار الأفقيّ */
.head-tools { display: flex; align-items: center; gap: 8px; }
.head-tools .view-all { margin-inline-end: 8px; }
.rail-btn { width: 40px; height: 40px; }
.rail-btn:disabled { opacity: .4; cursor: default; }
.rail { position: relative; }
.book-rail {
	display: grid; grid-auto-flow: column;
	grid-template-columns: none;
	grid-auto-columns: calc((100% - (var(--per-row) - 1) * 24px) / var(--per-row));
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	padding-bottom: 10px; scrollbar-width: thin;
}
.book-rail > * { scroll-snap-align: start; }

/* آراء القرّاء في الرئيسيّة */
.section-reviews { background: color-mix(in srgb, var(--store-bg) 86%, var(--store-accent) 14%); }
.section-reviews .section-head { border-color: var(--line-strong); align-items: baseline; }
.section-note { font-size: 14px; color: var(--muted); }
.rv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rv-card { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 24px; background: var(--white); border-radius: var(--radius-lg); }
.rv-card blockquote { margin: 0; font-size: 15px; line-height: 1.85; }
.rv-card figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.rv-card figcaption b { display: block; font-size: 15px; line-height: 1.4; }
.rv-card figcaption small { font-size: 13px; color: var(--muted); }
body[data-show-reviews="false"] .section-reviews { display: none; }

/* صفحة التصنيف: عرض الشبكة والقائمة */
.view-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--pill); }
.view-switch button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--store-primary); color: var(--white); }
.view-switch .icon { width: 18px; height: 18px; }
.filter-sort { display: flex; align-items: center; gap: 10px; }
.book-grid.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.book-grid.is-list .bcard {
	display: grid; grid-template-columns: 130px minmax(0, 1fr);
	grid-template-rows: auto auto auto auto 1fr; column-gap: 20px; align-content: start;
	padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
}
.book-grid.is-list .bcard-media { grid-row: 1 / span 5; align-self: start; padding: 14px 12%; }
.book-grid.is-list .bcard-author { margin-top: 6px; }
.book-grid.is-list .bcard .price { margin-top: 8px; padding-top: 0; }
.book-grid.is-list .bcard-actions { align-self: start; justify-self: start; }
.book-grid.is-list .bcard-actions .btn { flex: none; padding: 0 22px; }
.book-grid.is-list .bcard-tools { opacity: 1; transform: none; }
.book-grid.is-list .bcard-tools .tool-btn { width: 34px; height: 34px; }
.filter-group .check .stars { margin-inline-start: 2px; }

/* صفحة المؤلّف: أعماله في صفٍّ أفقيّ متوازن */
.works { padding-top: 24px; }
.works .book-rail { --per-row: 5; }

/* صفحات الكتاب */
.pdp > * { min-width: 0; }
.pdp { grid-template-areas: "gal info" "about info"; grid-template-rows: auto 1fr; row-gap: 0; }
.pdp-gallery { grid-area: gal; }
.pdp-info { grid-area: info; }
.pdp > .pdp-about-block { grid-area: about; margin-top: 44px; }
.pdp-about-block .pdp-about { grid-template-columns: 1fr; gap: 24px; }
.gal-tile:only-child { grid-column: 1 / -1; padding: 44px 26%; }
.formats-box { width: 100%; }
.formats-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.format-opt {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	padding: 12px 8px; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
	text-align: center; transition: border-color .2s;
}
.format-opt:hover { border-color: var(--store-text); }
.format-opt.is-current { border-color: var(--store-primary); background: color-mix(in srgb, var(--store-bg) 70%, var(--store-primary) 6%); }
.format-opt .type-dot { width: 26px; height: 26px; box-shadow: none; }
.format-opt .type-dot .icon { width: 14px; height: 14px; }
.format-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.format-price { font-size: 13px; color: var(--muted); line-height: 1.3; }
.pdp-buttons .qty { flex: none; height: 52px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--pill); }
.pdp-buttons .qty .icon-btn { width: 40px; height: 40px; }
.pdp-buttons .qty input { width: 38px; height: 40px; border: 0; background: transparent; font-weight: 700; }
.pdp-buttons .btn-block { flex: 1; width: auto; min-width: 0; }
.pdp-buttons-2 .btn { min-width: 0; }
.pdp-perks { width: 100%; padding: 6px 18px; background: var(--store-bg); border-radius: var(--radius); }
.pdp-perks li { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; }
.pdp-perks li + li { border-top: 1px solid var(--line-strong); }
.pdp-perks .icon { width: 20px; height: 20px; color: var(--store-primary); }
.pdp-perks a { font-weight: 700; text-decoration: underline; white-space: nowrap; }

@media (max-width: 1023px) {
	.trust-list li { justify-content: flex-start; }
	.trust-list p { display: none; }
	.book-rail { --per-row: 3 !important; }
	.rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rv-grid > :nth-child(3) { display: none; }
	.split-dark { padding: 72px 36px 44px; }
	.book-grid.is-list { grid-template-columns: 1fr; }
	.works .book-rail { --per-row: 3 !important; }
	.pdp { grid-template-areas: "gal" "info" "about"; grid-template-rows: none; row-gap: 32px; }
	.pdp > .pdp-about-block { margin-top: 0; }
	.pdp-about-block .pdp-about { gap: 24px; }
}

@media (max-width: 767px) {
	.trust { padding: 12px 0; }
	.trust-list { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.trust-list::-webkit-scrollbar { display: none; }
	.trust-list li { flex: 0 0 auto; gap: 10px; padding: 8px 14px 8px 8px; padding-inline: 8px 16px; border-radius: var(--pill); background: var(--store-bg); scroll-snap-align: start; }
	.trust-disc { width: 36px; height: 36px; background: var(--white); }
	.trust-disc .icon { width: 18px; height: 18px; }
	.trust-list h3 { font-size: 14px; white-space: nowrap; }
	.section-cats { padding-top: 36px; }
	.hero { padding-bottom: 36px; }
	.hero-stage { height: 470px; --info-top: 312px; }

	.section-head.has-tabs { gap: 12px; }
	.section-head.has-tabs .view-all { margin-inline-start: auto; }
	.row-tabs { order: 3; width: 100%; margin: 0; }
	.row-tab { height: 40px; padding: 0 14px; }

	.bcard-actions { margin-top: 10px; }
	.bcard-actions .btn { font-size: 13px; padding: 0 8px; height: 40px; }
	.bcard-tools { bottom: 8px; inset-inline-start: 8px; }

	.gal-row, .gal-row-flip { grid-template-columns: 1fr 1fr; gap: 12px; }
	.gal-row + .gal-row { margin-top: 12px; }
	.gal-item { height: 210px; }
	.gal-cap { bottom: 8px; inset-inline: 8px; max-width: none; padding: 8px 12px; padding-inline: 12px 8px; border-radius: 14px; gap: 6px; justify-content: space-between; }
	.gal-cap b { font-size: 13px; }
	.gal-cap small { display: none; }

	.split-wrap .split-eyebrow { position: absolute; top: 16px; left: 0; width: 100%; color: var(--store-primary); font-weight: 700; }
	.split-light { padding: 52px 36px 32px; }
	.split-dark { padding: 32px 22px 36px; }
	.cd-unit { width: 56px; height: 56px; }
	.cd-unit b { font-size: 18px; }

	.head-tools .rail-btn { display: none; }
	.book-rail, .works .book-rail { grid-auto-columns: 46%; gap: 14px; }

	.rv-grid { display: flex; overflow-x: auto; gap: 14px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.rv-grid > * { flex: 0 0 84%; scroll-snap-align: start; }
	.rv-grid > :nth-child(3) { display: flex; }
	.section-reviews .section-head { flex-direction: column; align-items: flex-start; gap: 2px; }

	.section-blog .post-grid--feature { display: flex; overflow-x: auto; gap: 14px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.section-blog .post-grid--feature > .post-card { flex: 0 0 84%; scroll-snap-align: start; }
	.section-blog .post-grid--feature > .post-card:first-child .post-title { font-size: 19px; }
	.author-row { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.author-row > * { flex: 0 0 78%; scroll-snap-align: start; }

	.filter-sort { width: 100%; }
	.filter-sort .pill-select { flex: 1; }
	.filter-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
	.filter-pills::-webkit-scrollbar { display: none; }
	.filter-pills > * { flex: none; }
	.section-listing { padding-top: 16px; }
	.book-grid.is-list .bcard { grid-template-columns: 110px minmax(0, 1fr); column-gap: 14px; padding: 10px; }

	.gal-tile:only-child { padding: 28px 22%; }
	.pdp > * { min-width: 0; }
	.pdp-buttons { gap: 8px; }
	.pdp-buttons .qty { height: 48px; padding: 0 2px; }
	.pdp-buttons .qty .icon-btn { width: 40px; height: 40px; }
	.pdp-buttons .qty input { width: 30px; }
	.pdp-buttons .btn-block { height: 48px; padding: 0 12px; }
	.pdp-buttons .btn-block .icon { display: none; }
	.pdp-buttons .icon-btn-lg { width: 48px; height: 48px; }
	.formats-box { order: 0; }
}

/* صفوف الكتب تملأ صفوفها: لا صفّ أخير نصف فارغ حين يكون في الصفّ ثلاثة كتب أو خمسة */
@media (min-width: 768px) {
	body[data-books-per-row="3"] .book-grid:not(.listing-grid):not(.book-rail) > :nth-child(3n+1):last-child,
	body[data-books-per-row="3"] .book-grid:not(.listing-grid):not(.book-rail) > :nth-child(3n+1):nth-last-child(2),
	body[data-books-per-row="3"] .book-grid:not(.listing-grid):not(.book-rail) > :nth-child(3n+2):last-child { display: none; }
}
@media (min-width: 768px) and (max-width: 1023px) {
	.book-grid:not(.listing-grid):not(.book-rail) > :nth-child(3n+1):last-child,
	.book-grid:not(.listing-grid):not(.book-rail) > :nth-child(3n+1):nth-last-child(2),
	.book-grid:not(.listing-grid):not(.book-rail) > :nth-child(3n+2):last-child { display: none; }
}
@media (min-width: 1024px) {
	body[data-books-per-row="5"] .book-grid:not(.listing-grid):not(.book-rail) > :nth-child(n+6) { display: none; }
	body[data-books-per-row="5"] .book-grid:not(.listing-grid):not(.book-rail):has(> :nth-child(4):last-child) { --per-row: 4; }
	body[data-books-per-row="5"] .listing-grid:not(.is-list) > :nth-child(10n+1):nth-last-child(-n+4) ~ *, body[data-books-per-row="5"] .listing-grid:not(.is-list) > :nth-child(10n+1):nth-last-child(-n+4) { display: none; }
}

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