/* =====================================================================
   رحيق — قالب واجهة متجر كتب لمنصّة «ناشر»
   ثنائيّة أخضر نعناعيّ وبنفسجيّ داكن، وعناوين مستديرة، ودوائر باستيليّة.
   ألوان الهويّة متغيّراتٌ يختارها الناشر؛ وما عداها ألوانٌ محايدة.
   ===================================================================== */
:root {
	--store-primary: #43B18A;
	--store-primary-dark: #291F51;
	--store-accent: #FFF0D9;
	--store-bg: #FFFFFF;
	--store-text: #291F51;

	--muted: #5D5A6E;
	--line: #E7E5EC;
	--panel: #F7F7F7;
	--field: #F3F3F5;
	--sale: #C9302C;
	--gold: #F5A623;
	--white: #FFFFFF;

	/* درجاتٌ باستيليّة مشتقّة من ألوان المتجر */
	--mint: color-mix(in srgb, var(--store-primary) 16%, #fff);
	--mint-2: color-mix(in srgb, var(--store-primary) 28%, #fff);
	--lilac: color-mix(in srgb, var(--store-primary-dark) 9%, #fff);
	--peach: var(--store-accent);
	--sage: color-mix(in srgb, var(--store-primary) 30%, var(--store-accent));
	--mist: #F1F1F4;
	--plum-1: var(--store-primary-dark);
	--plum-2: color-mix(in srgb, var(--store-primary-dark) 86%, #fff);
	--plum-3: color-mix(in srgb, var(--store-primary-dark) 74%, #fff);

	--type-print: #DB7056;
	--type-ebook: #5675A3;
	--type-audio: #986AB0;
	--type-edu: #3f8f6b;

	--font-head: "Baloo Bhaijaan 2", "Tajawal", system-ui, sans-serif;
	--font-body: "Tajawal", system-ui, sans-serif;
	--radius: 6px;
	--radius-lg: 14px;
	--container: 1290px;
	--gutter: 20px;
	--per-row: 4;
	--shadow: 0 10px 30px rgba(41, 31, 81, .10);
}

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%; overflow-x: clip; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.7;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: clip;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0; font-weight: 700; color: var(--store-text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--store-primary-dark); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }

/* ------------------------------ الأزرار ------------------------------ */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 0 26px; border: 1px solid transparent; border-radius: 4px;
	font-weight: 500; font-size: 15px; white-space: nowrap;
	transition: background .2s, color .2s, border-color .2s;
}
.btn .icon { width: 18px; height: 18px; }
/* الأخضر بنصٍّ داكن: الأبيض على الأخضر لا يبلغ 4.5 */
.btn-green { background: var(--store-primary); color: var(--store-primary-dark); }
.btn-green:hover { background: var(--store-primary-dark); color: var(--white); }
.btn-plum { background: var(--store-primary-dark); color: var(--white); }
.btn-plum:hover { background: var(--store-primary); color: var(--store-primary-dark); }
.btn-line { background: var(--white); border-color: var(--line); color: var(--store-text); }
.btn-line:hover { border-color: var(--store-primary-dark); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 0 30px; }
.btn-block { width: 100%; }
.btn[disabled] { background: var(--mist); border-color: var(--mist); color: var(--muted); cursor: not-allowed; }

.icon-btn {
	position: relative; display: inline-grid; place-items: center;
	width: 42px; height: 42px; border: 0; background: none; border-radius: 50%; color: var(--store-text);
}
.icon-btn .icon { width: 23px; height: 23px; }
.count-dot {
	position: absolute; top: 0; inset-inline-end: -2px;
	min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px;
	background: var(--store-primary); color: var(--store-primary-dark);
	font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
}

/* ---------------------------- شريط الإعلان ---------------------------- */
.announce { border-bottom: 1px solid var(--line); background: var(--white); font-size: 13.5px; color: var(--muted); }
.ann-list { display: flex; justify-content: space-between; gap: 20px; min-height: 42px; align-items: center; }
.ann-list li { display: flex; align-items: center; gap: 6px; }
.ann-list li::before {
	content: ""; width: 14px; height: 14px; flex: none; background: var(--store-primary);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m4 12.5 5 5L20 6.5' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m4 12.5 5 5L20 6.5' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
}
.announce:not(:has(li)) { display: none; }

/* -------------------------------- الرأس -------------------------------- */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--white); box-shadow: 0 1px 0 var(--line); }
.hdr-main { display: flex; align-items: center; gap: 22px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.brand img { width: 46px; height: 46px; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 27px; line-height: 1; color: var(--store-primary-dark); }
.hdr-search { flex: 1; max-width: 560px; margin-inline-start: auto; display: flex; align-items: center; background: var(--field); border-radius: 4px; }
.hdr-search input { flex: 1; min-width: 0; height: 46px; border: 0; background: none; padding: 0 16px; font-size: 15px; }
.hdr-search input::placeholder { color: var(--muted); }
.hdr-search input:focus { outline: none; }
.hdr-search:focus-within { box-shadow: inset 0 0 0 1px var(--store-primary-dark); }
.hdr-search .icon-btn { border-radius: 4px; }
.hdr-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle, .search-toggle { display: none; }

.hdr-nav { background: var(--store-primary); }
.hdr-nav .container { display: flex; align-items: stretch; gap: 28px; }
.browse { position: relative; flex: none; width: 300px; }
.browse-btn {
	display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; padding: 0 18px;
	border: 0; background: var(--store-primary-dark); color: var(--white); font-weight: 500; font-size: 15px;
}
.browse-btn .chev { margin-inline-start: auto; transition: transform .2s; }
.browse.open .browse-btn .chev { transform: rotate(180deg); }
.browse-panel {
	position: absolute; inset-inline: 0; top: 100%; z-index: 5; background: var(--white);
	border: 1px solid var(--line); border-top: 0; box-shadow: var(--shadow); padding: 8px 0;
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.browse.open .browse-panel { opacity: 1; visibility: visible; transform: none; }
.browse-panel a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; font-size: 15px; }
.browse-panel a:hover { background: var(--mint); }
.browse-panel a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--store-primary); flex: none; }
.main-nav ul { display: flex; align-items: center; gap: 30px; height: 100%; }
.main-nav a { position: relative; display: inline-flex; align-items: center; height: 50px; font-weight: 500; color: var(--store-primary-dark); }
.main-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.nav-tag {
	position: absolute; top: 4px; inset-inline-end: -26px; padding: 0 5px; border-radius: 3px;
	background: var(--sale); color: var(--white); font-size: 10px; line-height: 15px; font-weight: 700;
}

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(41, 31, 81, .45); opacity: 0; visibility: hidden; transition: .25s; }
.drawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 91; width: min(340px, 88vw);
	background: var(--white); overflow-y: auto; transform: translateX(100%); transition: transform .3s; visibility: hidden;
}
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head .brand-name { font-size: 22px; }
.drawer-head .brand img { width: 38px; height: 38px; }
.drawer-title { display: block; padding: 12px 16px; background: var(--store-primary-dark); color: var(--white); font-weight: 500; }
.drawer-cats a, .drawer-links a { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.drawer-cats a { background: var(--mint); color: var(--store-primary-dark); }
.drawer-contact { padding: 16px; display: grid; gap: 10px; color: var(--muted); }
.drawer-contact a { display: flex; align-items: center; gap: 8px; }

/* --------------------------- عناوين الأقسام --------------------------- */
.section { padding: 70px 0; }
.section-sm { padding: 46px 0; }
.sec-head { text-align: center; margin-bottom: 34px; }
.sec-title { font-size: clamp(26px, 3vw, 36px); font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.sec-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }

/* ------------------------------ الافتتاح ------------------------------ */
.hero { padding: 30px 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: stretch; }
.slider { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--mint); min-height: 507px; }
.slides { position: relative; height: 100%; min-height: 507px; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide > a { display: block; height: 100%; }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.slide-copy {
	position: absolute; inset-block: 0; inset-inline-end: 0; width: 46%; padding: 0 3% 0 4%;
	display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px;
}
.slide-kicker { font-weight: 700; font-size: 17px; color: var(--store-primary-dark); }
.slide-title { font-size: clamp(34px, 4.2vw, 56px); font-weight: 800; line-height: 1.15; color: var(--store-primary-dark); }
.slide-copy .btn { margin-top: 8px; }
.slider-arrow {
	position: absolute; top: 50%; z-index: 3; width: 36px; height: 36px; margin-top: -18px; border: 0; border-radius: 3px;
	display: grid; place-items: center; background: var(--store-primary); color: var(--store-primary-dark);
}
.slider-arrow.prev { inset-inline-start: 30px; }
.slider-arrow.next { inset-inline-end: 30px; }
.slider-dots { position: absolute; bottom: 22px; inset-inline: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.slider-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--store-primary-dark) 30%, transparent); }
.slider-dots button[aria-current="true"] { background: var(--store-primary-dark); width: 22px; border-radius: 5px; }

