/* ==========================================================================
   ثُريّا — قالب متجر كتب لمنصّة «ناشر»
   بطلٌ ليليّ داكن بمصغّراتٍ رأسيّة، وشرائط داكنة بحوافّ محزوزة،
   وصفوف كتبٍ أفقيّة، وخطٌّ متموّج تحت العناوين.
   ألوان الهويّة متغيّرات يختارها الناشر؛ كلّ لونٍ غيرها محايد.
   ========================================================================== */

:root {
	--store-primary: #A21C5C;
	--store-primary-dark: #7D1546;
	--store-accent: #212E47;
	--store-bg: #FFFFFF;
	--store-text: #111827;

	/* محايدة */
	--night: #111827;
	--night-2: #182133;
	--muted: #4E5561;
	--line: #E4EBF1;
	--soft: #F6F8FA;
	--mist: #E4EBF1;
	--white: #FFFFFF;
	--on-dark-muted: #B9C0CD;
	--gold: #F2A900;
	--primary-on-dark: color-mix(in srgb, var(--store-primary) 38%, #FFFFFF);
	--primary-tint: color-mix(in srgb, var(--store-primary) 10%, #FFFFFF);

	--font: "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif;
	--r: 14px;
	--r-sm: 10px;
	--pill: 999px;
	--shadow: 0 8px 28px rgba(17, 24, 39, .08);
	--shadow-lg: 0 18px 50px rgba(17, 24, 39, .14);
	--container: 1240px;
	--gutter: 20px;
	--header-h: 76px;
	--notch: 46px;
}

body[data-corners="sharp"] {
	--r: 0;
	--r-sm: 0;
	--pill: 4px;
}

/* ------------------------------------------------------------- الأساس */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--store-primary); 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;
}
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--white); color: var(--night); padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: currentColor; stroke: none; }
.icon-arrow { width: 18px; height: 18px; }
.hide-sm { }
.eyebrow { display: inline-block; font-size: 14px; font-weight: 700; color: var(--store-primary); margin-bottom: 8px; }
.eyebrow.on-dark { color: var(--primary-on-dark); }

