/* =====================================================================
   مدار (madar) — قالب متجر كتب لمنصّة «ناشر»
   مأخوذ عن الرئيسيّة الرابعة من «Viatour»: واجهةٌ خوخيّة بعنوانٍ متدرّج
   موسَّط وبحثٍ كبسوليّ فوق رسمٍ مقصوص شفّاف، وفسيفساء تصنيفات، وسلايدر
   بطاقاتٍ على الكريميّ، وشريطٌ كحليّ للمؤلّفين ببطاقاتٍ طوليّة، وآراءٌ
   بمنتقي دوائر، وبطاقاتٌ عريضة، وشريط نشرة، وتذييلٌ كحليّ.
   ===================================================================== */

:root {
	/* ألوان المتجر: يختارها الناشر (القاعدة 4) */
	--store-primary: #9D2B6B;
	--store-primary-dark: #7A1F52;
	--store-accent: #4A43C4;
	--store-bg: #FFFFFF;
	--store-text: #05073C;

	/* محايدات ومشتقّات */
	--on-primary: #FFFFFF;            /* الأبيض على #9D2B6B = 7.0 */
	--on-accent: #FFFFFF;
	--primary-ink: color-mix(in srgb, var(--store-primary-dark) 85%, #000);  /* نصٌّ ملوّن على الفاتح */
	--peach: color-mix(in srgb, var(--store-primary) 6%, #FFFFFF);   /* خلفيّة الواجهة ورؤوس الصفحات */
	--cream: color-mix(in srgb, var(--store-primary) 4%, #FFFFFF);
	--tint: color-mix(in srgb, var(--store-primary) 12%, #FFFFFF);
	--tint-accent: color-mix(in srgb, var(--store-accent) 12%, #FFFFFF);
	--navy: var(--store-text);
	--soft: #FBFBFB;
	--band: #F3F3F5;
	--muted: #5C5E70;
	--line: #E5E5EA;
	--white: #FFFFFF;
	--star: #F5A623;
	--on-navy: #FFFFFF;
	--on-navy-muted: rgba(255, 255, 255, .8);
	--shadow: 0 12px 32px rgba(5, 7, 60, .09);
	--shadow-sm: 0 4px 14px rgba(5, 7, 60, .08);
	--radius: 12px;
	--radius-lg: 18px;
	--gap: 22px;
	--per-row: 4;
	--font: "Tajawal", system-ui, sans-serif;
	--grad: linear-gradient(to left, var(--store-primary) 5%, var(--store-accent) 95%);
	--grad-light: linear-gradient(to left, color-mix(in srgb, var(--store-primary) 35%, #FFFFFF), color-mix(in srgb, var(--store-accent) 35%, #FFFFFF));
}

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; }

*, *::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.65;
	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, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--store-accent); outline-offset: 2px; }
.container { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: 20px; }
.visually-hidden {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.muted { color: var(--muted); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: currentColor; stroke: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.tilt { transform: rotate(45deg); }

/* ---------------------------------------------------------------- العنوان المتدرّج
   لونٌ احتياطيّ مصمت أوّلًا، والتدرّج حيث يُدعم قصّ الخلفيّة على النصّ.
   طرفا التدرّج #9D2B6B و#4A43C4 على الخوخيّ: 6.4 و6.6، ووسطه أدكن (6.9). */
.grad { color: var(--store-primary-dark); }
.grad-light { color: color-mix(in srgb, var(--store-primary) 35%, #FFFFFF); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	body:not([data-title-style="solid"]) .grad,
	body:not([data-title-style="solid"]) .grad-light {
		background: var(--grad); -webkit-background-clip: text; background-clip: text;
		-webkit-text-fill-color: transparent; color: transparent;
	}
	body:not([data-title-style="solid"]) .grad-light { background: var(--grad-light); -webkit-background-clip: text; background-clip: text; }
}

/* ---------------------------------------------------------------- الأزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px; border-radius: var(--radius);
	border: 1.5px solid transparent; font-weight: 700; font-size: 15px;
	transition: background .2s, color .2s, border-color .2s; white-space: nowrap;
}
.btn-primary { background: var(--store-primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-outline { background: var(--white); color: var(--store-text); border-color: var(--store-text); }
.btn-outline:hover { background: var(--store-text); color: var(--white); }
.btn-accent { background: var(--store-accent); color: var(--on-accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--store-accent) 82%, #000); }
.btn-light { background: var(--white); color: var(--store-text); border-color: var(--line); }
.btn-light:hover { border-color: var(--store-text); }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 16px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; gap: 6px; }
.btn-sm .icon { width: 17px; height: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--line); background: var(--white); color: var(--store-text);
	transition: border-color .2s, background .2s; position: relative; flex: none;
}
.icon-btn:hover { border-color: var(--store-text); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn[aria-pressed="true"] { color: var(--store-primary); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.see-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 15px; white-space: nowrap; }
.see-all:hover { color: var(--primary-ink); }
.see-all.center { justify-content: center; }
.cs-go {
	width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--store-primary); color: var(--on-primary);
	display: inline-grid; place-items: center; flex: none; transition: background .2s;
}
.cs-go:hover { background: var(--store-primary-dark); }
.cs-go-label { display: none; }

/* ---------------------------------------------------------------- عنوان القسم */
.section { padding-block: 64px; }
.section-tight { padding-block: 36px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.sec-title { font-size: clamp(23px, 2.3vw, 30px); font-weight: 700; }
.sec-title.sm { font-size: 20px; }
.sec-sub { color: var(--muted); margin-top: 6px; font-size: 15px; }
.sec-head.center { justify-content: center; text-align: center; }
.sec-tools { display: flex; align-items: center; gap: 8px; }
.sec-tools .see-all { margin-inline-end: 8px; }
.track-arrow { width: 42px; height: 42px; }
.track-arrow[disabled] { opacity: .4; cursor: default; }
.band-cream { background: var(--peach); }
.band-soft { background: var(--soft); }
.band-navy { background: var(--navy); color: var(--on-navy); }
.band-navy .see-all, .band-navy .sec-sub { color: var(--on-navy); }
.band-navy .track-arrow { background: transparent; color: var(--on-navy); border-color: rgba(255, 255, 255, .35); }
.band-navy .track-arrow:hover { border-color: #FFFFFF; }

/* ---------------------------------------------------------------- التقييم والسعر ودائرة النوع */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 2px; color: var(--star); }
.stars .icon { width: 14px; height: 14px; }
.stars .off { color: #D9D9DE; }
.rating-lg .stars .icon { width: 18px; height: 18px; }
.rating-lg { font-size: 15px; }
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-weight: 700; font-size: 17px; color: var(--store-text); }
.price del { font-weight: 400; font-size: 13px; color: var(--muted); }
.price-lg { font-size: 30px; }
.price-lg del { font-size: 17px; }
.price-sm { font-size: 14px; }
.type-dot {
	display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
	color: #FFFFFF; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); flex: none;
}
.type-dot .icon { width: 17px; height: 17px; stroke-width: 2; }
.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; }
.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.badge-sale { background: var(--store-primary); color: var(--on-primary); }
.badge-new { background: var(--store-accent); color: var(--on-accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 999px; background: var(--tint); color: var(--store-text); font-size: 13.5px; font-weight: 500; }
.pill-accent { background: var(--store-accent); color: var(--on-accent); }
.pill-dark { background: rgba(255, 255, 255, .12); color: var(--on-navy); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--primary-ink); }

/* ---------------------------------------------------------------- الرأس */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--peach); transition: background .2s, box-shadow .2s; }
.site-header.is-stuck { background: var(--white); box-shadow: 0 6px 20px rgba(5, 7, 60, .07); }
.hdr { display: flex; align-items: center; gap: 24px; min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 40px; height: 40px; }
.brand-name { font-weight: 800; font-size: 22px; color: var(--store-text); }
.hdr-nav > ul { display: flex; align-items: center; gap: 2px; }
.hdr-nav a, .hdr-nav .drop-btn {
	display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0 12px; border-radius: 10px;
	border: 0; background: none; font-size: 15px; font-weight: 500;
}
.hdr-nav a:hover, .hdr-nav .drop-btn:hover { color: var(--primary-ink); }
.has-drop { position: relative; }
.drop-btn .icon { width: 16px; height: 16px; transition: transform .2s; }
.has-drop.open .drop-btn .icon { transform: rotate(180deg); }
.drop {
	position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 230px; padding: 10px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.has-drop:hover .drop, .has-drop.open .drop, .has-drop:focus-within .drop { opacity: 1; visibility: visible; transform: none; }
.drop a { display: flex; height: 40px; padding: 0 12px; border-radius: 8px; width: 100%; }
.drop a:hover { background: var(--peach); }
.hdr-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex: none; }
.hdr-actions .icon-btn { border-color: transparent; background: transparent; }
.hdr-actions .icon-btn:hover { background: var(--tint); }
.hdr-link { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; font-weight: 500; font-size: 15px; }
.hdr-link:hover { color: var(--primary-ink); }
.count {
	position: absolute; top: 2px; inset-inline-end: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
	background: var(--store-accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
/* السلّة: كبسولةٌ مؤطّرة كزرّ الدخول في المرجع */
.cart-pill {
	display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 18px; padding-inline: 18px 8px;
	border: 1.5px solid var(--store-text); border-radius: 999px; font-weight: 700; font-size: 15px; background: transparent; color: var(--store-text);
	transition: background .2s, color .2s;
}
.cart-pill:hover { background: var(--store-text); color: var(--white); }
.cart-pill .cart-num { background: var(--store-primary); color: var(--on-primary); border-radius: 999px; min-width: 26px; height: 26px; display: inline-grid; place-items: center; font-size: 12.5px; padding: 0 7px; }
.menu-btn { display: none; border-color: transparent; background: transparent; }
.m-search { display: none; padding-bottom: 14px; }
.search-open .m-search { display: block; }
.m-search-box { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 5px; padding-inline-start: 20px; max-width: 640px; margin-inline: auto; box-shadow: var(--shadow-sm); }
.m-search-box input { flex: 1; min-width: 0; border: 0; background: transparent; height: 44px; outline: none; }
.m-search-box .cs-go { width: 44px; height: 44px; }

/* ---------------------------------------------------------------- الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(5, 7, 60, .45); opacity: 0; visibility: hidden; transition: .25s; z-index: 60; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(360px, 88vw); background: var(--white); z-index: 61;
	transform: translateX(100%); transition: transform .3s; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; visibility: hidden;
}
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-nav > li > a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; 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 12px; border-radius: 999px; background: var(--peach); font-size: 14px; }
.drawer-card { background: var(--peach); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: center; }
.drawer-card small { display: block; color: var(--muted); }

/* ---------------------------------------------------------------- الواجهة الخوخيّة */
.stage { position: relative; background: var(--peach); overflow: hidden; }
.stage::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: radial-gradient(color-mix(in srgb, var(--store-primary) 22%, transparent) 1.2px, transparent 1.6px);
	background-size: 22px 22px;
	-webkit-mask-image: radial-gradient(ellipse at 50% 90%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 90%, #000 0%, transparent 70%);
}
.stage-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage-home .stage-inner { padding-top: 38px; }
.stage-title { font-size: clamp(32px, 4.3vw, 58px); font-weight: 800; line-height: 1.25; max-width: 860px; padding-bottom: 4px; }
.stage-text { color: var(--muted); font-size: clamp(15px, 1.25vw, 18px); max-width: 640px; margin-top: 12px; }
.stage-home .capsule { margin-top: 28px; }
.stage-home:not(:has(.hero-art)) .stage-inner { padding-bottom: 72px; }

/* البحث الكبسوليّ */
.capsule {
	width: min(860px, 100%); background: var(--white); border-radius: 999px; box-shadow: 0 16px 40px rgba(5, 7, 60, .12);
	padding: 8px; padding-inline-start: 18px; display: flex; align-items: center; gap: 4px; text-align: start;
}
.cs-field { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px 12px; border-inline-end: 1px solid var(--line); }
.cs-field:last-of-type { border-inline-end: 0; }
.cs-ico { color: var(--store-text); display: grid; place-items: center; flex: none; }
.cs-field label { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.cs-field input, .cs-field select { width: 100%; border: 0; background: transparent; padding: 2px 0; font-size: 13.5px; color: var(--muted); outline: none; appearance: none; }
.cs-field select { cursor: pointer; }
.cs-field .grow { min-width: 0; flex: 1; }
.capsule .cs-go { width: 56px; height: 56px; }

/* السلايدر: رسمٌ مقصوص شفّاف تحت البحث */
.hero-art { position: relative; z-index: 1; width: min(1440px, 100%); margin: -26px auto 0; aspect-ratio: 1600 / 600; }
.slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s, visibility .8s; }
.slide:first-child, .slider-ready .slide.is-active { opacity: 1; visibility: visible; }
.slider-ready .slide:not(.is-active) { opacity: 0; visibility: hidden; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.slide-cap {
	position: absolute; top: 30%; inset-inline-start: max(20px, calc((100% - 1320px) / 2)); z-index: 2; width: 230px;
	background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.slide-cap b { font-size: 17px; }
.slide-cap span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.slide-cap a { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--primary-ink); margin-top: 4px; }
.slide-cap a .icon { width: 16px; height: 16px; }
.hero-dots { position: absolute; z-index: 3; top: 30%; inset-inline-end: max(20px, calc((100% - 1320px) / 2)); display: flex; flex-direction: column; gap: 6px; padding-top: 10px; }
.hero-dots button, .track-dots button {
	width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: color-mix(in srgb, var(--store-text) 25%, transparent); transition: height .25s, background .25s;
}
.hero-dots button[aria-current="true"] { height: 26px; background: var(--store-primary); }

/* رؤوس الصفحات الداخليّة على الخوخيّ */
.stage-page .stage-inner { padding-block: 26px 44px; }
.stage-page:not(.is-center) .stage-inner { align-items: flex-start; text-align: start; }
.stage-page .capsule { margin-top: 24px; max-width: 720px; }
.page-title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; margin-top: 14px; line-height: 1.25; padding-bottom: 4px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); justify-content: inherit; }
.is-center .breadcrumb { justify-content: center; }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; color: #8E8FA0; }
.breadcrumb a:hover { color: var(--store-text); }

/* ---------------------------------------------------------------- فسيفساء التصنيفات */
.mosaic { display: grid; grid-template-columns: 1.3fr 1fr .78fr .78fr; grid-template-rows: 230px 230px; gap: var(--gap); }
.mtile, .stile { position: relative; border-radius: var(--radius); overflow: hidden; display: block; background: #2B2F55; }
.mtile img, .stile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.mtile:hover img, .stile:hover img { transform: scale(1.05); }
.mtile::after, .stile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 7, 60, .85) 0%, rgba(5, 7, 60, .3) 45%, rgba(5, 7, 60, 0) 72%); }
.mt-body { position: absolute; z-index: 1; inset-inline-start: 20px; bottom: 18px; color: #FFFFFF; }
.mtile h3 { font-size: 19px; font-weight: 700; }
.mt-body p { font-size: 13.5px; }
.mosaic .mtile:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.mosaic .mtile:nth-child(2) { grid-column: 2; grid-row: 1; }
.mosaic .mtile:nth-child(3) { grid-column: 3 / 5; grid-row: 1; }
.mosaic .mtile:nth-child(4) { grid-column: 2; grid-row: 2; }
.mosaic .mtile:nth-child(5) { grid-column: 3; grid-row: 2; }
.mosaic .mtile:nth-child(6) { grid-column: 4; grid-row: 2; }
.stile { flex: 0 0 210px; height: 140px; }
.stile h3 { font-size: 16px; }
.stile .mt-body { inset-inline-start: 14px; bottom: 12px; }

/* ---------------------------------------------------------------- شريط الثقة: صفٌّ رفيع تحت الواجهة */
.why { padding-block: 20px; border-bottom: 1px solid var(--line); }
.why-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.why-item { display: flex; align-items: center; gap: 14px; padding: 4px 22px; border-inline-start: 1px solid var(--line); }
.why-item:first-child { border-inline-start: 0; padding-inline-start: 0; }
.why-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: var(--store-primary); background: var(--peach); flex: none; }
.why-ico .icon { width: 26px; height: 26px; stroke-width: 1.5; }
.why-item h3 { font-size: 15.5px; }
.why-item p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
body[data-show-trust-bar="false"] .why { display: none; }

/* ---------------------------------------------------------------- المسارات الأفقيّة */
.track { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; padding: 4px 2px 6px; }
.track::-webkit-scrollbar { display: none; }
.track > * { scroll-snap-align: start; }

/* ---------------------------------------------------------------- بطاقة الكتاب */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: var(--gap); }
.bcard {
	position: relative; display: flex; flex-direction: column; background: var(--white);
	border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; transition: box-shadow .25s, border-color .25s;
}
.bcard:hover { box-shadow: var(--shadow); border-color: transparent; }
.bcard-media { position: relative; }
.bcard-cover { display: block; border-radius: 9px; overflow: hidden; aspect-ratio: 2 / 3; background: var(--band); }
.bcard-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.bcard:hover .bcard-cover img { transform: scale(1.04); }
.bcard .type-dot { position: absolute; top: 10px; inset-inline-start: 10px; }
.bcard-badges { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* المفضّلة والنظرة السريعة: عمودٌ يطفو تحت دائرة النوع، يظهر عند التحويم في الحاسوب ودائمًا في اللمس، ولا يحجز مكانًا */
.bcard-tools { position: absolute; z-index: 2; top: 50px; inset-inline-start: 10px; display: flex; flex-direction: column; gap: 6px; }
.bcard-tools .tool { width: 34px; height: 34px; border: 0; box-shadow: 0 3px 10px rgba(5, 7, 60, .15); }
.bcard-tools .tool:hover { background: var(--peach); }
.bcard-tools .icon { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) {
	.bcard-tools .tool { opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s, background .2s; }
	.bcard:hover .bcard-tools .tool, .bcard:focus-within .bcard-tools .tool, .bcard-tools .tool[aria-pressed="true"] { opacity: 1; transform: none; }
}
.stock-band { position: absolute; inset-inline: 0; bottom: 34%; background: rgba(5, 7, 60, .88); color: #FFFFFF; text-align: center; font-weight: 700; font-size: 14px; padding: 7px 0; }
.bcard.is-out .bcard-cover img { filter: grayscale(.7); opacity: .8; }
.bcard-body { padding: 14px 6px 4px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bcard-author { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.bcard-author .icon { width: 14px; height: 14px; }
.bcard-title { font-size: 16px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard-title a:hover { color: var(--primary-ink); }
.bcard-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-mini { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--store-primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.cart-mini:hover { background: var(--store-primary-dark); }
.cart-mini[disabled] { background: var(--band); color: var(--muted); cursor: not-allowed; }
.cart-mini .icon { width: 18px; height: 18px; }
body[data-card-style="plain"] .bcard { border-color: transparent; padding: 0; background: transparent; }
body[data-card-style="plain"] .bcard:hover { box-shadow: none; }
body[data-card-style="plain"] .bcard-foot { border-top: 0; padding-top: 6px; }
body[data-card-style="soft"] .bcard { border-color: transparent; box-shadow: var(--shadow-sm); }
.track .bcard { flex: 0 0 calc((100% - (var(--per-row) - 1) * var(--gap)) / var(--per-row)); }
.band-navy .bcard { border-color: transparent; color: var(--store-text); }
body[data-card-style="plain"] .band-navy .bcard { background: var(--white); padding: 10px; }

.book-grid.is-list { grid-template-columns: 1fr !important; }
.is-list .bcard { flex-direction: row; gap: 22px; align-items: stretch; }
.is-list .bcard-media { width: 160px; flex: none; }
.is-list .bcard-body { padding: 8px 0; }
.is-list .bcard-title { min-height: 0; font-size: 18px; }
.is-list .bcard-foot { border-top: 0; justify-content: flex-start; gap: 16px; }
.bcard-desc { display: none; color: var(--muted); font-size: 14.5px; }
.is-list .bcard-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* البطاقة العريضة (المقالات) */
.wide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.wcard { display: flex; flex-direction: column; }
.wcard-media { position: relative; border-radius: var(--radius-lg); background: var(--tint); aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.wcard-body { padding: 16px 4px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.wcard-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.wcard h3 { font-size: 19px; font-weight: 700; }
.wcard h3 a:hover { color: var(--primary-ink); }
.wcard-desc { color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- المؤلّفون على الشريط الكحليّ */
.authors-track .acard { flex: 0 0 calc((100% - 3 * var(--gap)) / 4); }
.acard { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3 / 4; background: #1B1E52; }
.acard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.acard:hover img { transform: scale(1.05); }
.acard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 7, 60, .88) 0%, rgba(5, 7, 60, .35) 32%, rgba(5, 7, 60, 0) 55%); }
.ac-body { position: absolute; z-index: 1; inset-inline: 0; bottom: 22px; text-align: center; color: #FFFFFF; }
.ac-body h3 { font-size: 20px; }
.ac-body p { font-size: 14px; }

/* ---------------------------------------------------------------- آراء القرّاء */
.rv-stage { max-width: 760px; margin-inline: auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.rv-mark { color: var(--store-primary); margin-bottom: 18px; }
.rv-mark .icon { width: 56px; height: 56px; }
.rv-list { display: grid; width: 100%; }
.rv-item { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.rv-item:first-child, .rv-ready .rv-item.is-active { opacity: 1; visibility: visible; }
.rv-ready .rv-item:not(.is-active) { opacity: 0; visibility: hidden; }
.rv-item blockquote { margin: 0; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.9; }
.rv-item .rating { justify-content: center; margin-top: 18px; }
.rv-who { margin-top: 12px; }
.rv-who b { display: block; font-weight: 700; }
.rv-who small { color: var(--muted); font-size: 14px; }
.rv-picker { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 30px; }
.rv-picker button {
	width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--tint); color: var(--store-text);
	font-size: 21px; font-weight: 800; transition: box-shadow .25s, transform .25s;
}
.rv-picker button:nth-child(2n) { background: var(--tint-accent); }
.rv-picker button:nth-child(3n) { background: #FDEBD5; }
.rv-picker button[aria-current="true"] { box-shadow: 0 0 0 4px var(--soft), 0 0 0 6px var(--store-primary); transform: scale(1.06); }
body[data-show-reviews="false"] .reviews, body[data-show-reviews="false"] .pdp-reviews { display: none; }

/* ---------------------------------------------------------------- البانر العريض */
.wide-banner { position: relative; border-radius: 22px; overflow: hidden; min-height: 380px; display: flex; align-items: center; }
.wide-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wb-card { position: relative; z-index: 1; margin: 34px; margin-inline-start: auto; width: min(460px, 100%); background: var(--white); border-radius: var(--radius-lg); padding: 30px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; box-shadow: var(--shadow); }
.wb-card h2 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; }
.wb-card p { color: var(--muted); }

/* ---------------------------------------------------------------- شريط النشرة */
.news-band { position: relative; background: var(--store-primary-dark); color: #FFFFFF; overflow: hidden; }
.news-lines { position: absolute; inset-block: 0; inset-inline-start: 0; width: 55%; height: 100%; pointer-events: none; }
.news-lines path { fill: none; stroke: #FFFFFF; stroke-opacity: .14; stroke-width: 2.5; }
.news-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; min-height: 360px; padding-block: 44px; }
.news-grid:not(:has(.news-art)) { grid-template-columns: 1fr; min-height: 280px; }
.news-text h2 { font-size: clamp(28px, 3vw, 42px); font-weight: 800; line-height: 1.25; max-width: 560px; }
.news-text p { margin-top: 12px; max-width: 520px; }
.news-form { display: flex; gap: 10px; margin-top: 26px; max-width: 520px; }
.news-form input { flex: 1; min-width: 0; height: 52px; border-radius: var(--radius); border: 0; padding: 0 18px; background: var(--white); color: var(--store-text); }
.news-form input::placeholder { color: var(--muted); }
.news-form .btn { background: var(--white); color: var(--store-text); min-height: 52px; }
.news-form .btn:hover { background: var(--peach); }
.news-art img { width: 100%; height: auto; max-width: 520px; margin-inline-start: auto; aspect-ratio: 700 / 520; object-fit: contain; }
body[data-show-newsletter="false"] .news-band { display: none; }

/* ---------------------------------------------------------------- التذييل الكحليّ */
.site-footer { background: var(--navy); color: var(--on-navy); padding: 10px 0 22px; }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 34px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.foot-call { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 500; flex-wrap: wrap; }
.foot-call .icon { width: 34px; height: 34px; stroke-width: 1.4; }
.foot-call a { font-weight: 700; }
.foot-social { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.foot-social a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.foot-social a:hover { background: rgba(255, 255, 255, .12); }
.foot-social .icon { width: 18px; height: 18px; }
.foot-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: 36px; padding: 40px 0 34px; }
.foot-cols h3 { font-size: 17px; margin-bottom: 18px; }
.foot-cols li { margin-bottom: 10px; font-size: 14.5px; color: var(--on-navy-muted); }
.foot-cols li a:hover { color: #FFFFFF; text-decoration: underline; }
.foot-contact li { display: flex; gap: 10px; align-items: flex-start; }
.foot-contact .icon { width: 18px; height: 18px; margin-top: 3px; }
.foot-news p { font-size: 14.5px; margin-bottom: 14px; color: var(--on-navy-muted); }
.fnf { background: var(--white); border-radius: var(--radius); display: flex; align-items: center; color: var(--store-text); }
.fnf input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; padding: 0 16px; outline: none; }
.fnf input::placeholder { color: var(--muted); }
.fnf button { border: 0; background: none; font-weight: 700; padding: 0 16px; height: 52px; color: var(--store-text); }
.fnf button:hover { color: var(--primary-ink); }
.foot-track { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.foot-bottom { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 14px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); color: var(--on-navy-muted); }
.to-top {
	position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 30; width: 48px; height: 48px; border-radius: 50%;
	background: var(--white); border: 0; box-shadow: var(--shadow); color: var(--store-primary); display: grid; place-items: center;
	opacity: 0; visibility: hidden; transition: .25s;
}
.to-top.show { opacity: 1; visibility: visible; }

/* ---------------------------------------------------------------- صفحة التصنيف */
.listing { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; padding-bottom: 70px; }
.filters { display: flex; flex-direction: column; gap: 14px; }
.f-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.f-group summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-weight: 700; cursor: pointer; }
.f-group summary::-webkit-details-marker { display: none; }
.f-group summary .icon { transition: transform .2s; width: 18px; height: 18px; }
.f-group[open] summary .icon { transform: rotate(180deg); }
.f-body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.f-body label { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.f-body input[type="checkbox"], .f-body input[type="radio"] { accent-color: var(--store-primary); width: 17px; height: 17px; }
.f-body .n { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.f-types .type-dot { width: 26px; height: 26px; box-shadow: none; }
.f-types .type-dot .icon { width: 14px; height: 14px; }
.price-range { display: flex; gap: 10px; align-items: center; }
.price-range input { width: 100%; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.range-bar { position: relative; height: 4px; background: var(--line); border-radius: 4px; margin: 8px 4px; }
.range-bar span { position: absolute; inset-inline: 15% 30%; top: 0; bottom: 0; background: var(--grad); border-radius: 4px; }
.range-bar span::before, .range-bar span::after { content: ""; position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--store-primary); transform: translateY(-50%); }
.range-bar span::before { inset-inline-start: -8px; }
.range-bar span::after { inset-inline-end: -8px; border-color: var(--store-accent); }
.filters-head { display: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .count-text { color: var(--muted); }
.toolbar .count-text b { color: var(--store-text); }
.tool-end { display: flex; align-items: center; gap: 10px; }
.view-btn { width: 42px; height: 42px; border-radius: 10px; }
.view-btn[aria-pressed="true"] { background: var(--store-text); color: var(--white); border-color: var(--store-text); }
.select { height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--white); min-width: 180px; }
.filters-toggle { display: none; }
.listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination.start { justify-content: flex-start; margin-top: 0; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 500; padding: 0 6px; }
.pagination a:hover { background: var(--peach); }
.pagination [aria-current="page"] { background: var(--store-primary); color: var(--on-primary); font-weight: 700; }
.pagination .pg-arrow { border: 1px solid var(--line); border-radius: 50%; }
.pager-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---------------------------------------------------------------- صفحة الكتاب */
.pdp-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pdp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 10px; font-size: 15px; }
.pdp-meta a { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.wish-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font-weight: 500; }
.wish-link[aria-pressed="true"] .icon { fill: var(--store-primary); color: var(--store-primary); }
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 40px; align-items: start; padding-block: 36px 30px; }
.gallery { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.g-panel { position: relative; border-radius: var(--radius-lg); background: var(--peach); display: grid; place-items: center; padding: 34px; overflow: hidden; }
.g-main::before { content: ""; position: absolute; width: 130%; aspect-ratio: 2.4; border: 2px dashed color-mix(in srgb, var(--store-primary) 28%, transparent); border-radius: 50%; transform: rotate(-12deg); }
.g-panel img { position: relative; border-radius: 6px; box-shadow: 0 20px 40px rgba(5, 7, 60, .22); width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.g-main img { max-width: 290px; }
.g-side { display: grid; gap: 16px; }
.g-side .g-panel { padding: 24px; background: var(--tint-accent); }
.g-side img { max-width: 140px; }
.g-panel .type-dot { position: absolute; z-index: 1; top: 16px; inset-inline-start: 16px; width: 40px; height: 40px; }
.g-panel .type-dot .icon { width: 20px; height: 20px; }
.g-note { border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.g-note .icon { color: var(--store-primary); }
.g-note b { font-size: 15px; }
.g-note p { color: var(--muted); font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.fact { display: flex; gap: 12px; align-items: center; }
.fact .f-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--peach); color: var(--store-primary); display: grid; place-items: center; flex: none; }
.fact small { display: block; color: var(--muted); font-size: 13px; }
.fact b { font-weight: 700; font-size: 15px; }
.pdp-sec { padding: 30px 0; border-bottom: 1px solid var(--line); }
.pdp-sec h2 { font-size: 23px; margin-bottom: 16px; }
.pdp-reviews { border-bottom: 0; }
.prose { color: #2E3047; }
.prose p + p { margin-top: 12px; }
.chapters { display: grid; gap: 10px; }
.chap { border: 1px solid var(--line); border-radius: var(--radius); }
.chap summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; }
.chap summary::-webkit-details-marker { display: none; }
.chap summary b { flex: 1; font-weight: 700; }
.chap summary .icon { width: 18px; height: 18px; transition: transform .2s; }
.chap[open] summary .icon { transform: rotate(180deg); }
.chap-n { width: 38px; height: 38px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.chap[open] .chap-n { background: var(--store-primary); color: var(--on-primary); }
.chap p { padding: 0 18px 16px; padding-inline-start: 70px; color: var(--muted); font-size: 15px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 30px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks .icon { width: 18px; height: 18px; color: #2F7D58; flex: none; transform: translateY(3px); }
.buy-box { position: sticky; top: 100px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); background: var(--white); display: flex; flex-direction: column; gap: 16px; }
.bb-label { color: var(--muted); font-size: 14px; }
.price-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14.5px; color: #1F6B47; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.bb-type { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--peach); font-size: 14.5px; }
.bb-type .type-dot { width: 30px; height: 30px; box-shadow: none; }
.bb-actions { display: grid; gap: 10px; }
.bb-row { display: flex; gap: 10px; }
.bb-row .btn { flex: 1; }
.bb-row .icon-btn { width: 54px; height: 54px; border-radius: var(--radius); }
.perks { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.perks li { display: flex; gap: 10px; align-items: center; }
.perks .icon { color: var(--store-primary); }
.sample-bar { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--peach); }
.sample-bar .play { width: 42px; height: 42px; border-radius: 50%; background: var(--store-primary); color: var(--on-primary); border: 0; display: grid; place-items: center; flex: none; }
.wave-bars { flex: 1; height: 26px; display: flex; align-items: center; gap: 3px; }
.wave-bars i { flex: 1; background: color-mix(in srgb, var(--store-primary) 50%, #FFFFFF); border-radius: 2px; }
.sample-bar small { color: var(--muted); font-size: 13px; }

.rv-summary { display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: center; background: var(--peach); border-radius: var(--radius-lg); padding: 22px 26px; }
.rv-score { text-align: center; }
.rv-score strong { display: block; font-size: 50px; font-weight: 800; line-height: 1; }
.rv-score .rating { justify-content: center; margin-top: 8px; }
.rv-score p { font-size: 14px; margin-top: 4px; }
.rv-bars li { display: grid; grid-template-columns: 70px 1fr 40px; gap: 12px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.rv-bars .bar { height: 7px; border-radius: 9px; background: var(--white); overflow: hidden; }
.rv-bars .bar span { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.rv-stage-sm { padding: 34px 0 10px; }
.rv-stage-sm .rv-mark .icon { width: 42px; height: 42px; }
.rv-stage-sm blockquote { font-size: 18px; }
.rv-stage-sm .rv-picker button[aria-current="true"] { box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--store-primary); }
.rv-form { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: grid; gap: 14px; }
.rv-form h3 { font-size: 19px; }
.rv-form p { color: var(--muted); font-size: 14px; }
.star-input { border: 0; padding: 0; margin: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: #D9D9DE; }
.star-input label .icon { width: 26px; height: 26px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 3px solid var(--store-accent); border-radius: 4px; }
.field { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--white); resize: vertical; }
.field:focus { outline: none; border-color: var(--store-text); }
.rv-form .btn { justify-self: start; }

.mini-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.mini-card { display: flex; flex-direction: column; gap: 8px; }
.mc-cover { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 2 / 3; }
.mc-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-card .type-dot { position: absolute; top: 8px; inset-inline-start: 8px; width: 26px; height: 26px; }
.mini-card .type-dot .icon { width: 14px; height: 14px; }
.mini-card h3 { font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.mini-card .price { font-size: 14.5px; }

/* ---------------------------------------------------------------- صفحة المؤلّف */
.author-band { background: var(--navy); color: var(--on-navy); padding: 26px 0 56px; }
.author-band .breadcrumb { color: var(--on-navy-muted); }
.author-band .breadcrumb a:hover { color: #FFFFFF; }
.author-band .breadcrumb li + li::before { color: var(--on-navy-muted); }
.author-hero { display: grid; grid-template-columns: 300px 1fr; gap: 50px; align-items: center; margin-top: 26px; }
.ah-photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3 / 4; }
.ah-photo img { width: 100%; height: 100%; object-fit: cover; }
.ah-text .eyebrow { color: var(--on-navy); }
.ah-text h1 { font-size: clamp(34px, 4vw, 54px); font-weight: 800; margin-top: 6px; padding-bottom: 4px; }
.ah-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.bio { margin-top: 18px; max-width: 720px; color: var(--on-navy-muted); }
.bio p + p { margin-top: 10px; }

/* ---------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; padding-block: 36px 60px; }
.cart-box { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 26px; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.cart-head h2 { font-size: 20px; }
.link-btn { border: 0; background: none; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; font-weight: 500; padding: 6px; }
.link-btn:hover { color: var(--store-text); }
.cart-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto auto; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info h3 { font-size: 16px; }
.cart-info p { color: var(--muted); font-size: 14px; }
.cart-type { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; margin-top: 6px; }
.cart-type .type-dot { width: 22px; height: 22px; box-shadow: none; }
.cart-type .type-dot .icon { width: 12px; height: 12px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 42px; }
.qty button { width: 38px; height: 40px; border: 0; background: none; display: grid; place-items: center; }
.qty input { width: 38px; text-align: center; border: 0; background: transparent; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cart-total { font-weight: 700; min-width: 92px; text-align: end; }
.summary { position: sticky; top: 100px; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--white); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.summary h2 { font-size: 20px; }
.coupon { display: flex; gap: 8px; }
.coupon input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; background: var(--white); }
.coupon .btn { min-height: 48px; padding: 0 18px; }
.coupon-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--peach); border: 1px dashed var(--muted); border-radius: 999px; padding: 4px 14px 4px 6px; padding-inline: 14px 6px; font-size: 13.5px; align-self: flex-start; }
.coupon-chip button { border: 0; background: var(--white); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.coupon-chip button .icon { width: 14px; height: 14px; }
.sum-rows { display: grid; gap: 10px; padding: 14px 0; border-block: 1px solid var(--line); }
.sum-rows div { display: flex; justify-content: space-between; font-size: 15px; }
.sum-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; }
.secure { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); justify-content: center; }
.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty .icon { width: 60px; height: 60px; color: var(--store-primary); stroke-width: 1.2; }
.cart-empty h2 { margin: 12px 0 6px; }
.cart-empty p { color: var(--muted); margin-bottom: 18px; }

/* ---------------------------------------------------------------- 404 */
.nf .stage-inner { padding-block: 20px 56px; }
.nf-orbit { width: min(520px, 100%); height: auto; color: var(--store-text); }
.nf-code { font-size: clamp(90px, 12vw, 170px); font-weight: 800; line-height: 1; margin-top: -10px; }
.nf h1 { font-size: clamp(24px, 2.6vw, 34px); margin-top: 8px; }
.nf .capsule { max-width: 620px; margin-top: 24px; }
.nf-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }

/* ---------------------------------------------------------------- صفحة المكوّنات */
.kit-sec { padding: 40px 0; border-bottom: 1px solid var(--line); }
.kit-sec > .container > h2 { font-size: 22px; margin-bottom: 8px; }
.kit-sec > .container > p { color: var(--muted); margin-bottom: 22px; }
.kit-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.kit-gap { margin-top: 18px; }
.kit-top { align-items: flex-start; }
.kit-type { display: inline-flex; align-items: center; gap: 8px; }
.kit-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kit-cards > div > small { display: block; color: var(--muted); margin-bottom: 8px; font-size: 13px; }
.kit-tile { width: 320px; max-width: 100%; height: 230px; }
.kit-tile .mtile { height: 100%; }
.kit-navy { padding: 20px; border-radius: var(--radius-lg); width: 260px; max-width: 100%; }

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

/* ---------------------------------------------------------------- العروض */
@media (max-width: 1200px) {
	.hdr { gap: 14px; }
	.hdr-nav a, .hdr-nav .drop-btn { padding: 0 8px; }
	.slide-cap { width: 200px; top: 22%; }
}
@media (max-width: 1100px) {
	.hdr-nav { display: none; }
	.menu-btn { display: inline-grid; }
	.book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.track .bcard { flex-basis: calc((100% - 2 * var(--gap)) / 3); }
	.pdp { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; }
	.listing { grid-template-columns: 240px 1fr; }
	.listing .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mini-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.mini-row > :nth-child(n+5) { display: none; }
	.foot-cols { grid-template-columns: 1fr 1fr; }
	.facts { grid-template-columns: repeat(2, 1fr); }
	.authors-track .acard { flex-basis: calc((100% - 2 * var(--gap)) / 3); }
}
@media (max-width: 900px) {
	.hdr-actions .hide-md { display: none; }
	.cart-pill .label { display: none; }
	.cart-pill { padding-inline: 12px 6px; }
	.mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 170px); }
	.mosaic .mtile:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
	.mosaic .mtile:nth-child(2) { grid-column: 2; grid-row: 1; }
	.mosaic .mtile:nth-child(3) { grid-column: 2; grid-row: 2; }
	.mosaic .mtile:nth-child(4) { grid-column: 1 / 3; grid-row: 3; }
	.mosaic .mtile:nth-child(5) { grid-column: 1; grid-row: 4; }
	.mosaic .mtile:nth-child(6) { grid-column: 2; grid-row: 4; }
	.wide-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.wide-grid::-webkit-scrollbar { display: none; }
	.wide-grid > .wcard { flex: 0 0 min(78%, 360px); scroll-snap-align: start; }
	.news-grid { grid-template-columns: 1.3fr .7fr; gap: 20px; min-height: 0; }
	.pdp { display: flex; flex-direction: column; gap: 0; }
	.pdp > div:first-child { display: contents; }
	.pdp > div:first-child > * { order: 2; }
	.pdp > div:first-child > .gallery { order: 0; }
	.buy-box { position: static; order: 1; margin-top: 24px; }
	.listing { grid-template-columns: 1fr; }
	.filters {
		position: fixed; inset-block: 0; inset-inline-start: 0; width: min(360px, 90vw); z-index: 61; background: var(--white);
		padding: 20px; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .3s;
	}
	.filters-open .filters { transform: none; visibility: visible; }
	.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
	.filters-head { display: flex; justify-content: space-between; align-items: center; }
	.filters-toggle { display: inline-flex; }
	.listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cart-layout { grid-template-columns: 1fr; }
	.summary { position: static; }
	.author-hero { grid-template-columns: 220px 1fr; gap: 30px; }
	.kit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wb-card { margin: 24px; margin-inline-start: auto; }
	/* السلايدر: البطاقة تحت الرسم */
	.hero-art { aspect-ratio: auto; display: flex; flex-direction: column; }
	.slides { position: relative; display: grid; }
	.slide { position: relative; grid-area: 1 / 1; inset: auto; display: flex; flex-direction: column-reverse; align-items: center; }
	.slide img { position: relative; inset: auto; height: auto; aspect-ratio: 1600 / 600; }
	.slide-cap { position: relative; top: auto; inset-inline-start: auto; width: auto; max-width: calc(100% - 40px); flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 10px 16px; border-radius: 999px; margin-top: 18px; text-align: center; }
	.slide-cap span { display: none; }
	.slide-cap a { margin-top: 0; }
	.hero-dots { position: static; flex-direction: row; justify-content: center; padding: 12px 0 0; }
	.hero-dots button[aria-current="true"] { width: 26px; height: 8px; }
	.hero-art { margin-top: 0; padding-bottom: 0; }
	.slide img { margin-top: 18px; }
}
@media (max-width: 767px) {
	.section { padding-block: 46px; }
	.hdr { min-height: 66px; gap: 4px; }
	.brand img { width: 34px; height: 34px; }
	.brand-name { font-size: 19px; }
	.hdr-actions { gap: 2px; }
	.hdr-actions .hide-sm { display: none; }
	.stage-home .stage-inner { padding-top: 22px; }
	/* البحث في الهاتف: حقل الكلمة وحده بزرٍّ دائريّ، والتصفية في صفحة التصنيف */
	.capsule { padding: 6px; padding-inline-start: 10px; }
	.cs-field { border-inline-end: 0; padding: 4px 6px; }
	.capsule .cs-field:not(:first-child) { display: none; }
	.capsule .cs-go { width: 48px; height: 48px; }
	.sec-head { align-items: center; }
	.sec-tools .track-arrow { display: none; }
	.book-grid, .listing .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); --gap: 14px; }
	.track { --gap: 14px; }
	.track .bcard { flex-basis: calc((100% - var(--gap)) / 2); }
	.bcard { padding: 8px; }
	.bcard-body { padding: 12px 2px 2px; }
	.bcard-title { font-size: 15px; }
	.price { font-size: 15.5px; }
	.price-lg { font-size: 26px; }
	.is-list .bcard-media { width: 110px; }
	.is-list .bcard { gap: 14px; }
	.authors-track .acard { flex-basis: 64%; }
	.wide-banner { flex-direction: column; align-items: stretch; min-height: 0; }
	.wide-banner > img { position: relative; height: 200px; }
	.wb-card { margin: -40px 14px 14px; width: auto; padding: 22px; }
	.news-form { flex-direction: column; }
	.news-form input { flex: none; width: 100%; }
	.slide img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 100%; }
	.news-grid { grid-template-columns: 1fr; gap: 8px; padding-block: 40px 30px; }
	.news-art img { max-width: 230px; margin-inline: auto; }
	.foot-cols { grid-template-columns: 1fr; gap: 26px; }
	.foot-call { font-size: 16px; }
	.gallery { grid-template-columns: 1fr; }
	.g-side { grid-template-columns: 1fr 1fr; }
	.g-main img { max-width: 210px; }
	.checks { grid-template-columns: 1fr; }
	.rv-summary { grid-template-columns: 1fr; }
	.rv-picker { gap: 10px; }
	.rv-picker button { width: 48px; height: 48px; font-size: 18px; }
	.chap p { padding-inline-start: 18px; }
	.mini-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.mini-row > :nth-child(n+4) { display: none; }
	.cart-box { padding: 6px 16px; }
	.cart-row { position: relative; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "t i i" "t q s"; gap: 10px 14px; }
	.cart-row .cart-info { grid-area: i; padding-inline-end: 40px; }
	.cart-row .cart-thumb { grid-area: t; }
	.cart-row .qty { grid-area: q; justify-self: start; }
	.cart-row .cart-total { grid-area: s; }
	.cart-row .rm { position: absolute; top: 14px; inset-inline-end: -8px; }
	.author-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.ah-photo { width: 200px; }
	.ah-stats { justify-content: center; }
	.author-band .breadcrumb { justify-content: center; }
	.stile { flex-basis: 160px; height: 110px; }
	.to-top { bottom: 16px; inset-inline-end: 16px; }
	.toolbar .count-text { order: 3; width: 100%; }
}
@media (max-width: 480px) {
	.facts { grid-template-columns: 1fr 1fr; }
	.fact { flex-direction: column; align-items: flex-start; gap: 8px; }
	.kit-cards { grid-template-columns: 1fr 1fr; }
	.select { min-width: 0; }
}

/* ================= ميزات المنصّة المعتمدة (SPEC، الملحق 8) ================= */

/* المدوّنة: بطاقة المقال على شكل البطاقة العريضة */
.pcard-media { aspect-ratio: 16 / 10; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard .wcard-meta .icon { width: 15px; height: 15px; }
.pcard h3 { line-height: 1.45; }
.post-grid { row-gap: 40px; }
.post-grid + .pagination { margin-top: 44px; }
.post-title { max-width: 900px; margin-inline: auto; }
.post .stage-text { display: inline-flex; align-items: center; gap: 6px; }
.post .stage-text .icon { width: 16px; height: 16px; }
.post-wrap { max-width: 880px; padding-block: 8px 56px; }
.post-hero { margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--tint); }
.post-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-body { padding-top: 34px; font-size: 18px; line-height: 1.95; }
.post-body p + p { margin-top: 18px; }

/* شريط التطبيق: قسيمة الترحيب وكود الخصم وروابط التطبيق */
.news-offer { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px !important; font-weight: 700; }
.news-offer .icon { width: 18px; height: 18px; }
.news-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 22px; }
.news-coupon { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; padding-inline-start: 16px; border: 1.5px dashed rgba(255, 255, 255, .7); border-radius: var(--radius); }
.nc-label { font-size: 14px; }
.news-coupon b { font-size: 17px; letter-spacing: .08em; }
.news-coupon button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--white); color: var(--store-text); font-weight: 700; font-size: 14px; }
.news-coupon button:hover { background: var(--peach); }
.news-coupon .icon { width: 16px; height: 16px; }
.app-links { display: flex; flex-wrap: wrap; gap: 10px; }
.app-badge { display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 16px 0 18px; border-radius: var(--radius); background: var(--store-text); color: #FFFFFF; border: 1px solid rgba(255, 255, 255, .25); transition: background .2s; }
.app-badge:hover { background: #000; }
.app-badge .icon { width: 22px; height: 22px; }
.app-badge span { display: grid; line-height: 1.15; }
.app-badge small { font-size: 11px; color: rgba(255, 255, 255, .85); }
.app-badge b { font-size: 15px; }
.foot-apps { margin-top: 26px; }
.foot-apps h3 { margin-bottom: 12px !important; }
.foot-apps .app-badge { background: rgba(255, 255, 255, .08); }
.foot-apps .app-badge:hover { background: rgba(255, 255, 255, .16); }

/* الطلب المسبق */
.badge-pre { background: var(--store-text); color: #FFFFFF; }
.release { position: absolute; bottom: 10px; inset-inline-start: 10px; display: flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 700; color: var(--primary-ink); white-space: nowrap; }
.release .icon { width: 15px; height: 15px; }

@media (max-width: 900px) {
	.post-grid { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
	.post-grid > .wcard { flex: none; }
}
@media (max-width: 600px) {
	.post-grid { grid-template-columns: 1fr; }
	.post-body { font-size: 16px; padding-top: 24px; }
	.news-coupon { width: 100%; }
	.release { bottom: 8px; inset-inline-start: 6px; padding: 2px 8px; font-size: 11px; gap: 4px; }
	.release .icon { width: 13px; height: 13px; }
	.news-coupon b { margin-inline-end: auto; }
}

/* ================= الرئيسيّة: كتاب الأسبوع، والأكثر طلبًا، ورفوف المدار ================= */

/* الشريط البنفسجيّ الفاتح بمدارٍ منقّط */
.band-orbit { position: relative; overflow: hidden; background: var(--tint-accent); }
.band-orbit::before, .band-orbit::after {
	content: ""; position: absolute; pointer-events: none; border-radius: 50%; aspect-ratio: 2.4;
	border: 2px dashed color-mix(in srgb, var(--store-accent) 28%, transparent); transform: rotate(-12deg);
}
.band-orbit::before { width: 980px; top: -170px; inset-inline-end: -260px; }
.band-orbit::after { width: 620px; bottom: -150px; inset-inline-start: -180px; }
.band-orbit:not(:has([data-region])) { display: none; }
.deal-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.deal-grid > :only-child { grid-column: 1 / -1; }
.deal, .toplist { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.deal { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.deal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; }
.deal-head .sec-title { margin-top: 4px; }
.countdown { display: flex; align-items: center; gap: 6px; }
.cd-label { color: var(--muted); font-size: 14px; margin-inline-end: 4px; }
.cd-unit { display: grid; place-items: center; min-width: 54px; padding: 6px 4px 5px; border-radius: 12px; background: var(--store-text); color: #FFFFFF; line-height: 1.15; }
.cd-unit b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 11.5px; }
.deal-items { flex: 1; display: flex; }
.feat { flex: 1; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 30px; align-items: center; }
.feat-media { position: relative; padding: 24px 30px; border-radius: var(--radius-lg); background: var(--peach); overflow: hidden; }
.feat-media::before { content: ""; position: absolute; inset-inline-start: -30%; top: 34%; width: 160%; aspect-ratio: 2.4; border: 2px dashed color-mix(in srgb, var(--store-primary) 30%, transparent); border-radius: 50%; transform: rotate(-12deg); }
.feat-cover { position: relative; display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 2 / 3; box-shadow: 0 18px 34px rgba(5, 7, 60, .24); transition: transform .4s; }
.feat:hover .feat-cover { transform: translateY(-4px) rotate(-2deg); }
.feat-cover img { width: 100%; height: 100%; object-fit: cover; }
.feat-media .type-dot { position: absolute; z-index: 1; top: 12px; inset-inline-start: 12px; }
.feat-media .bcard-badges { top: 12px; inset-inline-end: 12px; z-index: 1; }
.feat-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.feat-title { font-size: clamp(22px, 2.1vw, 28px); font-weight: 800; }
.feat-title a:hover { color: var(--primary-ink); }
.feat-desc { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feat-foot { width: 100%; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.feat-actions { display: flex; gap: 8px; }

/* الأكثر طلبًا: قائمةٌ مرقّمة مدمجة */
.toplist { padding: 24px 24px 8px; }
.toplist .sec-head { margin-bottom: 6px; }
.top-items { counter-reset: top; }
.top-item { counter-increment: top; display: grid; grid-template-columns: 26px 50px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.top-item:first-child { border-top: 0; }
.top-item::before { content: counter(top); font-size: 24px; font-weight: 800; color: var(--store-primary); text-align: center; }
.top-cover { position: relative; display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 2 / 3; box-shadow: var(--shadow-sm); }
.top-cover img { width: 100%; height: 100%; object-fit: cover; }
.top-cover .type-dot { position: absolute; top: 4px; inset-inline-start: 4px; width: 22px; height: 22px; box-shadow: none; }
.top-cover .type-dot .icon { width: 12px; height: 12px; }
.top-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top-body h3 { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-body h3 a:hover { color: var(--primary-ink); }
.top-body .rating { font-size: 12.5px; }
.top-end { display: flex; align-items: center; gap: 10px; }
.top-end .price { font-size: 15px; flex-direction: column; align-items: flex-end; gap: 0; }
.top-end .cart-mini { width: 36px; height: 36px; }
@media (max-width: 767px) { .cart-mini, .top-end .cart-mini { width: 40px; height: 40px; } } /* لمسٌ مريح في الجوّال، والشكل الأصليّ نفسه */

/* رفوف المدار: تبويباتٌ كبسوليّة في رأس القسم */
.sec-head.has-tabs { flex-wrap: wrap; align-items: center; }
.row-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--peach); margin-inline: auto; }
.row-tab { height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-weight: 500; font-size: 15px; white-space: nowrap; transition: background .2s, color .2s; }
.row-tab:hover { color: var(--primary-ink); }
.row-tab[aria-selected="true"] { background: var(--store-text); color: #FFFFFF; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }
/* صفّان كاملان بحسب عدد الكتب في الصفّ، فلا يبقى صفٌّ ناقص */
body[data-books-per-row="3"] .tabs-grid > :nth-child(n+7),
body[data-books-per-row="5"] .tabs-grid > :nth-child(n+6) { display: none; }

@media (max-width: 1100px) {
	.why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
	.why-item, .why-item:first-child { border: 0; padding: 0; }
	.deal-grid { grid-template-columns: 1fr; }
	.tabs-grid > :nth-child(n+7) { display: none; }
	body[data-books-per-row="5"] .tabs-grid > :nth-child(6) { display: flex; }
}
@media (max-width: 767px) {
	.why { padding-block: 12px; }
	.why-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 10px; margin-inline: -20px; padding-inline: 20px; }
	.why-grid::-webkit-scrollbar { display: none; }
	.why-item, .why-item:first-child { flex: 0 0 auto; max-width: 78%; scroll-snap-align: start; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 8px 10px; padding-inline: 10px 14px; gap: 10px; }
	.why-ico { width: 40px; height: 40px; border-radius: 12px; }
	.why-ico .icon { width: 22px; height: 22px; }
	.why-item h3 { font-size: 14.5px; white-space: nowrap; }
	.why-item p { font-size: 12.5px; white-space: nowrap; }
	.deal { padding: 18px; gap: 16px; }
	.countdown { width: 100%; }
	.cd-label { margin-inline-end: auto; }
	.cd-unit { min-width: 50px; }
	.feat { grid-template-columns: 124px minmax(0, 1fr); gap: 16px; align-items: start; }
	.feat-media { padding: 14px; }
	.feat-media .type-dot { top: 6px; inset-inline-start: 6px; width: 28px; height: 28px; }
	.feat-media .bcard-badges { top: auto; bottom: 6px; inset-inline-end: 6px; }
	.feat-title { font-size: 20px; }
	.feat-desc { font-size: 14px; -webkit-line-clamp: 4; }
	.feat-foot, .feat-desc { grid-column: 1 / -1; }
	.feat-body { display: contents; }
	.feat-body > :not(.feat-foot):not(.feat-desc) { grid-column: 2; }
	.feat { grid-template-rows: repeat(3, auto) 1fr; row-gap: 6px; }
	.feat-media { grid-row: 1 / 5; }
	.feat .price-lg { align-self: start; }
	.feat-actions .btn { padding: 0 16px; }
	.toplist { padding: 18px 16px 4px; }
	.top-item { grid-template-columns: 22px 50px minmax(0, 1fr); gap: 4px 12px; }
	.top-item::before { grid-row: 1 / 3; }
	.top-cover { grid-row: 1 / 3; }
	.top-end { grid-column: 3; justify-content: space-between; }
	.top-end .price { flex-direction: row; align-items: baseline; gap: 8px; }
	.sec-head.has-tabs .row-tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
	.row-tabs::-webkit-scrollbar { display: none; }
	.row-tab { flex: none; height: 38px; padding: 0 14px; font-size: 14px; }
	.tabs-grid > :nth-child(n+5), body[data-books-per-row="5"] .tabs-grid > :nth-child(6) { display: none; }
}

/* صفحة التصنيف: التصفية المختارة */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; padding-inline: 14px 10px; border-radius: 999px; background: var(--peach); border: 1px solid color-mix(in srgb, var(--store-primary) 22%, transparent); font-size: 14px; font-weight: 500; }
.chip .icon { width: 15px; height: 15px; }
.chip:hover { border-color: var(--store-primary); }
.chip-clear { font-size: 14px; font-weight: 700; color: var(--primary-ink); text-decoration: underline; text-underline-offset: 4px; padding: 6px; }

/* صفحة المؤلّف: الأعمال دوّارٌ أفقيّ بنقاط، فلا يبقى صفٌّ ناقص */
.track-dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.track-dots:empty { display: none; }
.track-dots button { width: 10px; height: 10px; }
.track-dots button[aria-current="true"] { width: 28px; height: 10px; background: var(--store-primary); }

/* صفحة الكتاب: اختيار النسخة، والكمّيّة بجانب زرّ السلّة */
.formats-box { display: grid; gap: 8px; }
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.format-opt { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: var(--radius); text-align: center; transition: border-color .2s, background .2s; }
.format-opt:hover { border-color: var(--store-text); }
.format-opt.is-current { border-color: var(--store-primary); background: var(--peach); }
.format-opt .type-dot { width: 28px; height: 28px; box-shadow: none; margin-bottom: 2px; }
.format-opt .type-dot .icon { width: 15px; height: 15px; }
.format-name { font-weight: 700; font-size: 14px; }
.format-price { font-size: 13px; color: var(--muted); }
.bb-buy { display: flex; gap: 10px; }
.bb-buy .btn { flex: 1; padding-inline: 16px; }
.bb-buy .qty { height: 54px; border-radius: var(--radius); flex: none; }
.bb-buy .qty button { height: 52px; font-size: 18px; }
.cd-label { white-space: nowrap; }

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