.hero-side { display: grid; gap: 30px; grid-auto-rows: 1fr; }
.hero-side .hcard { height: 100%; }
/* إن أُخفي السلايدر تصير البطاقات الثلاث صفًّا واحدًا */
.hero-grid:not(:has(.slider)) { grid-template-columns: 1fr; }
.hero-grid:not(:has(.slider)) .hero-side { grid-template-columns: repeat(3, 1fr); }

/* البطاقة الأفقيّة */
.hcard { display: grid; grid-template-columns: 118px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; position: relative; }
.hc-media { position: relative; background: var(--panel); display: grid; place-items: center; padding: 16px 14px; }
.hc-media img { width: 78px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.hc-media .type-dot { position: absolute; top: 8px; inset-inline-start: 8px; width: 24px; height: 24px; }
.hc-media .type-dot .icon { width: 13px; height: 13px; }
.hc-body { padding: 14px 14px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.hc-body .bc-foot { margin-top: 4px; }
.hc-body .bc-author { font-size: 13px; }
.hc-body .bc-title { font-size: 16px; }
.hcard > .badge { position: absolute; bottom: 8px; inset-inline-start: 8px; }

/* -------------------------- دوائر المزايا -------------------------- */
.features-sec { padding: 60px 0 30px; }
.features { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; text-align: center; }
.features li { display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 16px; font-weight: 500; }
.features li::before {
	content: ""; width: 96px; height: 96px; border-radius: 50%; background-color: var(--mint);
	background-image: var(--ico); background-repeat: no-repeat; background-position: center; background-size: 44px;
}
.features li:nth-child(6n+1)::before { background-color: var(--mint); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(41,31,81)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><path d='M12 6.5C10 5 7.5 4.5 4 4.5v13c3.5 0 6 .5 8 2 2-1.5 4.5-2 8-2v-13c-3.5 0-6 .5-8 2Z'/><path d='M12 6.5v13'/></svg>"); }
.features li:nth-child(6n+2)::before { background-color: var(--peach); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(41,31,81)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='3' width='9' height='13' rx='1.5'/><rect x='11' y='8' width='9' height='13' rx='1.5'/><path d='M14 12h3M14 15h3'/></svg>"); }
.features li:nth-child(6n+3)::before { background-color: var(--lilac); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(41,31,81)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><path d='m12 3 8 4.5v9L12 21l-8-4.5v-9Z'/><path d='m4 7.5 8 4.5 8-4.5M12 12v9'/></svg>"); }
.features li:nth-child(6n+4)::before { background-color: var(--sage); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(41,31,81)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><path d='m12 2.8 2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3L2.9 9.5l6.3-.9Z'/></svg>"); }
.features li:nth-child(6n+5)::before { background-color: var(--mist); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(41,31,81)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3'/><circle cx='17' cy='10' r='2.2'/><path d='M3.5 19c0-3 2.5-5 5.5-5s5.5 2 5.5 5M14.5 19c.2-2.3 1.2-3.8 3-3.8 1.8 0 2.8 1.5 3 3.8'/></svg>"); }
.features li:nth-child(6n+6)::before { background-color: var(--mint-2); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(41,31,81)' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h11v10H3zM14 9h4l3 3.5V16h-7'/><circle cx='7' cy='17.5' r='1.8'/><circle cx='17.5' cy='17.5' r='1.8'/></svg>"); }
.features-sec:not(:has(li)) { display: none; }

/* ------------------------------ بانر القصّة ------------------------------ */
.story { display: grid; grid-template-columns: 1fr 1.42fr; gap: 40px; align-items: center; }
.story-copy { text-align: center; max-width: 440px; margin-inline: auto; display: grid; gap: 16px; justify-items: center; }
.story-copy h2 { font-size: clamp(26px, 2.6vw, 32px); }
.story-copy p { color: var(--muted); }
.story-media { position: relative; border-radius: var(--radius); overflow: hidden; }
.story-media img { width: 100%; aspect-ratio: 1000 / 560; object-fit: cover; }

/* ------------------------------ التصنيفات ------------------------------ */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px; }
.cat-tile { display: grid; justify-items: center; gap: 10px; text-align: center; }
.cat-tile .ct-img { width: 100%; max-width: 160px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--mint); transition: transform .25s; }
.cat-tile:hover .ct-img { transform: translateY(-4px); }
.cat-tile .ct-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile b { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.cat-tile small { color: var(--muted); font-size: 14px; margin-top: -8px; }

/* ----------------------------- بطاقة الكتاب ----------------------------- */
.book-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.bc-media { position: relative; background: var(--panel); border-radius: var(--radius); aspect-ratio: 4 / 5; display: grid; place-items: center; }
.bc-cover { display: block; width: 58%; transition: transform .3s; }
.bc-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 12px 22px rgba(0, 0, 0, .2); }
.book-card:hover .bc-cover { transform: translateY(-6px); }
.type-dot {
	display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--white);
	box-shadow: 0 0 0 2px var(--white);
}
.type-dot .icon { width: 16px; height: 16px; stroke-width: 1.9; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-edu); }
.bc-media > .type-dot { position: absolute; top: 12px; inset-inline-start: 12px; }
.bc-badges { position: absolute; top: 12px; inset-inline-end: 12px; display: grid; gap: 6px; justify-items: end; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 13px; font-weight: 700; line-height: 22px; }
.badge-sale { background: var(--sale); color: var(--white); }
.badge-new { background: var(--store-primary-dark); color: var(--white); }
.bc-out {
	position: absolute; inset-inline: 12px; bottom: 50%; transform: translateY(50%); padding: 6px; text-align: center;
	background: rgba(255, 255, 255, .94); color: var(--store-text); font-weight: 700; font-size: 14px; border-radius: 4px;
}
.book-card.is-out .bc-cover { opacity: .55; }
.book-card.is-out .bc-price { color: var(--muted); }
/* شريط القالب الأصليّ: المفضّلة والسلّة والنظرة السريعة دوائر بيضاء على حافّة الغلاف السفلى، ظاهرةٌ دائمًا (البند 7) */
.bc-tools { position: absolute; bottom: -20px; inset-inline: 0; z-index: 2; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.bc-tools button {
	width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--white); color: var(--store-text);
	display: grid; place-items: center; box-shadow: 0 4px 12px rgba(41, 31, 81, .16); transition: .2s; pointer-events: auto;
}
.bc-tools button:hover { background: var(--store-primary); color: var(--store-primary-dark); }
.bc-tools button[disabled] { opacity: .5; cursor: not-allowed; }
.bc-tools .icon { width: 18px; height: 18px; }
.bc-body { padding-top: 32px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
/* صفّ السعر يُدفع وحده إلى أسفل البطاقة؛ وزرّ السلّة في البطاقة الأفقيّة دائرةٌ بيضاء كأزرار الشريط */
.bc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.bc-cart {
	flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
	background: var(--white); color: var(--store-text); box-shadow: 0 4px 12px rgba(41, 31, 81, .16); transition: .2s;
}
.bc-cart:hover { background: var(--store-primary); color: var(--store-primary-dark); }
.bc-cart .icon { width: 18px; height: 18px; }
.bc-cart[disabled] { opacity: .5; cursor: not-allowed; }
.bc-title { font-family: var(--font-body); font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--store-text); }
.bc-title a:hover { color: var(--store-primary-dark); text-decoration: underline; }
.bc-author { color: var(--muted); font-size: 14px; }
.bc-price { font-weight: 700; color: var(--store-primary-dark); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.bc-price del, .price del { color: var(--muted); font-weight: 400; font-size: .9em; }
.rating { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 15px; height: 15px; }
.stars .off { color: #D9D6E0; }

/* أشكال البطاقة */
body[data-card-style="framed"] .book-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 14px; }
body[data-card-style="framed"] .bc-media { background: var(--white); }
body[data-card-style="plain"] .bc-media { background: none; aspect-ratio: 2 / 3; }
body[data-card-style="plain"] .bc-cover { width: 100%; }

/* الشبكات والدوّارات */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 40px 30px; }
.carousel { position: relative; }
.car-track {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per-row) - 1) * 30px) / var(--per-row));
	gap: 30px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px;
}
.car-track::-webkit-scrollbar { display: none; }
.car-track > * { scroll-snap-align: start; }
.car-arrow {
	position: absolute; top: 34%; z-index: 4; width: 34px; height: 34px; border: 0; border-radius: 3px;
	display: grid; place-items: center; background: var(--store-primary); color: var(--store-primary-dark);
}
.car-arrow.prev { inset-inline-start: -52px; }
.car-arrow.next { inset-inline-end: -52px; }
.car-arrow[disabled] { opacity: .35; cursor: default; }
.car-arrow .icon { width: 18px; height: 18px; }