/* ------------------------------------------------------------- الأزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 22px; border-radius: var(--pill);
	border: 1.5px solid transparent; font-weight: 700; font-size: 15px; line-height: 1.2;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-sm { min-height: 38px; padding: 7px 16px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--store-primary); color: var(--white); }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-dark { background: var(--store-accent); color: var(--white); }
.btn-dark:hover { background: var(--night); }
.btn-outline { background: var(--white); color: var(--store-text); border-color: var(--line); }
.btn-outline:hover { border-color: var(--store-text); }
.btn-ghost { background: transparent; color: var(--store-text); border-color: transparent; }
.btn-ghost:hover, .btn-ghost[aria-pressed="true"] { background: var(--primary-tint); color: var(--store-primary-dark); }
.btn-glass { background: rgba(255, 255, 255, .12); color: var(--white); border-color: rgba(255, 255, 255, .28); }
.btn-glass:hover { background: rgba(255, 255, 255, .22); }
.btn-soft, .btn:disabled { background: var(--mist); color: var(--muted); border-color: var(--mist); cursor: not-allowed; transform: none; }
.icon-btn {
	position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
	border-radius: 50%; border: 0; background: transparent; color: inherit;
}
.icon-btn .count {
	position: absolute; top: 0; inset-inline-end: -2px; min-width: 19px; height: 19px; padding: 0 5px;
	border-radius: 999px; background: var(--store-primary); color: var(--white);
	font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
}
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--store-primary); }

/* ------------------------------------------------------------- الرأس */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--night); color: var(--white);
	transition: background-color .3s, box-shadow .3s;
}
/* فوق البطل: شفّاف، ثمّ داكنٌ صلب عند التمرير. إن أُخفي البطل بقي صلبًا */
.page-home:has(.hero) .site-header { position: fixed; inset-inline: 0; background: linear-gradient(to bottom, rgba(10, 14, 26, .6), rgba(10, 14, 26, 0)); }
.page-home:has(.hero) .site-header.is-solid,
.page-home:has(.hero) .site-header.search-open,
.page-home:has(.hero).drawer-open .site-header { background: var(--night); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.header-row { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }
.menu-toggle { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 42px; height: 42px; border-radius: 12px; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: 0; }
.main-nav { flex: 1; }
.main-nav > ul { display: flex; align-items: center; justify-content: center; gap: 4px; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a, .main-nav > ul > li > button {
	display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px; border: 0; background: none;
	color: var(--white); font-weight: 500; font-size: 15px; position: relative;
}
.main-nav .icon { width: 16px; height: 16px; }
.main-nav a[aria-current="page"] { color: var(--primary-on-dark); font-weight: 700; }
.main-nav a[aria-current="page"]::after {
	content: ""; position: absolute; bottom: 2px; inset-inline: 0; margin-inline: auto; width: 18px; height: 4px;
	background: radial-gradient(circle, var(--primary-on-dark) 1.6px, transparent 2px) 0 0 / 6px 4px repeat-x;
}
.drop {
	position: absolute; top: 100%; inset-inline-start: 0; min-width: 220px; padding: 10px;
	background: var(--white); color: var(--store-text); border-radius: var(--r); box-shadow: var(--shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s;
}
.has-drop:hover .drop, .has-drop:focus-within .drop, .has-drop.open .drop { opacity: 1; visibility: visible; transform: none; }
.drop a { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500; }
.drop a:hover { background: var(--soft); color: var(--store-primary); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.header-actions .btn { margin-inline-start: 4px; }
.header-search { background: var(--night-2); padding: 14px 0; }
.header-search .container { display: flex; gap: 10px; }
.header-search input {
	flex: 1; min-width: 0; height: 46px; padding: 0 18px; border-radius: var(--pill); border: 0;
	background: var(--white); color: var(--store-text);
}

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 14, 24, .55); opacity: 0; visibility: hidden; transition: .25s; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 61; width: min(330px, 86vw);
	background: var(--white); color: var(--store-text); padding: 18px; overflow-y: auto;
	transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
}
.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; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer-head .brand-name { font-size: 18px; }
.drawer-head .brand img { width: 36px; height: 36px; }
.drawer-nav { padding: 10px 0; }
.drawer-nav > li > a, .drawer-sub > span { display: block; padding: 11px 4px; font-weight: 700; border-bottom: 1px solid var(--line); }
.drawer-sub > div { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.drawer-sub > div a { padding: 5px 12px; border-radius: var(--pill); background: var(--soft); font-size: 14px; }
.drawer-phone { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border-radius: var(--r); background: var(--soft); }
.drawer-phone small { display: block; color: var(--muted); font-size: 13px; }
.drawer-phone bdi { font-weight: 700; }

/* ------------------------------------------------------------- الحافّة المحزوزة */
/* القسم الداكن يمتدّ في وسطه لسانًا مستديرًا، ويتّصل به بانحناءين مقعّرين */
.notch-b, .notch-t { position: relative; --band-color: var(--night); }
.notch-b { margin-bottom: var(--notch); }
.notch-b::after, .notch-t::before {
	content: ""; position: absolute; inset-inline: 7%; height: var(--notch);
	background: var(--band-color); z-index: 1; pointer-events: none;
}
.notch-b::after { top: calc(100% - 1px); border-radius: 0 0 var(--notch) var(--notch); }
.notch-t::before { bottom: calc(100% - 1px); border-radius: var(--notch) var(--notch) 0 0; }
.notch-b::before, .notch-t::after {
	content: ""; position: absolute; inset-inline: calc(7% - 24px); height: 24px; z-index: 1; pointer-events: none;
	background:
		radial-gradient(circle at 0 100%, transparent 23px, var(--band-color) 23.5px) left top / 24px 24px no-repeat,
		radial-gradient(circle at 100% 100%, transparent 23px, var(--band-color) 23.5px) right top / 24px 24px no-repeat;
}
.notch-b::before { top: calc(100% - 1px); }
.notch-t::after { bottom: calc(100% - 1px); transform: scaleY(-1); }
.notch-t { margin-top: var(--notch); }

/* ------------------------------------------------------------- الأقسام */
.section { padding: 76px 0; }
.section-tight { padding: 56px 0; }
.section-soft { background: var(--soft); }
.section-mist { background: var(--mist); }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.sec-title { font-size: 32px; font-weight: 800; }
.wave { display: block; width: 46px; height: 10px; margin: 8px auto 10px; fill: none; stroke: var(--store-primary); stroke-width: 2.2; stroke-linecap: round; }
.sec-sub { color: var(--muted); font-size: 16px; }
.sec-head.on-dark .sec-title { color: var(--white); }
.sec-head.on-dark .wave { stroke: var(--primary-on-dark); }
.sec-head.on-dark .sec-sub { color: var(--on-dark-muted); }
.sec-head-start { text-align: start; margin-inline: 0; }
.sec-head-start .wave { margin-inline: 0; }
.sec-more { display: flex; justify-content: center; margin-top: 34px; }

/* ------------------------------------------------------------- نوع الكتاب، التقييم، السعر */
.type-dot {
	display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
	color: var(--white); border: 2px solid var(--white); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); flex: none;
}
.type-dot .icon { width: 17px; height: 17px; }
.type-dot.sm { width: 24px; height: 24px; border-width: 1.5px; }
.type-dot.sm .icon { width: 13px; height: 13px; }
.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; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 15px; height: 15px; }
.stars .off { color: #D5DBE3; }
.rating-lg { font-size: 15px; }
.rating-lg .stars .icon { width: 19px; height: 19px; }
.price { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-weight: 800; color: var(--store-primary); }
.price del { color: var(--muted); font-weight: 500; font-size: .85em; }
.price-lg { font-size: 28px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--white); }
.badge-sale { background: var(--store-primary); }
.badge-new { background: var(--store-accent); }

/* ------------------------------------------------------------- بطاقة الكتاب */
.book-grid {
	--cols: 4;
	display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 24px;
}
body[data-books-per-row="3"] .book-grid { --cols: 3; }
body[data-books-per-row="5"] .book-grid { --cols: 5; }
body[data-books-per-row="6"] .book-grid { --cols: 6; }
.book-card {
	position: relative; display: flex; flex-direction: column; background: var(--white);
	border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: 0 2px 10px rgba(17, 24, 39, .04);
	transition: box-shadow .25s, transform .25s;
}
.book-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.book-media { position: relative; aspect-ratio: 2 / 3; background: var(--soft); overflow: hidden; }
.book-media > a, .book-media img { display: block; width: 100%; height: 100%; }
.book-media img { object-fit: cover; transition: transform .5s; }
.book-card:hover .book-media img { transform: scale(1.04); }
.book-media .type-dot { position: absolute; top: 10px; inset-inline-start: 10px; }
.book-badges { position: absolute; top: 12px; inset-inline-end: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.book-media .wish {
	position: absolute; bottom: 10px; inset-inline-end: 10px; width: 38px; height: 38px;
	background: var(--white); color: var(--store-text); box-shadow: var(--shadow);
	opacity: 0; transform: translateY(6px); transition: .2s;
}
.book-card:hover .wish, .book-card:focus-within .wish { opacity: 1; transform: none; }
@media (hover: none) { .book-media .wish { opacity: 1; transform: none; } }
.wish[aria-pressed="true"] { color: var(--store-primary); }
.wish[aria-pressed="true"] .icon { fill: currentColor; }
.stock-band {
	position: absolute; inset-inline: 0; bottom: 0; padding: 7px; text-align: center;
	background: rgba(17, 24, 39, .86); color: var(--white); font-size: 13px; font-weight: 700;
}
.is-out .book-media img { filter: grayscale(.7); }
.book-body { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 14px 16px; text-align: center; flex: 1; }
.book-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.book-title a:hover { color: var(--store-primary); }
.book-author { color: var(--muted); font-size: 14px; }
.book-foot { margin: 4px 0 10px; }
.book-body > .btn { margin-top: auto; }

/* شكل البطاقة */
body[data-card-style="framed"] .book-card { border: 1.5px solid var(--store-text); box-shadow: none; padding: 8px; }
body[data-card-style="framed"] .book-media { border-radius: calc(var(--r) - 6px); }
body[data-card-style="minimal"] .book-card { border: 0; background: transparent; box-shadow: none; overflow: visible; }
body[data-card-style="minimal"] .book-media { border-radius: var(--r); box-shadow: var(--shadow); }
body[data-card-style="minimal"] .book-card:hover { transform: none; }
body[data-card-style="minimal"] .book-body { padding-inline: 4px; }

/* البطاقة المختصرة (شاهدتَه مؤخّرًا) */
.recent-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.recent-row .book-card { scroll-snap-align: start; }
.book-card.is-compact .book-body { padding: 10px; gap: 2px; }
.book-card.is-compact .book-title { font-size: 14px; }
.book-card.is-compact .price { font-size: 14px; }
.book-card.is-compact .type-dot { width: 28px; height: 28px; }
.book-card.is-compact .type-dot .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------- الصفّ الأفقيّ (علامة القالب) */
.row-list { display: flex; flex-direction: column; gap: 14px; }
.book-row {
	display: grid; grid-template-columns: 64px minmax(0, 1.3fr) minmax(110px, 1fr) auto auto; align-items: center; gap: 18px;
	padding: 14px 18px 14px 14px; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow);
	transition: box-shadow .25s, transform .25s;
}
.book-row:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.row-cover { position: relative; display: block; width: 64px; aspect-ratio: 2 / 3; border-radius: 8px; overflow: visible; }
.row-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.row-cover .type-dot { position: absolute; top: -6px; inset-inline-start: -6px; }
.row-main .book-title { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-main .book-author { font-size: 14px; }
.row-line { position: relative; display: flex; justify-content: center; }
.row-line::before {
	content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 1.5px dashed #C9D1DC;
}
.row-line::after {
	content: ""; position: absolute; inset-inline: -3px; top: calc(50% - 3.5px); height: 7px;
	background: radial-gradient(circle, #C9D1DC 3px, transparent 3.5px) 0 0 / 7px 7px no-repeat, radial-gradient(circle, #C9D1DC 3px, transparent 3.5px) 100% 0 / 7px 7px no-repeat;
}
.row-line .rating { position: relative; z-index: 1; background: var(--white); padding: 2px 8px; }
.row-price { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.row-price .price { font-size: 18px; justify-content: flex-end; }
.row-price small { color: var(--muted); font-size: 12px; }
.row-out { display: inline-block; padding: 7px 14px; border-radius: var(--pill); background: var(--mist); color: var(--muted); font-size: 13px; font-weight: 700; }
.book-row.is-out .row-cover img { filter: grayscale(.7); }

/* ------------------------------------------------------------- البطل */
.hero { --band-color: var(--night); position: relative; background: var(--night); color: var(--white); }
.hero-slides { position: relative; height: 660px; overflow: hidden; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s, visibility .8s; }
.slide.is-active { opacity: 1; visibility: visible; }
html:not(.js) .slide:first-child { opacity: 1; visibility: visible; }
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(10, 14, 26, .78), rgba(10, 14, 26, .25) 60%, rgba(10, 14, 26, .1)); }
.slide-inner { position: relative; z-index: 1; height: 100%; display: flex; align-items: center; padding-top: calc(var(--header-h) - 10px); padding-bottom: 60px; }
.slide-copy { max-width: 600px; }
.slide-title { font-size: 50px; font-weight: 800; line-height: 1.25; color: var(--white); }
.slide-title em { font-style: normal; color: var(--primary-on-dark); display: inline; }
.slide-copy p { margin-top: 16px; font-size: 18px; color: #E3E7EE; max-width: 520px; }
.slide-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-thumbs-wrap { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: flex-end; padding-top: var(--header-h); padding-bottom: 60px; }
.hero-thumbs { display: flex; flex-direction: column; gap: 14px; pointer-events: auto; z-index: 2; }
.hero-thumbs button {
	width: 168px; aspect-ratio: 16 / 9; padding: 0; border-radius: 6px; overflow: hidden;
	border: 3px solid var(--white); background: var(--night-2); transition: border-color .25s, transform .25s, box-shadow .25s;
}
.hero-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumbs button[aria-current="true"] { border-color: var(--store-primary); transform: translateX(-8px); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
.hero-thumbs button:hover { transform: translateX(-4px); }

/* صندوق البحث الراكب */
.finder { position: relative; z-index: 3; padding: 34px 0; background: var(--soft); }
.hero + .finder { background: transparent; padding: 0; margin-top: calc(-1 * var(--notch) - 92px); }
.finder-card { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 18px 20px 20px; border: 1px solid var(--line); }
.finder-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.finder-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--pill); border: 1px solid var(--line); color: var(--store-text); font-weight: 500; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #B7C0CC; }
.tag:hover { border-color: var(--store-primary); color: var(--store-primary); }
.tag:hover::before { border-color: var(--store-primary); background: var(--store-primary); }
.finder-note { font-weight: 700; font-size: 15px; }
.finder-fields { display: flex; gap: 12px; align-items: stretch; }
.field-box { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 200px; }
.field-box.grow { flex: 1; }
.field-box small { font-size: 13px; color: var(--muted); }
.field-box input, .field-box select { border: 0; padding: 0; background: transparent; font-size: 17px; font-weight: 700; outline: none; width: 100%; }
.field-box:focus-within { border-color: var(--store-primary); }
.finder-btn { min-width: 128px; border-radius: var(--r-sm); min-height: 64px; }
.field-box input::placeholder { color: #6B7280; font-weight: 500; }

/* ------------------------------------------------------------- التصنيفات */
.dest-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
.dest-card { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--white); border: 1px solid var(--line); transition: box-shadow .25s, transform .25s; }
.dest-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.dest-media { display: block; aspect-ratio: 5 / 6; overflow: hidden; }
.dest-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.dest-card:hover .dest-media img { transform: scale(1.06); }
.dest-body { display: block; text-align: center; padding: 14px 10px 16px; }
.dest-body h3 { font-size: 19px; font-weight: 700; }
.dest-body > span { color: var(--muted); font-size: 14px; }
.dest-grid.kit-dest { grid-template-columns: repeat(auto-fill, minmax(160px, 240px)); }
.kit-dest .dest-card { grid-column: auto !important; }

/* ------------------------------------------------------------- شريط الثقة */
.trust { padding: 44px 0 52px; }
.trust-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust-item { position: relative; text-align: center; padding: 18px 16px; overflow: hidden; }
.trust-item + .trust-item { border-inline-start: 1px solid var(--line); }
.trust-ghost { position: absolute; top: 50%; left: 50%; width: 92px; height: 92px; transform: translate(-50%, -58%); color: #D9DFE7; stroke-width: 1.3; z-index: 0; }
.trust-item h3, .trust-item p { position: relative; z-index: 1; }
.trust-item h3 { font-size: 18px; font-weight: 800; }
.trust-item p { color: var(--muted); font-size: 14px; margin-top: 4px; }
body[data-show-trust-bar="false"] .trust { display: none; }

/* ------------------------------------------------------------- عن المكتبة */
.about-row { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.about-media { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; aspect-ratio: 1 / 1.02; }
.about-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); }
.about-media img:first-child { object-position: 100% 50%; }
.about-media img:nth-child(2) { object-position: 0 50%; }
.about-badge {
	position: absolute; top: 9%; left: 50%; transform: translateX(-50%); width: 110px; padding: 16px 10px; text-align: center;
	background: var(--store-primary); color: var(--white); border: 3px solid var(--white); border-radius: 18px 18px 18px 40px;
	font-weight: 800; font-size: 16px; line-height: 1.4; box-shadow: var(--shadow-lg);
}
.about-badge:empty { display: none; }
.about-copy h2 { font-size: 30px; margin-bottom: 14px; }
.about-copy p { color: var(--muted); margin-bottom: 24px; }

/* ------------------------------------------------------------- شريط العبارات */
.marquee { background: var(--store-primary); color: var(--white); overflow: hidden; padding: 15px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track:empty, .marquee:has(.marquee-track:empty) { display: none; }
.mq-item { display: inline-flex; align-items: center; gap: 22px; padding-inline-end: 22px; font-size: 19px; font-weight: 700; white-space: nowrap; }
.mq-item .icon { width: 22px; height: 22px; fill: currentColor; stroke: none; }
@keyframes marquee { to { transform: translateX(50%); } }

/* ------------------------------------------------------------- الأكثر مبيعًا */
.best-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 26px; align-items: stretch; }
.best-layout:not(:has(.tall-banner)) { grid-template-columns: 1fr; }
.tall-banner { position: relative; display: block; border-radius: var(--r); overflow: hidden; min-height: 420px; }
.tall-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.tall-banner:hover img { transform: scale(1.04); }
.tall-caption {
	position: absolute; inset-inline: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 4px;
	padding: 16px 18px; background: var(--white); border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
}
.tall-caption b { font-size: 19px; }
.tall-caption > span:not(.link-arrow) { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------- مختارات الدار (الشريط الداكن) */
.band { --band-color: var(--night); position: relative; background: var(--night); color: var(--white); padding: 84px 0 140px; overflow: visible; }
.band-bg { position: absolute; inset: 0; overflow: hidden; }
.band-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.band-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(17, 24, 39, .55), rgba(17, 24, 39, .7) 55%, var(--night)); }
.band-inner { position: relative; z-index: 2; }
.band-word {
	position: absolute; inset-inline: 0; bottom: 6px; z-index: 1; overflow: hidden; text-align: center; white-space: nowrap;
	font-size: 150px; font-weight: 800; line-height: 1; color: rgba(255, 255, 255, .07); pointer-events: none;
}
.band .book-grid { --cols: 4; }

/* ------------------------------------------------------------- رقائق الأقسام */
.chip-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.chip-card {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--white); border-radius: var(--r-sm);
	box-shadow: 0 4px 18px rgba(17, 24, 39, .07); font-weight: 700; font-size: 15px; transition: box-shadow .2s, color .2s;
}
.chip-card:hover { color: var(--store-primary); box-shadow: var(--shadow-lg); }
.chip-card img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }

/* ------------------------------------------------------------- الآراء */
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.review-card { position: relative; background: var(--white); border-radius: var(--r); padding: 26px 24px 22px; text-align: center; box-shadow: var(--shadow); }
.review-card p { color: var(--muted); margin: 12px 0 16px; }
.review-who { display: inline-flex; align-items: center; gap: 10px; text-align: start; }
.review-who small { display: block; color: var(--muted); font-size: 13px; }
.review-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--store-accent); color: var(--white); font-weight: 800; }
.review-quote { position: absolute; bottom: 14px; inset-inline-end: 16px; width: 30px; height: 30px; color: #D5DBE3; stroke-width: 2; }
body[data-show-reviews="false"] .reviews-home,
body[data-show-reviews="false"] .reviews-block { display: none; }

/* ------------------------------------------------------------- المؤلّفون */
.author-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.author-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: box-shadow .25s, transform .25s; }
.author-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.author-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.author-media img { width: 100%; height: 100%; object-fit: cover; }
.author-tag { position: absolute; bottom: 12px; inset-inline-start: 12px; padding: 3px 10px; border-radius: 6px; background: var(--store-primary); color: var(--white); font-size: 13px; font-weight: 700; }
.author-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.author-body h3 { font-size: 19px; }
.author-bio { color: var(--muted); font-size: 14px; }
.author-body .link-arrow { margin-top: 2px; font-size: 14px; }