/* --------------------------- ألواح الثقة --------------------------- */
.trust-bar { display: grid; grid-template-columns: repeat(3, 1fr); }
.trust-panel { padding: 30px 40px; color: var(--white); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-content: center; }
.trust-panel .icon { grid-row: span 2; align-self: center; }
.trust-panel:nth-child(1) { background: var(--plum-1); }
.trust-panel:nth-child(2) { background: var(--plum-2); }
.trust-panel:nth-child(3) { background: var(--plum-3); }
.trust-panel h3 { color: var(--white); font-size: 21px; }
.trust-panel p { max-width: 360px; font-size: 14.5px; line-height: 1.6; }
.trust-panel .icon { width: 38px; height: 38px; stroke-width: 1.4; }

/* --------------------------- الكتاب المميّز --------------------------- */
.featured .container { max-width: 1120px; }
.featured .feat-book { align-items: center; }
.feat-book { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.gallery-main { position: relative; background: var(--panel); border-radius: var(--radius); aspect-ratio: 1; display: grid; place-items: center; }
.gallery-main img { width: 52%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 18px 36px rgba(0, 0, 0, .22); border-radius: 2px; }
.gallery-main > .type-dot { position: absolute; top: 16px; inset-inline-start: 16px; width: 36px; height: 36px; }
.gallery-main > .type-dot .icon { width: 19px; height: 19px; }
.gallery-main .bc-badges { top: 16px; inset-inline-end: 16px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.thumbs button { padding: 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; display: grid; place-items: center; }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); box-shadow: inset 0 0 0 1px var(--store-primary); }
.thumbs img { width: 56%; aspect-ratio: 2 / 3; object-fit: cover; }
.feat-info { display: grid; gap: 14px; }
.feat-info > h3, .feat-info > h1 { font-size: clamp(22px, 2.2vw, 30px); }
.feat-info .feat-desc { padding-top: 14px; border-top: 1px solid var(--line); }
.feat-kicker { font-size: 14px; font-weight: 700; color: var(--store-primary-dark); display: inline-flex; align-items: center; gap: 8px; }
.feat-kicker::before { content: ""; width: 26px; height: 3px; border-radius: 2px; background: var(--store-primary); }
.feat-author { color: var(--muted); }
.feat-author a { color: var(--store-text); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.price-lg { font-size: 22px; font-weight: 800; color: var(--store-primary-dark); display: flex; gap: 10px; align-items: baseline; }
.feat-desc { color: var(--muted); font-size: 15.5px; }
.opt-row { display: grid; gap: 8px; }
.opt-label { font-weight: 700; display: flex; gap: 10px; }
.opt-label span { font-weight: 400; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
	display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 14px; border-radius: 3px;
	background: var(--panel); border: 1px solid var(--panel); font-size: 14px; color: var(--store-text);
}
.pill .type-dot { width: 20px; height: 20px; box-shadow: none; }
.pill .type-dot .icon { width: 11px; height: 11px; }
.pill .fmt-price { color: var(--muted); }
.pill[aria-current="page"], .pill.is-on { background: var(--white); border-color: var(--store-primary); box-shadow: inset 0 0 0 1px var(--store-primary); }
.qty-row { display: flex; align-items: center; gap: 16px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; height: 42px; }
.qty button { width: 36px; height: 100%; border: 0; background: none; font-size: 20px; line-height: 1; }
.qty input { width: 42px; height: 100%; border: 0; text-align: center; background: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.buy-extra { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 14px; }
.buy-extra button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: var(--store-text); }

/* ----------------------------- الشريط المتحرّك ----------------------------- */
.marquee { background: var(--store-accent); overflow: hidden; padding: 12px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-list { display: flex; flex: none; }
.marquee-list li { display: flex; align-items: center; gap: 22px; padding-inline-end: 40px; font-weight: 700; font-size: 17px; white-space: nowrap; color: var(--store-primary-dark); }
.marquee-list li::before {
	content: ""; width: 18px; height: 18px; border-radius: 50% 0 50% 50%; background: var(--store-primary); transform: rotate(-45deg);
}
@keyframes marquee { to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
.marquee:not(:has(.marquee-list li)) { display: none; }

/* ------------------------------ آراء القرّاء ------------------------------ */
.review-card {
	border: 1px solid var(--store-primary); border-radius: var(--radius); padding: 30px 24px; text-align: center;
	display: flex; flex-direction: column; align-items: center; gap: 14px; background: var(--white); height: 100%;
}
.review-card .stars .icon { width: 17px; height: 17px; }
.rv-text { color: var(--muted); font-size: 15px; }
.rv-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--store-text); margin-top: auto; }
.rv-book { font-size: 14px; color: var(--muted); }
.rv-book a { color: var(--store-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.reviews-sec { background: var(--lilac); }
.reviews-sec .car-track { grid-auto-columns: calc((100% - 3 * 30px) / 4); }
.posts-sec { background: var(--panel); }

/* ------------------------------ المؤلّفون ------------------------------ */
.author-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.author-card { display: grid; justify-items: center; gap: 6px; text-align: center; }
.author-card .ac-img { width: 170px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; padding: 12px; background: var(--peach); }
.author-card:nth-child(4n+2) .ac-img { background: var(--mint); }
.author-card:nth-child(4n+3) .ac-img { background: var(--lilac); }
.author-card:nth-child(4n+4) .ac-img { background: var(--sage); }
.author-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.author-card b { font-family: var(--font-head); font-size: 19px; margin-top: 8px; }
.author-card small { color: var(--muted); font-size: 14px; }

/* ------------------------------ المقالات ------------------------------ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post-card { display: grid; gap: 10px; text-align: center; align-content: start; }
.post-card .pc-img { display: block; border-radius: var(--radius); overflow: hidden; }
.post-card .pc-img img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; transition: transform .4s; }
.post-card:hover .pc-img img { transform: scale(1.04); }
.pc-date { color: var(--muted); font-size: 14px; margin-top: 6px; }
.pc-title { font-size: 20px; }
.pc-title a:hover { text-decoration: underline; text-underline-offset: 5px; }
.pc-excerpt { color: var(--muted); font-size: 15px; }
.sec-foot { text-align: center; margin-top: 40px; }

/* -------------------------------- التذييل -------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1.4fr; gap: 34px; padding-block: 64px 54px; }
.footer-col h2 { font-family: var(--font-head); font-size: 18px; text-transform: uppercase; margin-bottom: 18px; }
.footer-col li + li { margin-top: 9px; }
.footer-col a, .footer-about p { color: var(--muted); font-size: 15px; }
.footer-col a:hover { color: var(--store-text); text-decoration: underline; }
.footer-about { display: grid; gap: 14px; align-content: start; }
.footer-contact { display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.footer-contact li { display: flex; gap: 8px; align-items: center; }
.footer-contact .icon { width: 17px; height: 17px; color: var(--store-text); }
.newsletter { display: flex; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.newsletter input { flex: 1; min-width: 0; height: 46px; border: 0; background: none; padding: 0 4px; font-size: 15px; }
.newsletter input::placeholder { color: var(--muted); }
.newsletter input:focus { outline: none; }
.newsletter:focus-within { border-color: var(--store-primary-dark); }
.footer-news p { color: var(--muted); font-size: 15px; }
.social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.social a { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--store-text); }
.social a:hover { background: var(--mint); }
.social .icon { width: 19px; height: 19px; }
.footer-bottom { background: var(--store-primary-dark); color: var(--white); font-size: 14px; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-block: 16px; }
body[data-show-newsletter="false"] .footer-news { display: none; }
body[data-show-newsletter="false"] .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
body[data-show-trust-bar="false"] .trust-bar { display: none; }
body[data-show-reviews="false"] .reviews-sec { display: none; }

/* --------------------------- رؤوس الصفحات --------------------------- */
.page-head { background: var(--mint); padding: 40px 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 8px; }
.breadcrumb a:hover { color: var(--store-text); text-decoration: underline; }
.ph-title { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; margin-top: 8px; }
.ph-lead { color: var(--muted); margin-top: 4px; }
.page-head .breadcrumb { color: var(--muted); }

/* ------------------------------ صفحة التصنيف ------------------------------ */
.listing { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; align-items: start; }
.filters { display: grid; gap: 26px; }
.filters-head { display: none; }
.filter-box { border-bottom: 1px solid var(--line); padding-bottom: 22px; display: grid; gap: 10px; }
.filter-box h3 { font-size: 20px; margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary-dark); }
.check small { margin-inline-start: auto; color: var(--muted); }
.price-range { display: flex; gap: 10px; align-items: center; }
.field { height: 42px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); padding: 0 12px; width: 100%; min-width: 0; }
textarea.field { height: auto; padding: 10px 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; padding: 12px 16px; background: var(--panel); border-radius: var(--radius); margin-bottom: 30px; }
.toolbar p { color: var(--muted); }
.toolbar b { color: var(--store-text); }
.sort { display: flex; align-items: center; gap: 10px; }
.sort .field { width: auto; }
.filters-toggle { display: none; }
.listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-books-per-row="5"] .listing .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 50px; }
.pagination a, .pagination span {
	min-width: 40px; height: 40px; padding: 0 8px; display: grid; place-items: center; border-radius: 3px;
	background: var(--panel); font-weight: 700;
}
.pagination [aria-current="page"] { background: var(--store-primary); color: var(--store-primary-dark); }
.pagination a:hover { background: var(--store-primary-dark); color: var(--white); }
.pagination .gap { background: none; }

/* ------------------------------ صفحات الكتاب ------------------------------ */
.pdp-sec { padding: 30px 0 60px; }
.pdp-sec .breadcrumb { margin-bottom: 26px; }
/* المعرض يبقى بجانب البيانات أثناء التمرير، فلا يترك عمودًا فارغًا */
@media (min-width: 992px) { .pdp .gallery { position: sticky; top: 150px; } }
.pdp-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; }
.pdp-meta div { display: flex; gap: 6px; }
.pdp-meta dt { font-weight: 700; }
.pdp-meta dd { margin: 0; color: var(--muted); }
.edu-dots { display: flex; flex-wrap: wrap; gap: 18px; }
.edu-dot { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 14px; color: var(--muted); }
.edu-dot b { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--store-text); font-family: var(--font-head); font-size: 19px; line-height: 1.2; padding: 8px; }
.edu-dot:nth-child(2) b { background: var(--peach); }
.edu-dot:nth-child(3) b { background: var(--lilac); }
.edu-dot:nth-child(4) b { background: var(--sage); }
.sample-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--lilac); }
.sample-box p { font-size: 14px; color: var(--muted); flex: 1; }
.sample-box b { color: var(--store-text); display: block; font-size: 15px; }
.wave { display: flex; align-items: center; gap: 3px; height: 30px; }
.wave i { width: 3px; border-radius: 2px; background: var(--type-audio); }
.qty-discount { font-size: 14px; color: var(--store-primary-dark); background: var(--mint); padding: 6px 12px; border-radius: 4px; justify-self: start; }
.stock-line { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); }
.stock-line .icon { color: var(--store-primary-dark); width: 18px; height: 18px; }