/* ------------------------------------------------------------- النشرة والتذييل */
.newsletter { --band-color: var(--night); background: var(--night); color: var(--white); padding: 34px 0 44px; }
.newsletter-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.newsletter h2 { font-size: 28px; }
.newsletter p { color: var(--on-dark-muted); margin-top: 4px; }
.nl-field { display: flex; align-items: center; gap: 8px; flex: 0 1 470px; background: var(--white); color: var(--store-text); border-radius: var(--pill); padding: 6px; padding-inline-start: 18px; }
.nl-field input { flex: 1; min-width: 0; border: 0; background: transparent; height: 40px; outline: none; }
.nl-field .icon { color: var(--muted); }
.site-footer { background: var(--night); color: var(--on-dark-muted); border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 54px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-about p { margin: 14px 0 18px; max-width: 360px; }
.site-footer .brand { color: var(--white); }
.site-footer h3 { color: var(--white); font-size: 17px; margin-bottom: 14px; }
.footer-col li { margin-bottom: 9px; }
.footer-col a:hover, .footer-links a:hover { color: var(--white); }
.footer-contact li { display: flex; align-items: center; gap: 10px; }
.footer-contact .icon { color: var(--primary-on-dark); width: 18px; height: 18px; }
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--white); transition: background-color .2s; }
.social a:hover { background: var(--store-primary); }
.social .icon { width: 18px; height: 18px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 14px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------- رؤوس الصفحات الداخليّة */
.page-head {
	--band-color: var(--night); position: relative; background-color: var(--night); color: var(--white); padding: 34px 0 40px;
	background-image: radial-gradient(1.2px 1.2px at 12% 30%, rgba(255, 255, 255, .7), transparent), radial-gradient(1px 1px at 28% 70%, rgba(255, 255, 255, .5), transparent),
		radial-gradient(1.4px 1.4px at 46% 22%, rgba(255, 255, 255, .6), transparent), radial-gradient(1px 1px at 64% 58%, rgba(255, 255, 255, .5), transparent),
		radial-gradient(1.3px 1.3px at 82% 34%, rgba(255, 255, 255, .7), transparent), radial-gradient(1px 1px at 92% 76%, rgba(255, 255, 255, .5), transparent);
}
.page-head .container { position: relative; z-index: 2; }
.page-head h1 { font-size: 38px; margin-top: 6px; }
.page-head p { color: var(--on-dark-muted); margin-top: 8px; max-width: 640px; }
.page-head-sm { padding: 18px 0 6px; }
.head-img { position: absolute; inset-block: 0; inset-inline-end: 0; width: 34%; height: 100%; object-fit: cover; opacity: .28; -webkit-mask-image: linear-gradient(to left, #000 30%, transparent); mask-image: linear-gradient(to left, #000 30%, transparent); }
.head-count { font-weight: 700; color: var(--white) !important; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--on-dark-muted); padding: 0; margin: 0; list-style: none; }
.breadcrumb li + li::before { content: "‹"; margin-inline-end: 6px; }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb [aria-current] { color: var(--white); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: var(--r-sm); background: var(--white); color: var(--store-text); font-weight: 700; font-size: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.chip[aria-current="page"] { background: var(--store-primary); color: var(--white); }
.chip:hover { color: var(--store-primary); }
.chip[aria-current="page"]:hover { color: var(--white); }
.head-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 7px 16px; border-radius: var(--pill); background: rgba(255, 255, 255, .1); color: var(--white); font-weight: 700; font-size: 14px; }

/* ------------------------------------------------------------- قائمة التصنيف */
.listing { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 30px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.filters-head h2 { font-size: 19px; }
.filters-head .icon-btn { display: none; }
.filter-box { padding: 14px 0; border-bottom: 1px solid var(--line); }
.filter-box:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.filter-box h3 { font-size: 15px; margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 15px; cursor: pointer; }
.check input { accent-color: var(--store-primary); width: 17px; height: 17px; }
.check .count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.price-range { display: flex; gap: 8px; }
.field { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }
.field:focus { outline: none; border-color: var(--store-primary); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; padding: 10px 14px; background: var(--soft); border-radius: var(--r); }
.toolbar p { color: var(--muted); }
.toolbar b { color: var(--store-text); }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.toolbar-actions .field { width: auto; min-width: 170px; }
.filters-toggle { display: none; }
.view-switch { display: flex; gap: 2px; background: var(--white); border: 1px solid var(--line); border-radius: var(--pill); padding: 2px; }
.view-switch .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.view-switch .icon-btn[aria-pressed="true"] { background: var(--store-accent); color: var(--white); }
.listing-grid { --cols: 3; }
body[data-books-per-row="4"] .listing-grid, body[data-books-per-row="5"] .listing-grid, body[data-books-per-row="6"] .listing-grid { --cols: 4; }
body[data-books-per-row="3"] .listing-grid { --cols: 3; }
/* عرض القائمة: البطاقة تصير صفًّا أفقيًّا */
.listing-grid.as-list { grid-template-columns: 1fr; gap: 14px; }
.as-list .book-card { flex-direction: row; align-items: center; gap: 16px; padding: 12px; box-shadow: var(--shadow); border-color: transparent; }
.as-list .book-media { width: 84px; flex: none; border-radius: 8px; }
.as-list .book-media .wish, .as-list .book-badges { display: none; }
.as-list .book-media .type-dot { width: 26px; height: 26px; top: 4px; inset-inline-start: 4px; }
.as-list .stock-band { font-size: 11px; padding: 3px; }
.as-list .book-body { flex-direction: row; flex-wrap: wrap; align-items: center; text-align: start; gap: 4px 18px; padding: 0; }
.as-list .book-title { flex: 1 1 100%; }
.as-list .book-author { flex: 1 1 auto; }
.as-list .book-foot { margin: 0; }
.as-list .book-body > .btn { width: auto; margin-top: 0; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 6px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; background: var(--white); }
.pagination a:hover { border-color: var(--store-primary); color: var(--store-primary); }
.pagination [aria-current="page"] { background: var(--store-primary); color: var(--white); border-color: var(--store-primary); }
.pagination .gap { border: 0; background: none; }
.pagination .icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------- صفحة الكتاب */
.pdp-section { padding-top: 34px; }
.pdp { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.gallery { display: flex; gap: 14px; }
.gallery-main { position: relative; flex: 1; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--soft); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .type-dot { position: absolute; top: 12px; inset-inline-start: 12px; width: 40px; height: 40px; }
.gallery-main .type-dot .icon { width: 20px; height: 20px; }
.thumbs { display: flex; flex-direction: column; gap: 12px; width: 76px; flex: none; }
.thumbs button { padding: 0; border: 3px solid var(--white); border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; box-shadow: var(--shadow); background: var(--soft); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-type { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); }
.pdp-info h1 { font-size: 36px; margin: 8px 0 6px; }
.pdp-author { color: var(--muted); margin-bottom: 10px; }
.pdp-author a { color: var(--store-primary); font-weight: 700; }
.pdp-lead { margin: 18px 0 22px; color: #343B47; font-size: 17px; }
.pdp-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.meta-item { padding: 12px 14px; background: var(--soft); border-radius: var(--r-sm); border-inline-start: 3px solid var(--store-primary); }
.meta-item small { display: block; color: var(--muted); font-size: 13px; }
.meta-item b { font-size: 15px; }
.buy-card { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.buy-price { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: #1F7A4D; font-weight: 700; font-size: 14px; }
.stock .icon { width: 18px; height: 18px; }
.buy-perks { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.buy-perks li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.buy-perks .icon { color: var(--store-primary); }
.pdp-details { display: grid; gap: 22px; margin-top: 46px; }
.detail-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; }
.detail-card > h2, .reviews-top h2 { font-size: 22px; margin-bottom: 14px; position: relative; padding-inline-start: 14px; }
.detail-card > h2::before, .reviews-top h2::before { content: ""; position: absolute; inset-inline-start: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--store-primary); }
.prose p + p { margin-top: 12px; }
.prose { color: #343B47; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.spec-table th { width: 34%; color: var(--muted); font-weight: 500; }
.spec-table tr:nth-child(odd) { background: var(--soft); }
.reviews-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.reviews-top h2 { margin-bottom: 0; }
.reviews-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.reviews-summary { padding: 20px; background: var(--soft); border-radius: var(--r); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reviews-summary strong { font-size: 44px; line-height: 1; }
.reviews-summary > span:last-of-type { color: var(--muted); font-size: 14px; }
.rating-bars { width: 100%; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.rating-bars li { display: grid; grid-template-columns: 14px 1fr 36px; gap: 8px; align-items: center; }
.bar { height: 7px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.review-list { display: grid; gap: 14px; }
.review-list .review-card { text-align: start; box-shadow: none; border: 1px solid var(--line); }
.review-form { margin-top: 22px; padding: 20px; border: 1.5px dashed #C9D1DC; border-radius: var(--r); display: grid; gap: 10px; }
.review-form h3 { font-size: 18px; }
.review-note { color: var(--muted); font-size: 14px; }
.rate-pick { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.rate-pick label { cursor: pointer; color: #D5DBE3; }
.rate-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate-pick .icon { width: 26px; height: 26px; }
.rate-pick label:has(input:checked), .rate-pick label:has(input:checked) ~ label, .rate-pick label:hover, .rate-pick label:hover ~ label { color: var(--gold); }
.rate-pick label:has(input:focus-visible) { outline: 2px solid var(--store-primary); border-radius: 4px; }
.review-form textarea { resize: vertical; min-height: 90px; }
.review-form .btn { justify-self: start; }

/* ------------------------------------------------------------- المؤلّف */
.author-head { padding: 40px 0 46px; }
.author-hero { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; align-items: center; }
.author-hero > img { width: 210px; height: 210px; border-radius: 50%; object-fit: cover; border: 5px solid rgba(255, 255, 255, .14); }
.author-hero p { max-width: 720px; }

/* ------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 30px; align-items: start; }
.cart-list { display: flex; flex-direction: column; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto 110px 42px; align-items: center; gap: 18px; padding: 14px 18px 14px 14px; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); }
.cart-item .row-cover { width: 70px; }
.cart-item .price { font-size: 15px; margin-top: 2px; }
.item-total { text-align: end; font-size: 17px; }
.cart-remove { color: var(--muted); }
.cart-remove:hover { color: var(--store-primary); background: var(--primary-tint); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); overflow: hidden; }
.qty button { width: 36px; height: 38px; border: 0; background: var(--soft); font-size: 18px; font-weight: 700; }
.qty input { width: 44px; height: 38px; border: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-under { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.empty-cart { text-align: center; padding: 50px 20px; background: var(--soft); border-radius: var(--r); }
.empty-icon { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: var(--white); color: var(--store-primary); margin-bottom: 12px; }
.empty-cart h2 { font-size: 24px; }
.empty-cart p { color: var(--muted); margin: 6px 0 18px; }
.summary { position: sticky; top: calc(var(--header-h) + 16px); background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 12px; }
.summary h2 { font-size: 21px; }
.coupon { display: flex; gap: 8px; }
.coupon-applied { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--primary-tint); color: var(--store-primary-dark); font-size: 14px; }
.coupon-applied button { border: 0; background: none; color: var(--store-primary-dark); font-weight: 700; text-decoration: underline; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.summary-row b, .summary-row span:last-child { color: var(--store-text); }
.summary-total { padding-top: 12px; border-top: 1px dashed #C9D1DC; font-size: 20px; font-weight: 800; }
.summary-total span:last-child { color: var(--store-primary); }
.note { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--muted); font-size: 13px; }
.note .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------- 404 */
.nf { --band-color: var(--night); background: var(--night); color: var(--white); padding: 70px 0 80px; }
.nf-inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.nf-ghost { font-size: 240px; font-weight: 800; line-height: .9; color: rgba(255, 255, 255, .07); letter-spacing: 6px; }
.nf-stars { position: absolute; top: 60px; color: var(--primary-on-dark); }
.nf-stars .icon { width: 46px; height: 46px; fill: currentColor; stroke: none; }
.nf h1 { font-size: 36px; margin-top: -90px; }
.nf p { color: var(--on-dark-muted); max-width: 540px; }
.nf-search { display: flex; gap: 8px; width: min(560px, 100%); background: var(--white); border-radius: var(--pill); padding: 6px; margin: 8px 0; }
.nf-search input { flex: 1; min-width: 0; border: 0; padding: 0 16px; background: transparent; color: var(--store-text); outline: none; }

/* ------------------------------------------------------------- components.html */
.kit-block { padding: 50px 0; border-bottom: 1px solid var(--line); }
.kit-title { font-size: 24px; margin-bottom: 6px; }
.kit-note { color: var(--muted); margin-bottom: 22px; }
.kit-note code { background: var(--mist); color: var(--store-text); padding: 1px 6px; border-radius: 4px; font-size: 14px; }
.kit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kit-label { font-weight: 700; min-width: 110px; }
.kit-dark { color: var(--white); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px; border-radius: var(--r); background: var(--night); }
.kit-dark-head { background: var(--night); border-radius: var(--r); padding: 26px; max-width: none; }
.kit-types { display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 22px; }
.kit-types figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; }
.kit-notch { background: var(--night); color: var(--white); padding: 30px; border-radius: var(--r) var(--r) 0 0; }
.kit-notch-t { background: var(--night); color: var(--white); padding: 30px; border-radius: 0 0 var(--r) var(--r); margin-top: 110px; }
.kit-notch p, .kit-notch-t p { color: var(--on-dark-muted); }
.page-kit .trust { padding: 0; }
.page-kit .marquee { margin-top: 20px; border-radius: var(--r); }

/* ------------------------------------------------------------- الحركة عند الظهور */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
	.js .reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- الجهاز اللوحيّ */
@media (max-width: 1180px) {
	.main-nav > ul > li > a, .main-nav > ul > li > button { padding: 10px 8px; font-size: 14px; }
	.hide-md { display: none; }
	.pdp { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
	.buy-card { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.buy-card .buy-price, .buy-card .stock, .buy-card .buy-perks { grid-column: 1 / -1; }
	body[data-books-per-row="5"] .book-grid, body[data-books-per-row="6"] .book-grid { --cols: 4; }
}
@media (max-width: 991px) {
	:root { --header-h: 66px; --notch: 34px; }
	.main-nav { display: none; }
	.menu-toggle { display: inline-grid; margin-inline-start: -8px; }
	.brand-name { font-size: 19px; }
	.section { padding: 60px 0; }
	.sec-title { font-size: 27px; }
	.book-grid, body[data-books-per-row] .book-grid { --cols: 3; gap: 18px; }
	.dest-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.dest-card { grid-column: span 2; }
	.dest-card:nth-child(n+4) { grid-column: span 3; }
	.dest-card:nth-child(n+4) .dest-media { aspect-ratio: 4 / 3; }
	.hero-thumbs-wrap { align-items: flex-end; padding-bottom: calc(var(--notch) + 120px); }
	.hero-thumbs { flex-direction: row; gap: 10px; }
	.hero-thumbs button[aria-current="true"], .hero-thumbs button:hover { transform: translateY(-4px); }
	.chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.review-grid { grid-template-columns: 1fr 1fr; }
	.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.trust-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
	.trust-item:nth-child(3) { border-inline-start: 0; }
	.about-row { grid-template-columns: 1fr; gap: 36px; }
	.about-media { max-width: 560px; }
	.best-layout { grid-template-columns: 1fr; }
	.tall-banner { min-height: 0; aspect-ratio: 16 / 10; }
	.slide-title { font-size: 40px; }
	.hero-slides { height: 600px; }
	.hero-thumbs button { width: 104px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.listing { grid-template-columns: 1fr; }
	.filters {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 61; width: min(330px, 88vw); border-radius: 0;
		overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
	}
	.filters-open .filters { transform: none; visibility: visible; }
	.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
	.filters-head .icon-btn, .filters-toggle { display: inline-flex; }
	.listing-grid, body[data-books-per-row] .listing-grid { --cols: 3; }
	.reviews-layout { grid-template-columns: 1fr; }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.band-word { font-size: 96px; }
}

/* ------------------------------------------------------------- الهاتف */
@media (max-width: 640px) {
	:root { --gutter: 16px; --notch: 26px; }
	.hide-sm { display: none !important; }
	.header-row { gap: 8px; }
	.header-actions { gap: 0; }
	.brand img { width: 36px; height: 36px; }
	.brand-name { font-size: 17px; }
	.section { padding: 48px 0; }
	.section-tight { padding: 40px 0; }
	.sec-head { margin-bottom: 26px; }
	.sec-title { font-size: 23px; }
	.book-grid, body[data-books-per-row] .book-grid, .listing-grid, body[data-books-per-row] .listing-grid, .band .book-grid { --cols: 2; gap: 12px; }
	.book-body { padding: 10px 8px 12px; }
	.book-title { font-size: 14px; }
	.book-author { font-size: 13px; }
	.book-body .rating-count { display: none; }
	.book-body > .btn { font-size: 13px; padding-inline: 8px; gap: 4px; }
	.book-body > .btn .icon { display: none; }
	.type-dot { width: 30px; height: 30px; }
	.type-dot .icon { width: 15px; height: 15px; }

	.hero-slides { height: 560px; }
	.slide::after { background: linear-gradient(to top, rgba(10, 14, 26, .9), rgba(10, 14, 26, .45) 65%, rgba(10, 14, 26, .3)); }
	.slide-inner { align-items: flex-start; padding-top: calc(var(--header-h) + 34px); }
	.slide-title { font-size: 30px; }
	.slide-copy p { font-size: 16px; margin-top: 10px; }
	.slide-cta { margin-top: 20px; }
	.slide-cta .btn-lg { min-height: 46px; padding: 10px 20px; font-size: 15px; }
	.hero-thumbs-wrap { align-items: flex-end; justify-content: flex-start; padding-bottom: calc(var(--notch) + 132px); }
	.hero-thumbs { flex-direction: row; gap: 8px; }
	.hero-thumbs button { width: 72px; border-width: 2px; }
	.hero-thumbs button[aria-current="true"], .hero-thumbs button:hover { transform: translateY(-4px); }
	.hero + .finder { margin-top: calc(-1 * var(--notch) - 100px); }
	.finder-card { padding: 14px; }
	.finder-note { display: none; }
	.finder-fields { flex-direction: column; gap: 10px; }
	.field-box { min-width: 0; }
	.finder-btn { min-height: 50px; }

	.dest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.dest-card, .dest-card:nth-child(n+4) { grid-column: auto; }
	.dest-card:nth-child(4) .dest-media { aspect-ratio: 5 / 6; }
	.dest-card:nth-child(5) { grid-column: 1 / -1; }
	.dest-card:nth-child(5) .dest-media { aspect-ratio: 16 / 9; }
	.dest-body h3 { font-size: 16px; }
	.trust-row { grid-template-columns: 1fr 1fr; }
	.trust-item { padding: 14px 8px; }
	.trust-item h3 { font-size: 15px; }
	.trust-item p { font-size: 13px; }
	.trust-ghost { width: 64px; height: 64px; }
	.about-copy h2 { font-size: 23px; }
	.about-badge { width: 92px; font-size: 14px; padding: 12px 8px; }
	.mq-item { font-size: 16px; }

	.book-row { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "cover main main" "cover price action"; gap: 6px 12px; padding: 12px; }
	.book-row .row-cover { grid-area: cover; width: 56px; align-self: start; }
	.book-row .row-main { grid-area: main; }
	.book-row .row-line { display: none; }
	.book-row .row-price { grid-area: price; align-items: flex-start; text-align: start; }
	.book-row .row-price .price { font-size: 16px; justify-content: flex-start; }
	.book-row .row-action { grid-area: action; }
	.book-row .row-action .btn span { display: none; }
	.book-row .row-action .btn { width: 40px; min-height: 40px; padding: 0; }
	.row-main .book-title { font-size: 15px; }

	.band { padding: 56px 0 90px; }
	.band-word { font-size: 60px; }
	.chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.chip-card { font-size: 14px; padding: 8px 10px; }
	.review-grid { grid-template-columns: 1fr; }
	.author-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.author-body { padding: 12px; }
	.author-body h3 { font-size: 16px; }
	.author-bio { display: none; }
	.newsletter h2 { font-size: 22px; }
	.nl-field { flex-basis: 100%; }
	.footer-grid { grid-template-columns: 1fr; gap: 26px; }

	.page-head h1 { font-size: 28px; }
	.head-img { width: 60%; }
	.toolbar-actions .field { min-width: 0; width: 140px; }
	.toolbar { padding: 10px; }
	.view-switch { display: none; }
	.pdp { grid-template-columns: 1fr; gap: 24px; }
	.gallery { max-width: 340px; margin-inline: auto; width: 100%; }
	.thumbs { width: 60px; }
	.pdp-info h1 { font-size: 27px; }
	.pdp-meta { grid-template-columns: 1fr 1fr; }
	.buy-card { grid-template-columns: 1fr; }
	.detail-card { padding: 20px 16px; }
	.reviews-top { flex-wrap: wrap; }
	.author-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 18px; }
	.author-hero > img { width: 150px; height: 150px; }
	.author-hero .breadcrumb { justify-content: center; }
	.cart-item { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "cover main remove" "cover qty total"; gap: 8px 12px; padding: 12px; }
	.cart-item .row-cover { grid-area: cover; width: 56px; align-self: start; }
	.cart-item .row-main { grid-area: main; }
	.cart-item .qty { grid-area: qty; justify-self: start; }
	.cart-item .item-total { grid-area: total; }
	.cart-item .cart-remove { grid-area: remove; align-self: start; }
	.nf-ghost { font-size: 130px; }
	.nf h1 { font-size: 25px; margin-top: -50px; }
	.kit-label { min-width: 0; flex: 1 1 100%; }
}

/* البطاقة البسيطة على الشريط الداكن: نصٌّ فاتح */
body[data-card-style="minimal"] .band .book-title { color: var(--white); }
body[data-card-style="minimal"] .band .book-author,
body[data-card-style="minimal"] .band .rating { color: var(--on-dark-muted); }
body[data-card-style="minimal"] .band .price { color: var(--primary-on-dark); }
body[data-card-style="minimal"] .band .price del { color: var(--on-dark-muted); }
body[data-card-style="framed"] .band .book-card { border-color: transparent; }
.book-card, .book-row, .dest-card, .author-card, .chip-card, .review-card, .finder-card, .cart-item { color: var(--store-text); }

/* ---------------------------------------------------------------- ميزات المنصّة */
/* المدوّنة: بطاقةٌ بيضاء كبطاقة المؤلّف، صورةٌ أعلاها وعليها التاريخ في شارةٍ حمراء */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--store-text); transition: box-shadow .25s, transform .25s; }
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.post-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--soft); }
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-tag { position: absolute; bottom: 12px; inset-inline-start: 12px; padding: 3px 10px; border-radius: 6px; background: var(--store-primary); color: var(--white); font-size: 13px; font-weight: 700; }
.post-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.post-body h3, .post-body h2 { font-size: 18px; line-height: 1.45; }
.post-excerpt { color: var(--muted); font-size: 14px; }
.post-body .link-arrow { margin-top: 2px; font-size: 14px; }
.posts-more { text-align: center; margin-top: 30px; }
.blog-grid { row-gap: 26px; }
.post { max-width: 940px; }
.post-hero { margin: 0; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--soft); }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }
.post-content { max-width: 740px; margin: 34px auto 0; font-size: 17px; line-height: 2; }
.post-content p { margin: 0; }
.post-content p + p { margin-top: 18px; }

/* الكمّيّة قبل الإضافة إلى السلّة */
.buy-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 14.5px; }

@media (max-width: 1180px) {
	.buy-card .buy-qty { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
	.post-grid { grid-template-columns: 1fr; }
	.post-content { font-size: 16px; margin-top: 24px; }
}

/* ================================================================ الإصدار الثاني */
/* النظرة السريعة: تطفو فوق الغلاف بجانب المفضّلة، ولا تحجز مكانًا */
.book-media .qv {
	position: absolute; bottom: 10px; inset-inline-end: 54px; width: 38px; height: 38px;
	background: var(--white); color: var(--store-text); box-shadow: var(--shadow);
	opacity: 0; transform: translateY(6px); transition: .2s .04s;
}
.book-card:hover .qv, .book-card:focus-within .qv { opacity: 1; transform: none; }
@media (hover: none) { .book-media .qv { opacity: 1; transform: none; } }
.book-media .qv:hover, .book-media .wish:hover { color: var(--store-primary); }
.is-out .book-media .wish, .is-out .book-media .qv { bottom: 42px; }
.as-list .book-media .qv { display: none; }
/* البطاقة المختصرة: بطولها الطبيعيّ، فلا فراغ في أسفلها ولا فوق سعرها */
.recent-row { align-items: start; }
.book-card.is-compact .book-author { font-size: 13px; }
.book-card.is-compact .rating-count { display: none; }

/* تبويبات «الأكثر مبيعًا»: أقراصٌ في الوسط، والمختار بلون المتجر ونقاطٍ تحته كرابط القائمة الحاليّ */
.row-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.row-tab {
	position: relative; min-height: 40px; padding: 8px 18px; border-radius: var(--pill); border: 1px solid var(--line);
	background: var(--white); color: var(--store-text); font-weight: 700; font-size: 14.5px; transition: background-color .2s, color .2s, border-color .2s;
}
.row-tab:hover { border-color: var(--store-primary); color: var(--store-primary); }
.row-tab[aria-selected="true"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* رأس القسم بعنوانٍ في البداية وأدواتٍ في النهاية */
.sec-head-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; max-width: none; text-align: start; margin-inline: 0; }
.sec-head-split .wave { margin-inline: 0; }
.carousel-nav { display: flex; align-items: center; gap: 8px; flex: none; }
.carousel-nav .link-arrow { margin-inline-start: 10px; }
.carousel-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--store-text); transition: background-color .2s, color .2s, border-color .2s; }
.carousel-btn:hover:not(:disabled) { background: var(--store-accent); border-color: var(--store-accent); color: var(--white); }
.carousel-btn:disabled { opacity: .4; cursor: default; }

/* الدوّار الأفقيّ «وصل حديثًا»: عدد البطاقات الظاهرة من خيار عدد الكتب في الصفّ */
.carousel { --cols: 4; --gap: 24px; }
body[data-books-per-row="3"] .carousel { --cols: 3; }
body[data-books-per-row="5"] .carousel { --cols: 5; }
body[data-books-per-row="6"] .carousel { --cols: 6; }
.carousel-track {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); gap: var(--gap);
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 2px 12px; margin: -4px -2px 0;
	scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.carousel-track > * { scroll-snap-align: start; }
.carousel-track .book-card:hover { transform: none; }

/* عرض الليلة: لوحةٌ ليليّة بعدّادٍ واحد وكتابٍ واحد كبير */
.deal {
	position: relative; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr); gap: 40px; align-items: center;
	padding: 44px; border-radius: calc(var(--r) + 8px); overflow: hidden; color: var(--white);
	background-color: var(--night);
	background-image: radial-gradient(circle at 12% 110%, color-mix(in srgb, var(--store-primary) 45%, transparent), transparent 55%),
		radial-gradient(1.3px 1.3px at 18% 22%, rgba(255, 255, 255, .8), transparent), radial-gradient(1px 1px at 34% 64%, rgba(255, 255, 255, .6), transparent),
		radial-gradient(1.4px 1.4px at 52% 14%, rgba(255, 255, 255, .7), transparent), radial-gradient(1px 1px at 72% 38%, rgba(255, 255, 255, .5), transparent),
		radial-gradient(1.2px 1.2px at 88% 18%, rgba(255, 255, 255, .7), transparent), radial-gradient(1px 1px at 8% 48%, rgba(255, 255, 255, .6), transparent);
}
.deal-head .sec-title { color: var(--white); }
.deal-head .wave { margin-inline: 0; stroke: var(--primary-on-dark); }
.deal-head .sec-sub { color: var(--on-dark-muted); }
.deal-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--primary-on-dark); font-weight: 800; font-size: 14px; }
.deal-kicker .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.countdown { display: flex; gap: 10px; margin-top: 22px; }
.countdown[hidden] { display: none; }
.cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 66px; padding: 10px 6px 8px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.cd-unit b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-unit small { color: var(--on-dark-muted); font-size: 12.5px; }
.deal-book { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; align-items: center; padding: 18px; background: var(--white); color: var(--store-text); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.deal-cover { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow); }
.deal-cover img { width: 100%; height: 100%; object-fit: cover; }
.deal-cover .type-dot { position: absolute; top: 10px; inset-inline-start: 10px; }
.deal-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.deal-title { font-size: 26px; }
.deal-title a:hover { color: var(--store-primary); }
.deal-desc { color: #343B47; font-size: 15px; margin-top: 4px; }
.deal-desc p + p { margin-top: 6px; }
.deal-buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.deal-price { margin-top: 6px; }
.deal-wish { border: 1px solid var(--line); color: var(--store-text); }
.deal-wish[aria-pressed="true"] { color: var(--store-primary); }
.deal-wish[aria-pressed="true"] .icon { fill: currentColor; }

/* صفوفٌ بأربع بطاقاتٍ ثابتة (اقتراحات السلّة و404 ومختارات الدار): لا صفّ ناقص مع أيّ قيمةٍ لعدد الكتب في الصفّ */
body[data-books-per-row] .book-grid.fixed-4 { --cols: 4; }

/* التصفية المختارة فوق نتائج التصنيف */
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.active-filters > span { color: var(--muted); font-size: 14px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px 4px 12px; border-radius: var(--pill); background: var(--primary-tint); color: var(--store-primary-dark); font-weight: 700; font-size: 13.5px; }
.filter-chip .icon { width: 15px; height: 15px; }
.filter-chip:hover { background: var(--store-primary); color: var(--white); }
.clear-filters { font-size: 13.5px; font-weight: 700; color: var(--store-text); text-decoration: underline; text-underline-offset: 3px; }

/* اختيار الصيغة في صفحة الكتاب */
.formats-box { margin: 16px 0 0; }
.formats-label { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.formats { display: flex; flex-wrap: wrap; gap: 10px; }
.format-opt { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 14px 7px 10px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white); transition: border-color .2s; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt[aria-current="page"] { border-color: var(--store-primary); background: var(--primary-tint); }
.format-opt .type-dot { width: 28px; height: 28px; border-width: 1.5px; box-shadow: none; }
.format-opt .type-dot .icon { width: 14px; height: 14px; }
.format-opt span:not(.type-dot) { display: block; line-height: 1.3; }
.format-name { font-weight: 700; font-size: 14px; }
.format-price { color: var(--store-primary); font-weight: 800; font-size: 14px; }

/* صورة رأس التصنيف: بطاقةٌ واضحة في الطرف، لا خلفيّةٌ باهتة */
.page-head.has-image .container { padding-inline-end: calc(var(--gutter) + 230px); }
.page-head .head-img {
	inset-block: auto; top: 28px; inset-inline-end: max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter)));
	width: 190px; height: auto; aspect-ratio: 5 / 6; opacity: 1; border-radius: var(--r); border: 4px solid rgba(255, 255, 255, .14);
	-webkit-mask-image: none; mask-image: none; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); z-index: 2;
}

/* المسافات: شريط الثقة ملاصقٌ لما قبله، وبطاقات المؤلّفين تتساوى روابطها */
.section + .trust { padding-top: 0; padding-bottom: 8px; }
.author-body { flex: 1; }
.author-body .link-arrow { margin-top: auto; padding-top: 4px; }

@media (max-width: 991px) {
	.deal { grid-template-columns: 1fr; gap: 26px; padding: 32px; }
	.review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.review-card { padding: 22px 16px 20px; }
	.review-grid .review-quote { display: none; }
	.about-media { max-width: 440px; }
	body[data-books-per-row] .band .book-grid, body[data-books-per-row] .book-grid.fixed-4 { --cols: 4; gap: 14px; }
	.carousel { --cols: 3; --gap: 18px; }
	.page-head .head-img { width: 150px; }
	.page-head.has-image .container { padding-inline-end: calc(var(--gutter) + 180px); }
}

@media (max-width: 640px) {
	/* البطل: الصورة فوق النصّ لا خلفه */
	.hero-slides { height: auto; display: grid; }
	.slide { position: relative; inset: auto; grid-area: 1 / 1; display: flex; flex-direction: column; padding-top: var(--header-h); }
	.slide::after { display: none; }
	.slide-bg { position: relative; inset: auto; width: calc(100% - 2 * var(--gutter)); height: 190px; margin: 6px var(--gutter) 0; border-radius: var(--r); object-position: 30% 50%; }
	.slide-inner { height: auto; padding-top: 52px; padding-bottom: 64px; }
	.slide-copy p { font-size: 15px; }
	.slide-cta .btn-glass { display: none; }
	.hero-thumbs-wrap { align-items: flex-start; justify-content: flex-end; padding: calc(var(--header-h) + 206px) var(--gutter) 0; }
	.hero-thumbs { gap: 6px; }
	.hero-thumbs button { width: 52px; }
	.hero-thumbs button[aria-current="true"], .hero-thumbs button:hover { transform: none; }
	.hero + .finder { margin-top: calc(-1 * var(--notch) - 42px); }
	.finder-top, .finder-fields .field-box:not(.grow) { display: none; }
	.finder-card { padding: 10px; }
	.finder-fields { flex-direction: row; gap: 8px; }
	.field-box { padding: 6px 12px; }
	.field-box small { font-size: 12px; }
	.field-box input { font-size: 15px; }
	.finder-btn { min-width: 0; min-height: 52px; padding-inline: 16px; }

	/* التصنيفات وشريط الثقة: شريطٌ يُمرَّر */
	.dest-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.dest-card, .dest-card:nth-child(n+4), .dest-card:nth-child(5) { grid-column: auto; scroll-snap-align: start; }
	.dest-card .dest-media, .dest-card:nth-child(n+4) .dest-media, .dest-card:nth-child(4) .dest-media, .dest-card:nth-child(5) .dest-media { aspect-ratio: 1 / 1; }
	.dest-body { padding: 10px 8px 12px; }
	[data-region="home_categories"] .sec-more { display: none; }
	.trust { padding: 18px 0 8px; }
	.trust-row { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; row-gap: 0; padding-bottom: 8px; }
	.trust-item { scroll-snap-align: start; padding: 10px 12px; }
	.trust-item:nth-child(3) { border-inline-start: 1px solid var(--line); }
	.trust-ghost { width: 54px; height: 54px; }

	/* الصفّ الأفقيّ: التقييم يبقى ظاهرًا تحت المؤلّف */
	.book-row { grid-template-areas: "cover main main" "cover line line" "cover price action"; }
	.book-row .row-line { display: flex; grid-area: line; justify-content: flex-start; }
	.book-row .row-line::before, .book-row .row-line::after { display: none; }
	.book-row .row-line .rating { padding: 0; background: none; }

	.row-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; }
	.row-tab { flex: none; }

	.sec-head-split { flex-wrap: wrap; align-items: flex-start; }
	.carousel-nav .carousel-btn { display: none; }
	.carousel-nav .link-arrow { margin: 0; }
	.carousel { --gap: 12px; }
	.carousel-track { grid-auto-columns: 44%; }

	.deal { padding: 22px 16px; border-radius: var(--r); }
	.countdown { gap: 6px; }
	.cd-unit { min-width: 0; flex: 1; padding: 8px 4px 6px; }
	.cd-unit b { font-size: 22px; }
	.deal-book { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; padding: 12px; align-items: start; }
	.deal-body { display: contents; }
	.deal-cover { grid-row: span 4; }
	.deal-title, .deal-body > .book-author, .deal-body > .rating, .deal-price { grid-column: 2; }
	.deal-price { margin-top: 0; }
	.deal-buy, .deal-desc { grid-column: 1 / -1; }
	.deal-title { font-size: 19px; }
	.deal-desc p + p { display: none; }
	.deal-desc { font-size: 14px; }
	.deal-buy { margin-top: 6px; gap: 8px; width: 100%; }
	.deal-price.price-lg { font-size: 20px; }
	.chip-grid { grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 10px; margin-inline: -4px; }
	.chip-card { scroll-snap-align: start; }
	.deal-buy .btn { flex: 1 1 auto; }

	.review-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
	.review-grid > * { scroll-snap-align: start; }
	body[data-books-per-row] .band .book-grid, body[data-books-per-row] .book-grid.fixed-4 { --cols: 2; gap: 12px; }
	.book-media .qv { inset-inline-end: 50px; width: 34px; height: 34px; }
	.book-media .wish { width: 34px; height: 34px; }
	.is-out .book-media .wish, .is-out .book-media .qv { bottom: 38px; }
	.page-head .head-img { display: none; }
	.page-head.has-image .container { padding-inline-end: var(--gutter); }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
	.footer-about, .footer-col:has(.footer-contact) { grid-column: 1 / -1; }
	.formats-box .format-opt { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
}

/* بجانب البانر الطويل في الشاشات المتوسّطة: التقييم تحت المؤلّف بدل الخطّ المنقّط، فلا تنضغط العناوين */
@media (min-width: 992px) and (max-width: 1180px) {
	.best-layout .book-row { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "cover main action" "cover line action" "cover price action"; gap: 2px 14px; padding: 12px 14px; }
	.best-layout .row-cover { grid-area: cover; width: 56px; align-self: start; }
	.best-layout .row-main { grid-area: main; }
	.best-layout .row-line { grid-area: line; justify-content: flex-start; }
	.best-layout .row-line::before, .best-layout .row-line::after { display: none; }
	.best-layout .row-line .rating { padding: 0; background: none; }
	.best-layout .row-price { grid-area: price; flex-direction: row; align-items: baseline; gap: 10px; }
	.best-layout .row-action { grid-area: action; }
}

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