.tabs { margin-top: 60px; }
.tab-list { display: flex; justify-content: center; gap: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab-list button {
	border: 0; background: none; padding: 12px 22px; font-family: var(--font-head); font-size: 20px; font-weight: 700;
	color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab-list button[aria-selected="true"] { color: var(--store-text); border-color: var(--store-primary); }
.tab-panel { padding: 34px 0 0; }
.prose { max-width: 820px; margin-inline: auto; color: var(--muted); display: grid; gap: 14px; font-size: 16px; }
.spec-table { width: 100%; max-width: 820px; margin-inline: auto; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; }
.spec-table th { width: 32%; font-weight: 700; background: var(--panel); }
.spec-table td { color: var(--muted); }
.reviews-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; align-items: start; }
.reviews-summary { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: var(--radius); background: var(--panel); }
.reviews-summary strong { font-family: var(--font-head); font-size: 46px; line-height: 1; }
.reviews-summary small { display: block; color: var(--muted); }
.review-form { display: grid; gap: 12px; margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.review-form h3 { font-size: 19px; }
.review-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: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { color: #D9D6E0; cursor: pointer; }
.star-input label .icon { width: 24px; height: 24px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--gold); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-primary-dark); }
.review-list { display: grid; gap: 18px; }
.review-list .review-card { text-align: start; align-items: flex-start; border-color: var(--line); padding: 20px 22px; }
.review-list .rv-name { margin-top: 0; font-size: 16px; }

/* ------------------------------ صفحة المؤلّف ------------------------------ */
.author-hero { background: var(--peach); padding: 50px 0; }
.author-hero .container { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 50px; align-items: center; }
.ah-photo { width: 260px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; padding: 16px; background: var(--mint-2); }
.ah-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ah-info { display: grid; gap: 12px; }
.ah-info h1 { font-size: clamp(32px, 3.6vw, 46px); font-weight: 800; }
.ah-bio { color: var(--muted); max-width: 720px; }
.ah-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.ah-stats span { background: var(--white); padding: 6px 14px; border-radius: 20px; font-size: 14px; }

/* -------------------------------- السلّة -------------------------------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 40px; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: start; font-family: var(--font-head); font-size: 17px; padding: 12px 10px; background: var(--panel); }
.cart-table td { padding: 18px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ci-book { display: flex; align-items: center; gap: 16px; }
.ci-cover { position: relative; flex: none; width: 82px; background: var(--panel); border-radius: 4px; padding: 10px; }
.ci-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.ci-cover .type-dot { position: absolute; top: -6px; inset-inline-start: -6px; width: 24px; height: 24px; }
.ci-cover .type-dot .icon { width: 13px; height: 13px; }
.ci-info h3 { font-family: var(--font-body); font-size: 16px; font-weight: 500; }
.ci-info p { color: var(--muted); font-size: 14px; }
.ci-total { font-weight: 700; color: var(--store-primary-dark); white-space: nowrap; }
.ci-remove { color: var(--muted); }
.cart-under { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.summary { background: var(--store-primary-dark); color: var(--white); border-radius: var(--radius); padding: 28px; display: grid; gap: 14px; }
.summary h2 { color: var(--white); font-size: 24px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.sum-total { border-top: 1px solid rgba(255, 255, 255, .3); padding-top: 14px; font-weight: 700; font-size: 19px; }
.coupon { display: flex; gap: 8px; }
.coupon .field { border-color: transparent; color: var(--store-text); }
.summary .btn-line { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .6); }
.summary .btn-line:hover { border-color: var(--white); }
.summary small { font-size: 13px; }
.empty-cart { text-align: center; padding: 50px 20px; display: grid; gap: 12px; justify-items: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-cart .ec-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); }
.empty-cart .ec-ico .icon { width: 40px; height: 40px; }

/* --------------------------------- 404 --------------------------------- */
.nf { background: var(--store-accent); padding: 80px 0; text-align: center; }
.nf .container { display: grid; justify-items: center; gap: 16px; }
.nf-code { font-family: var(--font-head); font-weight: 800; font-size: clamp(110px, 18vw, 200px); line-height: .9; color: var(--store-primary-dark); }
.nf h1 { font-size: clamp(26px, 3vw, 36px); }
.nf p { color: var(--store-text); max-width: 520px; }
.nf .hdr-search { width: 100%; max-width: 520px; margin: 6px auto 0; background: var(--white); flex: none; }
.nf-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------ المدوّنة ------------------------------ */
.blog-grid { row-gap: 46px; }
.post-hero { padding: 40px 0 0; text-align: center; }
.post-hero .container { max-width: 900px; display: grid; gap: 14px; justify-items: center; }
.post-hero h1 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; }
.post-cover { max-width: 1000px; margin: 34px auto 0; border-radius: var(--radius); overflow: hidden; }
.post-cover img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.post-body { max-width: 760px; margin: 40px auto 0; color: var(--store-text); display: grid; gap: 18px; font-size: 17px; line-height: 1.9; }
.post-body h2 { font-size: 26px; margin-top: 10px; }
.post-body blockquote { margin: 0; padding: 18px 22px; border-inline-start: 4px solid var(--store-primary); background: var(--mint); border-radius: 4px; font-family: var(--font-head); font-size: 20px; }

/* -------------------------- components.html -------------------------- */
.kit { display: grid; gap: 50px; }
.kit-block { display: grid; gap: 18px; }
.kit-block > h2 { font-size: 22px; padding-bottom: 8px; border-bottom: 2px solid var(--store-primary); justify-self: start; }
.kit-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.kit-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; }
.kit-note { color: var(--muted); font-size: 14px; }
.kit-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.kit-switch button[aria-pressed="true"] { background: var(--store-primary-dark); color: var(--white); }

/* ============================== الاستجابة ============================== */
@media (max-width: 1360px) {
	.car-arrow.prev { inset-inline-start: -8px; }
	.car-arrow.next { inset-inline-end: -8px; }
}
@media (max-width: 1100px) {
	:root { --per-row: 3; }
	body[data-books-per-row] { --per-row: 3; }
	.hero-grid { grid-template-columns: minmax(0, 1fr) 270px; }
	.features { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
	.cat-grid { grid-template-columns: repeat(3, 1fr); }
	.footer-grid { grid-template-columns: repeat(3, 1fr); }
	.footer-about { grid-column: 1 / -1; }
	.main-nav ul { gap: 20px; }
	.browse { width: 250px; }
	.reviews-sec .car-track { grid-auto-columns: calc((100% - 2 * 30px) / 3); }
	.cart-layout { grid-template-columns: 1fr; }
	.reviews-layout { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
	.hdr-nav, .hdr-main .hdr-search { display: none; }
	.menu-toggle, .search-toggle { display: inline-grid; }
	.hdr-main { min-height: 66px; gap: 8px; }
	.hdr-actions { margin-inline-start: auto; gap: 2px; }
	.brand img { width: 40px; height: 40px; }
	.brand-name { font-size: 23px; }
	.mobile-search { display: none; padding: 0 var(--gutter) 12px; }
	body.search-open .mobile-search { display: block; }
	.mobile-search .hdr-search { max-width: none; margin: 0; }
	.hero-grid { grid-template-columns: 1fr; }
	.hero-side { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
	.hcard { grid-template-columns: 1fr; }
	.hc-body { padding: 12px; }
	.story { grid-template-columns: 1fr; gap: 26px; }
	.story-media { order: -1; }
	.trust-panel { padding: 24px 22px; }
	.feat-book { grid-template-columns: 1fr; }
	.listing { grid-template-columns: 1fr; }
	.filters {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 91; width: min(340px, 88vw); background: var(--white);
		overflow-y: auto; padding: 0 18px 24px; transform: translateX(100%); visibility: hidden; transition: transform .3s;
	}
	body.filters-open .filters { transform: none; visibility: visible; }
	body.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
	.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
	.filters-head h2 { font-size: 22px; }
	.filters-toggle { display: inline-flex; }
	.author-grid { grid-template-columns: repeat(2, 1fr); }
	.post-grid { grid-template-columns: repeat(2, 1fr); }
	.author-hero .container { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 24px; }
	.ah-stats { justify-content: center; }
	.ah-bio { margin-inline: auto; }
	.kit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) { .mobile-search { display: none !important; } }
@media (max-width: 767px) {
	:root { --gutter: 16px; }
	body[data-books-per-row] { --per-row: 2; }
	.section { padding: 50px 0; }
	.announce .ann-list { justify-content: center; }
	.announce .ann-list li:not(:first-child) { display: none; }
	.hero { padding-top: 16px; }
	.slide-img { aspect-ratio: 16 / 10; }
	.slide-title { font-size: 30px; }
	.slider-arrow { top: 30%; }
	.slider-arrow.prev { inset-inline-start: 10px; }
	.slider-arrow.next { inset-inline-end: 10px; }
	.hero-side { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.hero-side::-webkit-scrollbar { display: none; }
	.hero-side > * { scroll-snap-align: start; }
	.hcard { grid-template-columns: 110px minmax(0, 1fr); }
	.features-sec { padding: 34px 0 6px; }
	.features-sec .sec-head { margin-bottom: 18px; }
	.features { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
	.features::-webkit-scrollbar { display: none; }
	.features li { flex: 0 0 92px; scroll-snap-align: start; font-size: 13.5px; gap: 8px; line-height: 1.4; }
	.features li::before { width: 64px; height: 64px; background-size: 30px; }
	.trust-panel { flex: 0 0 82%; padding: 18px 18px; }
	.trust-panel .icon { width: 30px; height: 30px; }
	.trust-panel p { font-size: 13.5px; }
	.cat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
	.cat-tile b { font-size: 15px; }
	.book-grid { gap: 30px 14px; }
	.car-track { gap: 14px; grid-auto-columns: calc((100% - 14px) / 2); }
	.reviews-sec .car-track { grid-auto-columns: 86%; }
	.car-arrow { top: 28%; }
	.car-arrow.prev { inset-inline-start: -6px; }
	.car-arrow.next { inset-inline-end: -6px; }
	.bc-cover { width: 64%; }
	.bc-tools { gap: 6px; }
	.bc-tools button { width: 40px; height: 40px; }
	.bc-title { font-size: 15px; }
	.trust-panel h3 { font-size: 18px; }
	.thumbs { grid-template-columns: repeat(4, 1fr); gap: 8px; }
	.buy-row { grid-template-columns: 1fr; }
	.author-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 40%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.author-grid::-webkit-scrollbar { display: none; }
	.author-grid > * { scroll-snap-align: start; }
	.author-card .ac-img { width: 130px; padding: 8px; }
	.author-card b { font-size: 16px; }

	.post-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 80%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.post-grid::-webkit-scrollbar { display: none; }
	.post-grid > * { scroll-snap-align: start; }
	.blog-grid { grid-auto-flow: row; grid-template-columns: 1fr; overflow: visible; }
	body[data-books-per-row] .listing .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding-block: 46px; }
	.footer-news { grid-column: 1 / -1; }
	.footer-bottom .container { justify-content: center; text-align: center; }
	.toolbar { padding: 10px 12px; }
	.pdp-meta { grid-template-columns: 1fr; }
	.tab-list button { padding: 10px 12px; font-size: 17px; }
	.cart-table thead { display: none; }
	.cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; }
	.cart-table tr { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
	.cart-table td { padding: 0; border: 0; }
	.cart-table td:first-child { grid-column: 1 / -1; padding-inline-end: 40px; }
	.cart-table td.td-price { display: none; }
	.cart-table td.td-remove { position: absolute; top: 12px; inset-inline-end: 0; }
	.cart-table td.td-total { align-self: center; }
	.nf { padding: 56px 0; }
	.kit-cards { gap: 14px; }
}
@media (max-width: 380px) {
	.brand-name { font-size: 20px; }
}

/* --------------------------- أدوات مساعدة --------------------------- */
.pt-0 { padding-top: 0; }
.hero-books { min-width: 0; }
.hero-books .hero-side { height: 100%; }
.pdp-rate { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
@media (max-width: 991px) { .hide-sm { display: none !important; } }

/* ------------------------- مختارات بتبويبات ------------------------- */
.pick-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -12px 0 30px; }
.pick-tabs [role="tab"] {
	min-height: 42px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--line); background: var(--white);
	font-weight: 500; font-size: 15px; color: var(--store-text); transition: background .2s, border-color .2s;
}
.pick-tabs [role="tab"]:hover { border-color: var(--store-primary); }
.pick-tabs [role="tab"][aria-selected="true"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--store-primary-dark); font-weight: 700; }
/* مصدرٌ واحد: يختفي شريط التبويبات ويبقى الصفّ */
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }
/* لا صفّ ناقص: يُعرض من الكتب ما يملأ صفّين كاملين */
.pick-grid > :nth-child(n+9) { display: none; }
body[data-books-per-row="3"] .pick-grid > :nth-child(n+7) { display: none; }
body[data-books-per-row="5"] .pick-grid > :nth-child(n+6) { display: none; }

/* ------------------------- عروض الأسبوع ------------------------- */
.deals-sec { background: var(--peach); }
.deals { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 50px; align-items: center; }
.deals-copy { display: grid; gap: 14px; justify-items: start; }
.deals-copy .sec-title { font-size: clamp(28px, 3vw, 38px); }
.deals-sub { color: var(--store-text); }
.countdown { display: flex; gap: 10px; }
.cd-unit { display: grid; justify-items: center; min-width: 64px; padding: 8px 6px 6px; border-radius: var(--radius); background: var(--white); box-shadow: 0 4px 14px rgba(41, 31, 81, .08); }
.cd-unit b { font-family: var(--font-head); font-size: 26px; line-height: 1.1; color: var(--store-primary-dark); font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 12.5px; color: var(--muted); }
.deals-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.deals-grid .bc-media { background: var(--white); }

/* --------------------- وصل حديثًا: البطاقة الأفقيّة --------------------- */
.new-sec { background: var(--mint); }
.sec-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; text-align: start; }
.sec-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--store-primary-dark); white-space: nowrap; }
.sec-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.sec-link .icon { width: 18px; height: 18px; }
.new-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.new-grid .hcard { border-color: transparent; }

/* ------------------------- التوصيل والدفع ------------------------- */
.perks { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--mint); font-size: 14.5px; }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks .icon { width: 19px; height: 19px; color: var(--store-primary-dark); }

/* ------------------------- صفحة التصنيف ------------------------- */
.subcats { display: grid; gap: 4px; }
.subcats a { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 15px; }
.subcats a:hover, .subcats a[aria-current="page"] { color: var(--store-primary-dark); font-weight: 700; }
.subcats small { color: var(--muted); font-weight: 400; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -14px 0 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 18px; background: var(--mint); font-size: 14px; color: var(--store-text); border: 0; }
.chip .icon { width: 14px; height: 14px; }
.chip-clear { background: none; text-decoration: underline; text-underline-offset: 4px; color: var(--muted); }
.view-toggle { display: inline-flex; gap: 4px; }
.view-toggle button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); display: grid; place-items: center; color: var(--muted); }
.view-toggle button[aria-pressed="true"] { border-color: var(--store-primary-dark); color: var(--store-primary-dark); }
.view-toggle .icon { width: 18px; height: 18px; }
.toolbar-end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* عرض القائمة: الغلاف بجانب البيانات */
.listing .book-grid.is-list { grid-template-columns: 1fr !important; gap: 18px; }
.book-grid.is-list .book-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.book-grid.is-list .bc-body { padding-top: 0; }
.book-grid.is-list .bc-media { margin-bottom: 20px; }
.book-grid.is-list .bc-foot { justify-content: flex-start; gap: 18px; margin-top: 6px; }

/* ------------------------- أعمال المؤلّف: صفٌّ يُمرَّر ------------------------- */
.works .car-track { padding-bottom: 6px; }

@media (max-width: 1100px) {
	.deals { grid-template-columns: 1fr; gap: 28px; }
	.deals-copy { justify-items: center; text-align: center; }
	.new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pick-grid > :nth-child(n+7) { display: none; }
	body[data-books-per-row] .pick-grid > :nth-child(-n+6) { display: flex; }
}
@media (max-width: 767px) {
	.pick-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: -14px calc(-1 * var(--gutter)) 22px; padding-inline: var(--gutter); }
	.pick-tabs::-webkit-scrollbar { display: none; }
	.pick-tabs [role="tab"] { flex: none; }
	.deals-grid, .new-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
	.deals-grid { grid-auto-columns: calc((100% - 14px) / 2); }
	.new-grid { grid-auto-columns: 86%; align-items: start; }
	.deals-grid::-webkit-scrollbar, .new-grid::-webkit-scrollbar { display: none; }
	.deals-grid > *, .new-grid > * { scroll-snap-align: start; }
	.cd-unit { min-width: 58px; }
	.cd-unit b { font-size: 22px; }
	.sec-head-row .sec-title { font-size: 24px; }
	.book-grid.is-list .book-card { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
	.active-filters { margin-top: -18px; }
}


/* الجهاز اللوحيّ: صورة الشريحة فوق النصّ، وألواح الثقة شريطٌ يُمرَّر */
@media (max-width: 1100px) {
	.slider, .slides { min-height: 0; }
	.slides { display: grid; }
	.slide { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; }
	.slide-img { position: relative; aspect-ratio: 2 / 1; height: auto; object-position: 85% center; }
	.slide-copy { position: relative; inset: auto; width: auto; padding: 22px 20px 52px; align-items: center; text-align: center; }
	.slider-arrow { top: 32%; }
}
@media (max-width: 991px) {
	.trust-bar { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.trust-bar::-webkit-scrollbar { display: none; }
	.trust-panel { flex: 0 0 46%; scroll-snap-align: start; }
	.featured .gallery-main { aspect-ratio: 4 / 3; }
	.featured .gallery-main img { width: 36%; }
}
@media (max-width: 767px) {
	.slide-img { aspect-ratio: 16 / 10; }
	.bc-foot { gap: 4px; }
	.bc-body .bc-price { font-size: 14.5px; column-gap: 5px; }
	.bc-body .bc-price del { font-size: .8em; }
	.trust-panel { flex-basis: 82%; }
}
@media (min-width: 768px) and (max-width: 1100px) {
	.features { grid-template-columns: repeat(6, 1fr); gap: 12px; }
	.features li { font-size: 14px; gap: 10px; line-height: 1.45; }
	.features li::before { width: 72px; height: 72px; background-size: 32px; }
}
@media (min-width: 768px) and (max-width: 991px) {
	.hcard > .badge { bottom: auto; top: 8px; inset-inline-start: auto; inset-inline-end: 8px; }
}

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