/* ==========================================================================
   شفاء — قالب متجر كتب على منصّة «ناشر»
   الألوان الخمسة في :root يختارها الناشر، وكلّ ما عداها محايد أو محسوبٌ منها.
   ========================================================================== */

:root {
	--store-primary: #0F7A6C;
	--store-primary-dark: #0A5A50;
	--store-accent: #C53030;
	--store-bg: #FFFFFF;
	--store-text: #141414;

	/* محايدات */
	--ink: #141414;
	--muted: #55585B;
	--line: #ECECEC;
	--line-strong: #DCDCDC;
	--soft: #F6F6F6;
	--white: #FFFFFF;
	--gold: #F5A524;
	--star-off: #D9D9D9;

	/* درجاتٌ من لون المتجر */
	--primary-soft: color-mix(in srgb, var(--store-primary) 11%, #FFFFFF);
	--primary-softer: color-mix(in srgb, var(--store-primary) 6%, #FFFFFF);

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

	--r: 8px;
	--r-lg: 14px;
	--r-pill: 999px;
	--container: 1416px;
	--side: 250px;
	--per-row: 6;
	--font: "Tajawal", system-ui, sans-serif;
	--shadow: 0 8px 24px rgba(20, 20, 20, .07);
}

body[data-corners="sharp"] { --r: 0px; --r-lg: 0px; --r-pill: 2px; }
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; }
body[data-books-per-row="6"] { --per-row: 6; }

/* ---------------------------------------------------------------- أساس */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 140px; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.6;
	color: var(--store-text);
	background: var(--store-bg);
	overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
del { color: var(--muted); font-weight: 400; }
:focus-visible { outline: 2px solid var(--store-primary); outline-offset: 2px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-fill { fill: currentColor; stroke: none; }
.icon-arrow { width: 16px; height: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -60px; right: 16px; z-index: 100; background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: var(--r); }
.skip-link:focus { top: 8px; }
[data-option]:empty { display: none; }
.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }

/* ---------------------------------------------------------------- أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 0 20px;
	border: 1px solid transparent; border-radius: var(--r);
	font-weight: 700; font-size: 14px; line-height: 1.2; white-space: nowrap;
	transition: background .2s, color .2s, border-color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--store-primary); color: var(--white); }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #333; }
.btn-soft { background: var(--primary-soft); color: var(--store-primary-dark); }
.btn-soft:hover { background: var(--store-primary); color: var(--white); }
.btn-soft:disabled { background: #EEEEEE; color: #5F5F5F; cursor: not-allowed; }
.btn-outline { background: var(--white); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
	display: inline-grid; place-items: center; position: relative;
	width: 40px; height: 40px; border-radius: 50%;
	background: var(--white); border: 1px solid var(--line); color: var(--ink);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn-lg { width: 50px; height: 50px; border-radius: var(--r); }
.icon-btn[aria-pressed="true"] { color: var(--store-accent); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.count {
	position: absolute; top: -6px; left: -6px;
	min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: var(--store-primary); color: var(--white);
	font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.see-all {
	display: inline-flex; align-items: center; gap: 6px;
	font-weight: 700; font-size: 14px; color: var(--ink);
	border-bottom: 1.5px solid currentColor; padding-bottom: 2px;
}
.see-all:hover { color: var(--store-primary-dark); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }

/* ---------------------------------------------------------------- الشريط العلويّ */
.topbar { border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.topbar .container { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 36px; }
.topbar-links { display: flex; }
.topbar-links li + li { border-inline-start: 1px solid var(--line); }
.topbar-links a { display: block; padding: 0 14px; color: var(--muted); }
.topbar-links li:first-child a { padding-inline-start: 0; }
.topbar-links a:hover { color: var(--ink); }
.topbar-msg { font-weight: 500; text-align: center; }
.topbar-phone { justify-self: end; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.topbar-phone .icon { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- الرأس */
.site-header { background: var(--white); position: sticky; top: 0; z-index: 30; }
.header-main .container { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.menu-toggle { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.2px; }
.header-search {
	flex: 1; max-width: 660px; margin-inline: auto;
	display: flex; align-items: center; gap: 4px;
	background: var(--soft); border-radius: var(--r); padding: 4px;
}
.header-search select {
	border: 0; background: transparent; padding: 0 12px; height: 40px;
	font-size: 14px; font-weight: 500; border-inline-end: 1px solid var(--line-strong);
	max-width: 160px;
}
.header-search-field { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; height: 40px; outline: 0; color: var(--ink); }
.header-search input::placeholder { color: #6E7174; }
.header-search .btn { min-height: 40px; padding: 0 24px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.account-link { display: flex; align-items: center; gap: 10px; }
.account-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); }
.account-text { display: grid; line-height: 1.25; }
.account-text small { color: var(--muted); font-size: 12px; }
.account-text b { font-size: 14px; }
.count-btn { border-color: transparent; background: var(--soft); }

/* صفّ التنقّل */
.header-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.header-nav .container { display: flex; align-items: center; gap: 28px; min-height: 50px; }
.cat-menu { position: relative; width: var(--side); flex: none; align-self: stretch; }
.cat-toggle {
	display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; min-height: 50px;
	padding: 0 16px; border: 0;
	background: var(--store-primary); color: var(--white);
	font-weight: 700; font-size: 14px;
}
.cat-drop {
	position: absolute; top: 100%; right: 0; left: 0;
	background: var(--white); box-shadow: var(--shadow);
	display: none;
}
.cat-menu.open .cat-drop { display: block; }
body:has(.side-cats-home) .cat-drop { display: none !important; }
body:has(.side-cats-home) .cat-toggle { cursor: default; }
.nav-list { display: flex; gap: 26px; flex: 1; }
.nav-list a { display: block; padding: 14px 0; font-weight: 700; font-size: 14px; }
.nav-list a:hover { color: var(--store-primary-dark); }
.nav-offer { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.nav-offer .icon { color: var(--store-accent); fill: currentColor; stroke: none; width: 18px; height: 18px; }

/* القائمة العموديّة للتصنيفات */
.side-cats { border: 1px solid var(--line); border-top: 0; background: var(--white); border-radius: 0 0 var(--r) var(--r); }
.side-cats-list li + li { border-top: 1px solid var(--line); }
.side-cats-list a { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 44px; font-size: 14px; font-weight: 500; }
.side-cats-list a .icon { width: 18px; height: 18px; color: var(--muted); }
.side-cats-list a span:not(.side-cats-more) { flex: 1; }
.side-cats-more { display: inline-grid; color: var(--muted); }
.side-cats-more .icon { width: 16px; height: 16px; }
.side-cats-list a:hover { color: var(--store-primary-dark); background: var(--primary-softer); }
.side-cats-list a:hover .icon { color: var(--store-primary-dark); }
.side-cats-box { border-top: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.side-title { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--store-primary); color: var(--white); font-size: 15px; }

/* الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; visibility: hidden; transition: .25s; z-index: 60; }
.drawer {
	position: fixed; top: 0; bottom: 0; right: 0; width: min(330px, 86vw);
	background: var(--white); z-index: 61; overflow-y: auto; padding: 16px;
	transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s;
}
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop, body.filters-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer-head .brand-name { font-size: 18px; }
.drawer-nav a, .drawer-cats a { display: block; padding: 11px 2px; font-weight: 700; border-bottom: 1px solid var(--line); }
.drawer-title { margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--muted); }
.drawer-cats a { font-weight: 500; padding-inline-start: 12px; }
.drawer-small a { font-weight: 500; color: var(--muted); }
.drawer-phone { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 700; color: var(--store-primary-dark); }

/* ---------------------------------------------------------------- أقسام */
.section { padding: 56px 0; }
.section-first { padding-top: 28px; }
.section-soft { background: var(--soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head.center { justify-content: center; text-align: center; }
.section-title { font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -.3px; }
.row-arrows { display: flex; gap: 8px; }
.row-arrows .icon-btn { border-color: transparent; }

/* ---------------------------------------------------------------- الواجهة: التصنيفات + السلايدر */
.hero-area { padding: 0 0 24px; }
.hero-grid { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 28px; align-items: start; }
.side-cats-home { border-radius: 0 0 var(--r) var(--r); }
.hero-main { display: grid; gap: 16px; padding-top: 18px; min-width: 0; }
.hero { border-radius: var(--r-lg); overflow: hidden; }
.slider { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1140 / 460; display: flex; align-items: center; background: #EEF3F1; }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.slide-body { position: relative; max-width: 48%; padding: 0 64px; }
.slide-tag { display: inline-block; color: var(--store-accent); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.slide-title { font-size: 46px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; color: var(--ink); }
.slide-text { margin: 12px 0 26px; font-size: 17px; color: #3A3D40; }
.slide-text .hl { color: var(--store-accent); }
.slider-nav { position: absolute; bottom: 18px; right: 64px; display: flex; align-items: center; gap: 10px; }
.slider-nav .icon-btn { width: 34px; height: 34px; border-color: transparent; }
.slider-dots { display: flex; gap: 6px; }
.slider-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: rgba(20, 20, 20, .25); transition: width .2s; }
.slider-dots button[aria-current="true"] { width: 22px; background: var(--ink); }

.promo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.promo {
	position: relative; display: flex; align-items: center; gap: 10px; min-height: 80px;
	padding: 12px 18px; padding-inline-start: 96px;
	border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #FFF7F4;
}
.promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.promo-text { position: relative; flex: 1; display: grid; line-height: 1.35; }
.promo-text b { font-size: 16px; color: var(--ink); }
.promo-text small { font-size: 13px; color: var(--store-accent); font-weight: 700; }
.promo-arrow { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .8); color: var(--ink); }
.promo-arrow .icon { width: 16px; height: 16px; }
.hero-main:not(:has(.hero)) { padding-top: 24px; }
.hero-main:not(:has(.hero)) .promo { min-height: 170px; padding-inline-start: 190px; align-items: flex-end; padding-bottom: 22px; }

/* شريط الثقة */
.trust-section { padding: 8px 0 0; }
.trust-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); }
.trust-bar li { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.trust-bar li + li { border-inline-start: 1px solid var(--line); }
.trust-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary-soft); color: var(--store-primary-dark); flex: none; }
.trust-icon .icon { width: 22px; height: 22px; }
.trust-bar h3 { font-size: 15px; }
.trust-bar p { font-size: 13px; color: var(--muted); }

/* تصنيفات رائجة: دوائر */
.cat-row { display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 4px; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-item { flex: 0 0 160px; display: grid; justify-items: center; gap: 4px; text-align: center; scroll-snap-align: start; }
.cat-circle { display: block; width: 160px; height: 160px; border-radius: 50%; overflow: hidden; margin-bottom: 10px; background: radial-gradient(circle, #FFFFFF 0%, #E8F1EE 100%); transition: transform .25s; }
.cat-item:nth-child(4n+2) .cat-circle { background: radial-gradient(circle, #FFFFFF 0%, #F8E6EC 100%); }
.cat-item:nth-child(4n+3) .cat-circle { background: radial-gradient(circle, #FFFFFF 0%, #ECE8F8 100%); }
.cat-item:nth-child(4n+4) .cat-circle { background: radial-gradient(circle, #FFFFFF 0%, #FBF1D6 100%); }
.cat-circle img { width: 100%; height: 100%; object-fit: cover; }
.cat-item:hover .cat-circle { transform: translateY(-4px); }
.cat-item b { font-size: 15px; font-weight: 700; }
.cat-item small { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- بطاقة الكتاب */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 20px; }
.book-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.book-card {
	position: relative; display: flex; flex-direction: column;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
	padding: 10px; transition: box-shadow .2s, border-color .2s;
}
.book-card:hover { box-shadow: var(--shadow); }
.book-media { position: relative; border-radius: calc(var(--r) - 2px); overflow: hidden; background: var(--soft); padding: 14px 18px; }
.book-media > a { display: block; }
.book-media img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 14px rgba(0, 0, 0, .14); transition: transform .3s; }
.book-card:hover .book-media img { transform: translateY(-3px); }
.book-flags { position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; justify-items: start; gap: 6px; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; line-height: 20px; }
.badge-sale { background: var(--store-accent); color: var(--white); }
.badge-new { background: var(--ink); color: var(--white); }
.type-dot { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--white); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); flex: none; }
.type-dot .icon { width: 16px; height: 16px; }
.type-dot[data-type="print"] { background: var(--type-print); }
.type-dot[data-type="ebook"] { background: var(--type-ebook); }
.type-dot[data-type="audio"] { background: var(--type-audio); }
.type-dot[data-type="educational"] { background: var(--type-edu); }
.type-dot-lg { width: 48px; height: 48px; }
.type-dot-lg .icon { width: 22px; height: 22px; }
.wish-btn { position: absolute; top: 8px; left: 8px; z-index: 2; width: 34px; height: 34px; border-color: transparent; }
.wish-btn .icon { width: 17px; height: 17px; }
.stock-band { position: absolute; bottom: 0; right: 0; left: 0; z-index: 2; padding: 6px; background: rgba(20, 20, 20, .82); color: var(--white); text-align: center; font-size: 13px; font-weight: 700; }
.book-card.is-out .book-media img { filter: grayscale(.7); opacity: .75; }
.book-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 4px 2px; flex: 1; }
.book-title { font-size: 15px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-title a:hover { color: var(--store-primary-dark); }
.book-author { font-size: 13px; color: var(--muted); }
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-weight: 800; font-size: 16px; }
.price del { font-size: 13px; }
.price-lg { font-size: 28px; }
.price-lg del { font-size: 17px; }
.book-body .price { margin: 4px 0 10px; }
.book-body .btn { margin-top: auto; min-height: 40px; font-size: 13px; }
.book-body .btn .icon { width: 16px; height: 16px; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--gold); }
.stars .icon { width: 14px; height: 14px; }
.stars .off { color: var(--star-off); }

/* أشكال البطاقة */
body[data-card-style="framed"] .book-card { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0, 0, 0, .05); padding: 0; overflow: hidden; }
body[data-card-style="framed"] .book-media { border-radius: 0; border-bottom: 1px solid var(--line); }
body[data-card-style="framed"] .book-body { padding: 12px 14px 14px; }
body[data-card-style="framed"] .book-body .btn:not(:disabled) { background: var(--store-primary); color: var(--white); }
body[data-card-style="minimal"] .book-card { border-color: transparent; background: transparent; padding: 0; }
body[data-card-style="minimal"] .book-card:hover { box-shadow: none; }
body[data-card-style="minimal"] .book-body { padding-inline: 0; }
body[data-card-style="minimal"] .book-body .btn:not(:disabled) { background: transparent; border-color: var(--store-primary-dark); }
body[data-card-style="minimal"] .book-body .btn:not(:disabled):hover { background: var(--store-primary-dark); color: var(--white); }

/* ---------------------------------------------------------------- بانرات العروض */
.offer-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.offer { position: relative; display: flex; align-items: center; min-height: 250px; border-radius: var(--r-lg); overflow: hidden; background: #F2ECE6; }
.offer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left bottom; }
.offer-text { position: relative; display: grid; justify-items: start; gap: 6px; padding: 28px 36px; max-width: 62%; }
.offer-text small { font-size: 14px; font-weight: 500; color: #3A3D40; }
.offer-text b { font-size: 24px; line-height: 1.3; margin-bottom: 14px; color: var(--ink); }
.offer:hover .btn { background: var(--store-primary-dark); }

/* تسوّق حسب النوع */
.type-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.type-tile { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 230px; padding: 26px; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--type-print) 12%, #FFFFFF), color-mix(in srgb, var(--type-print) 30%, #FFFFFF)); }
.type-tile:nth-child(4n+2) { background: linear-gradient(160deg, color-mix(in srgb, var(--type-ebook) 12%, #FFFFFF), color-mix(in srgb, var(--type-ebook) 30%, #FFFFFF)); }
.type-tile:nth-child(4n+3) { background: linear-gradient(160deg, color-mix(in srgb, var(--type-audio) 12%, #FFFFFF), color-mix(in srgb, var(--type-audio) 30%, #FFFFFF)); }
.type-tile:nth-child(4n+4) { background: linear-gradient(160deg, color-mix(in srgb, var(--type-edu) 12%, #FFFFFF), color-mix(in srgb, var(--type-edu) 30%, #FFFFFF)); }
.type-tile-text { position: relative; z-index: 1; display: grid; gap: 4px; justify-items: start; max-width: 56%; }
.type-tile-text b { font-size: 24px; line-height: 1.25; color: var(--ink); }
.type-tile-text small { font-size: 14px; color: #2E3033; }
.type-tile-text .link-arrow { margin-top: 10px; color: var(--ink); }
.type-tile img { position: absolute; top: 50%; left: 2%; width: 46%; height: auto; transform: translateY(-50%); transition: transform .3s; }
.type-tile:hover img { transform: translateY(-50%) scale(1.05); }

/* آراء القرّاء */
.reviews-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.review-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); }
.review-top { display: flex; align-items: center; justify-content: space-between; }
.review-quote { color: var(--store-primary); }
.review-quote .icon { width: 28px; height: 28px; }
.review-text { font-size: 15px; line-height: 1.8; flex: 1; }
.review-who { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--store-primary-dark); font-weight: 800; }
.review-who b { display: block; font-size: 14px; }
.review-who small { font-size: 12px; color: var(--muted); }

/* المؤلّفون: شبكة مؤطَّرة */
.author-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.author-cell { display: grid; justify-items: center; gap: 4px; padding: 26px 12px; text-align: center; border-inline-start: 1px solid var(--line); transition: background .2s; }
.author-cell:first-child { border-inline-start: 0; }
.author-cell:hover { background: var(--primary-softer); }
.author-cell img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.author-cell b { font-size: 15px; }
.author-cell small { font-size: 13px; color: var(--muted); }

/* شاهدتَه مؤخّرًا */
.recent-box { background: var(--soft); border-radius: 24px; padding: 48px 48px 52px; text-align: center; }
.recent-note { color: var(--muted); margin: 6px 0 28px; }
.recent-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; text-align: start; }
.mini-card { display: grid; gap: 6px; }
.mini-cover { position: relative; display: block; padding: 14px 20px; background: var(--white); border-radius: var(--r-lg); }
.mini-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 14px rgba(0, 0, 0, .12); }
.mini-cover .type-dot { position: absolute; top: 8px; right: 8px; z-index: 1; width: 26px; height: 26px; }
.mini-cover .type-dot .icon { width: 14px; height: 14px; }
.mini-card .book-title { font-size: 14px; margin-top: 6px; }
.mini-card .price { font-size: 14px; }

/* ---------------------------------------------------------------- التذييل */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.footer-main { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.7fr; gap: 32px; padding: 56px 0 40px; }
.footer-contact { display: grid; gap: 12px; margin: 22px 0 16px; font-size: 14px; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.footer-phone { display: inline-block; font-size: 24px; font-weight: 800; direction: ltr; }
.footer-col h2, .footer-news h2 { font-size: 18px; margin-bottom: 18px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { position: relative; padding-inline-start: 14px; font-size: 14px; color: #33363A; }
.footer-col a::before { content: ""; position: absolute; right: 0; top: .6em; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.footer-col a:hover { color: var(--store-primary-dark); }
.newsletter p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.newsletter-field { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.newsletter-field input { flex: 1; min-width: 0; border: 0; padding: 0 14px; height: 48px; outline: 0; background: var(--white); }
.newsletter-field .btn { border-radius: 0; min-height: 48px; padding: 0 26px; }
.footer-news h3 { font-size: 14px; margin: 22px 0 10px; }
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r); }
.social a:hover { border-color: var(--ink); }
.social .icon { width: 18px; height: 18px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 26px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.mobile-bar { display: none; }

/* ---------------------------------------------------------------- ترويسة الصفحات الداخليّة */
.page-head { background: var(--soft); padding: 30px 0 34px; }
.page-head h1 { font-size: 32px; font-weight: 800; margin-top: 8px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 640px; }
.page-head-slim { padding: 16px 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; color: #9A9DA0; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- صفحة التصنيف */
.listing { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }
.listing-side { display: grid; gap: 20px; }
.filters { border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters-head h2 { font-size: 16px; }
.filters-head .icon-btn { display: none; }
.filter-box { padding: 16px; border-bottom: 1px solid var(--line); }
.filter-box h3 { font-size: 14px; margin-bottom: 10px; }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--store-primary); margin: 0; }
.check span:first-of-type { flex: 1; }
.count-sm { font-size: 12px; color: var(--muted); }
.price-range { display: flex; align-items: center; gap: 8px; }
.field { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--white); }
textarea.field { padding: 10px 12px; resize: vertical; }
.filters > .btn { margin: 16px; width: calc(100% - 32px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { padding: 7px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--ink); }
.chip[aria-current] { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding: 10px 14px; background: var(--soft); border-radius: var(--r); }
.toolbar p { font-size: 14px; color: var(--muted); }
.toolbar p b { color: var(--ink); }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.toolbar select { width: auto; min-height: 38px; }
.filters-toggle { display: none; }
body[data-books-per-row="5"] .listing .book-grid, body[data-books-per-row="6"] .listing .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r); font-weight: 700; font-size: 14px; }
.pagination a:hover { border-color: var(--store-primary); color: var(--store-primary-dark); }
.pagination [aria-current] { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); }
.pagination .gap { border-color: transparent; }
.pagination .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- صفحة الكتاب */
.pdp { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.gallery { display: grid; gap: 14px; }
.gallery-main { position: relative; display: grid; place-items: center; padding: 40px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--soft); }
.gallery-main img { width: min(300px, 100%); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 16px 34px rgba(0, 0, 0, .18); }
.gallery-main .book-flags { top: 14px; right: 14px; }
.thumbs { display: flex; gap: 10px; justify-content: center; }
.thumbs button { width: 76px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); box-shadow: 0 0 0 1px var(--store-primary); }
.thumbs img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.pdp-info { display: grid; gap: 14px; justify-items: start; }
.pdp-type { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pdp-type .type-dot { width: 26px; height: 26px; }
.pdp-type .type-dot .icon { width: 14px; height: 14px; }
.pdp-info h1 { font-size: 34px; font-weight: 800; line-height: 1.25; }
.pdp-author { color: var(--muted); }
.pdp-author a { color: var(--store-primary-dark); font-weight: 700; }
.pdp-rating { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.pdp-rating b { color: var(--ink); }
.pdp-price { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.pdp-lead { color: #3A3D40; line-height: 1.8; max-width: 640px; }
.sample-box { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--primary-softer); }
.sample-box > div:not(.wave) { flex: 1; }
.sample-box p { font-size: 13px; color: var(--muted); }
.wave { display: flex; align-items: center; gap: 3px; height: 40px; color: var(--type-audio); }
.wave span { width: 3px; border-radius: 2px; background: currentColor; }
.pdp-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pdp-meta li { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.pdp-meta li + li { border-inline-start: 1px solid var(--line); }
.pdp-meta .icon { color: var(--store-primary-dark); }
.pdp-meta small { display: block; font-size: 12px; color: var(--muted); }
.pdp-meta b { font-size: 14px; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--store-primary-dark); }
.stock .icon { width: 18px; height: 18px; }
.stock.out { color: var(--store-accent); }
.pdp-buttons { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.pdp-buttons .btn { flex: 1 1 180px; }
.pdp-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; width: 100%; background: var(--soft); border-radius: var(--r-lg); }
.pdp-perks li { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: 13px; }
.pdp-perks .icon { color: var(--store-primary-dark); }
.tabs { margin-top: 48px; }
.tab-list { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-list button { padding: 12px 20px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-list button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--store-primary); }
.tab-panel { padding: 28px 0 0; }
.prose { max-width: 820px; display: grid; gap: 14px; line-height: 1.9; }
.spec-table { width: 100%; max-width: 760px; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec-table th { width: 34%; color: var(--muted); font-weight: 500; background: var(--soft); }
.reviews-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; align-items: start; }
.reviews-side { display: grid; gap: 18px; }
.reviews-summary { display: flex; align-items: center; gap: 16px; }
.reviews-summary strong { font-size: 52px; line-height: 1; }
.reviews-summary small { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.rating-bars { display: grid; gap: 8px; font-size: 13px; }
.rating-bars li { display: grid; grid-template-columns: 56px 1fr 40px; align-items: center; gap: 10px; color: var(--muted); }
.bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.review-form { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--primary-softer); }
.review-form h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.review-form p { font-size: 13px; color: var(--muted); }
.star-field { border: 0; padding: 0; margin: 0; }
.star-input { 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: var(--star-off); }
.star-input label .icon { width: 26px; height: 26px; }
.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); border-radius: 4px; }
.review-form .btn { justify-self: start; }
.review-list { display: grid; gap: 16px; }

/* ---------------------------------------------------------------- صفحة المؤلّف */
.author-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: center; padding: 40px 48px; border-radius: var(--r-lg); background: linear-gradient(120deg, #FBF1D6 0%, #F8E6EC 55%, #E3F1EC 100%); }
.author-photo { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 6px solid var(--white); box-shadow: var(--shadow); }
.author-info { display: grid; gap: 10px; justify-items: start; }
.author-info .slide-tag { margin: 0; color: #9E2626; }
.author-info h1 { font-size: 36px; font-weight: 800; line-height: 1.2; }
.author-bio { max-width: 760px; line-height: 1.85; color: #2E3033; }
.author-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.author-stats div { padding: 10px 18px; background: rgba(255, 255, 255, .85); border-radius: var(--r); }
.author-stats b { display: block; font-size: 20px; }
.author-stats small { font-size: 12px; color: #45484B; }

/* ---------------------------------------------------------------- السلّة */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; border-style: hidden; box-shadow: 0 0 0 1px var(--line); }
.cart-table th { padding: 14px 16px; background: var(--soft); text-align: start; font-size: 13px; color: var(--muted); font-weight: 700; }
.cart-table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.cart-book { display: flex; align-items: center; gap: 14px; }
.cart-book img { width: 70px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
.cart-book h3 { font-size: 15px; }
.cart-book p { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.cart-book .pdp-type .type-dot { width: 22px; height: 22px; }
.cart-book .pdp-type .type-dot .icon { width: 12px; height: 12px; }
.cart-table .price { font-size: 15px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.qty button { display: grid; place-items: center; width: 36px; height: 38px; border: 0; background: var(--soft); }
.qty .icon { width: 16px; height: 16px; }
.qty input { width: 44px; height: 38px; border: 0; text-align: center; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.line-total { font-size: 15px; }
.cart-remove { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.cart-remove:hover { background: var(--soft); color: var(--store-accent); }
.cart-under { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.summary { display: grid; gap: 14px; padding: 24px; border-radius: var(--r-lg); background: var(--soft); }
.summary h2 { font-size: 20px; }
.coupon { display: flex; gap: 8px; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--white); border: 1px dashed var(--store-primary); font-size: 13px; }
.coupon-applied button { border: 0; background: none; color: var(--store-accent); font-weight: 700; font-size: 13px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.summary-row .minus { color: #9E2626; }
.summary-total { padding-top: 14px; border-top: 1px solid var(--line-strong); font-size: 18px; font-weight: 800; }
.note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); text-align: center; }
.note .icon { width: 15px; height: 15px; }
.empty-cart { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 20px; }
.empty-cart[hidden] { display: none; }

/* ---------------------------------------------------------------- 404 */
.notfound { text-align: center; }
.notfound .container { display: grid; justify-items: center; gap: 12px; }
.nf-circle { display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, #FFFFFF 0%, #E3F1EC 70%, #D2E9E2 100%); color: var(--store-primary-dark); }
.nf-circle .icon { width: 56px; height: 56px; stroke-width: 1.5; }
.empty-cart .nf-circle { width: 110px; height: 110px; }
.empty-cart .nf-circle .icon { width: 40px; height: 40px; }
.nf-code { font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: 2px; }
.notfound h1 { font-size: 28px; }
.notfound p { color: var(--muted); max-width: 520px; }
.nf-search { display: flex; gap: 6px; width: min(560px, 100%); padding: 4px; background: var(--soft); border-radius: var(--r); margin-top: 8px; }
.nf-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; outline: 0; }
.nf-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* ---------------------------------------------------------------- components.html */
.kit-block { padding: 36px 0; border-bottom: 1px solid var(--line); }
.kit-title { font-size: 20px; margin-bottom: 6px; }
.kit-note { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.kit-title + .kit-row, .kit-title + .kit-split, .kit-title + .reviews-row, .kit-title + .chips, .kit-title + .section-head { margin-top: 18px; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kit-swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kit-swatches span { display: flex; align-items: flex-end; min-height: 96px; padding: 12px; border-radius: var(--r); color: var(--white); border: 1px solid var(--line); }
.kit-swatches span.light { color: var(--ink); }
.kit-swatches b { font-size: 13px; direction: ltr; }
.kit-options { display: grid; gap: 14px; }
.kit-options > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kit-options b { min-width: 150px; }
.kit-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.kit-split { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 28px; align-items: start; }
.kit-stack { display: grid; gap: 24px; justify-items: start; }
.kit-stack .promo { width: min(380px, 100%); }

/* ---------------------------------------------------------------- خيارات الإظهار */
body[data-show-trust-bar="false"] .trust-section { display: none; }
body[data-show-reviews="false"] .reviews-section { display: none; }
body[data-show-newsletter="false"] .newsletter { display: none; }

/* ---------------------------------------------------------------- الحركة */
/* ---------------------------------------------------------------- ميزات المنصّة: عدّاد العروض، المدوّنة */
.deal-timer { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.deal-timer[hidden] { display: none; }
.dt-label { color: var(--muted); margin-inline-end: 8px; }
.dt-unit { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--white); line-height: 1.05; }
.dt-unit b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-unit small { font-size: 9.5px; color: #E2E2E2; }
.dt-sep { font-weight: 700; }
.section-head .deal-timer + .see-all { padding-inline-start: 16px; border-inline-start: 1px solid var(--line-strong); }
.posts-box .recent-note .see-all { display: inline-flex; margin-inline-start: 8px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; text-align: center; }
.post-grid-page { row-gap: 40px; margin-bottom: 36px; }
.post-card { display: grid; align-content: start; justify-items: center; gap: 10px; }
.post-img { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--white); }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-img img { transform: scale(1.04); }
.post-meta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.post-meta .icon { width: 16px; height: 16px; }
.post-title { font-size: 20px; font-weight: 500; line-height: 1.45; max-width: 30ch; }
.post-title a:hover { color: var(--store-primary-dark); }
.post-excerpt { color: var(--muted); font-size: 14.5px; max-width: 42ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-wrap { max-width: 820px; }
.article-img { margin: 0 0 28px; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--soft); }
.article-img img { width: 100%; height: 100%; object-fit: cover; }
.article-body { display: grid; gap: 18px; font-size: 17.5px; line-height: 2; margin-bottom: 26px; }
@media (max-width: 980px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.section-head:has(.deal-timer) { flex-wrap: wrap; }
	.deal-timer { order: 3; width: 100%; margin-inline-start: 0; }
	.dt-unit { width: 42px; height: 42px; }
	.post-grid { grid-template-columns: minmax(0, 1fr); }
	.article-body { font-size: 16.5px; }
}

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

/* ---------------------------------------------------------------- عروض أصغر */
@media (max-width: 1279px) {
	body[data-books-per-row="6"] { --per-row: 5; }
	.slide-title { font-size: 38px; }
	.slide-body { padding: 0 44px; max-width: 54%; }
	.recent-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.recent-row > :nth-child(n+6) { display: none; }
	.offer-text { padding: 24px 26px; }
	.offer-text b { font-size: 21px; }
	.listing { grid-template-columns: 240px minmax(0, 1fr); }
	body[data-books-per-row="4"] .listing .book-grid, body[data-books-per-row="5"] .listing .book-grid, body[data-books-per-row="6"] .listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1099px) {
	body[data-books-per-row="5"], body[data-books-per-row="6"] { --per-row: 4; }
	.header-main .container { gap: 18px; }
	.account-text { display: none; }
	.nav-list { gap: 18px; }
	.author-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.author-cell:nth-child(3n+1) { border-inline-start: 0; }
	.author-cell:nth-child(n+4) { border-top: 1px solid var(--line); }
	.type-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.trust-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.trust-bar li:nth-child(3) { border-inline-start: 0; }
	.trust-bar li:nth-child(n+3) { border-top: 1px solid var(--line); }
	.pdp-perks { grid-template-columns: 1fr; }
}

/* الهاتف واللوح: القائمة درجٌ جانبيّ */
@media (max-width: 980px) {
	body { padding-bottom: 64px; }
	.topbar .container { grid-template-columns: 1fr; min-height: 34px; }
	.topbar-links, .topbar-phone { display: none; }
	.header-main .container { flex-wrap: wrap; gap: 10px 12px; min-height: 64px; padding: 10px 0; }
	.menu-toggle { display: inline-grid; border-color: transparent; background: var(--soft); }
	.brand { margin-inline-end: auto; }
	.brand-name { font-size: 19px; }
	.brand img { width: 38px; height: 38px; }
	.header-search { order: 5; flex: 1 0 100%; max-width: none; }
	.header-search select { display: none; }
	.header-search .btn { padding: 0 16px; }
	.account-link, .wish-link { display: none; }
	.header-nav { display: none; }
	.hero-grid { grid-template-columns: 1fr; }
	.side-cats-home { display: none; }
	.hero-main { padding-top: 6px; }
	.listing { grid-template-columns: 1fr; }
	.side-cats-box { display: none; }
	.filters { position: fixed; top: 0; bottom: 0; right: 0; z-index: 61; width: min(340px, 88vw); overflow-y: auto; border-radius: 0; transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s; }
	body.filters-open .filters { transform: none; visibility: visible; }
	.filters-head .icon-btn { display: inline-grid; }
	.filters-toggle { display: inline-flex; }
	body[data-books-per-row] .listing .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	body[data-books-per-row] { --per-row: 3; }
	.pdp { grid-template-columns: 1fr; gap: 28px; }
	.reviews-layout { grid-template-columns: 1fr; }
	.reviews-row { grid-template-columns: 1fr; }
	.cart-layout { grid-template-columns: 1fr; }
	.offer { min-height: 210px; }
	.offer-text { max-width: 60%; }
	.footer-main { grid-template-columns: 1fr 1fr 1fr; }
	.footer-about, .footer-news { grid-column: 1 / -1; }
	.recent-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.recent-row > :nth-child(n+5) { display: none; }
	.kit-split { grid-template-columns: 1fr; }
	.kit-split .side-cats-box { display: block; }
	.mobile-bar {
		position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
		display: grid; grid-template-columns: repeat(5, 1fr);
		background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
	}
	.mobile-bar a, .mobile-bar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; border: 0; background: none; font-size: 11px; font-weight: 700; color: var(--ink); }
	.mobile-bar .count { top: 2px; left: calc(50% - 22px); }
}

@media (max-width: 760px) {
	.section { padding: 40px 0; }
	.section-title { font-size: 22px; }
	.section-head { margin-bottom: 18px; }
	.slide { flex-direction: column; align-items: stretch; aspect-ratio: auto; background: #EEF3F1; }
	.slide-img { position: static; order: 2; aspect-ratio: 4 / 3; height: auto; object-position: left bottom; }
	.slide-body { max-width: none; padding: 26px 22px 12px; }
	.slide-title { font-size: 28px; }
	.slide-text { font-size: 15px; margin: 8px 0 18px; }
	.slider-nav { right: auto; left: 14px; bottom: 14px; }
	.trust-bar h3 { font-size: 14px; }
	.trust-bar p { font-size: 12px; }
	.cat-row { gap: 16px; }
	.cat-item { flex-basis: 112px; }
	.cat-circle { width: 112px; height: 112px; }
	.cat-item b { font-size: 14px; }
	body[data-books-per-row] { --per-row: 2; }
	body[data-books-per-row] .listing .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.book-grid, .book-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	[data-region] > .container > .book-grid > :nth-child(n+5) { display: none; }
	.book-card { padding: 8px; }
	.book-media { padding: 10px 14px; }
	.book-title { font-size: 14px; }
	.price { font-size: 15px; }
	.book-body .btn { padding: 0 8px; font-size: 12.5px; gap: 6px; }
	.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.author-cell:nth-child(n) { border-inline-start: 1px solid var(--line); border-top: 0; }
	.author-cell:nth-child(2n+1) { border-inline-start: 0; }
	.author-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
	.author-cell img { width: 80px; height: 80px; }
	.recent-box { padding: 28px 16px; border-radius: var(--r-lg); }
	.recent-row { display: flex; overflow-x: auto; gap: 12px; scroll-snap-type: x proximity; padding-bottom: 6px; }
	.recent-row > :nth-child(n) { display: grid; }
	.mini-card { flex: 0 0 132px; scroll-snap-align: start; }
	.footer-main { grid-template-columns: 1fr 1fr; padding: 40px 0 28px; gap: 26px 18px; }
	.footer-phone { font-size: 21px; }
	.page-head h1 { font-size: 26px; }
	.toolbar { flex-wrap: wrap; }
	.pdp-info h1 { font-size: 26px; }
	.pdp-meta { grid-template-columns: 1fr; }
	.pdp-meta li + li { border-inline-start: 0; border-top: 1px solid var(--line); }
	.gallery-main { padding: 26px; }
	.gallery-main img { width: min(240px, 100%); }
	.sample-box { flex-wrap: wrap; }
	.sample-box .btn { width: 100%; }
	.author-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 28px 20px; gap: 18px; }
	.author-info { justify-items: center; }
	.author-photo { width: 150px; height: 150px; }
	.author-info h1 { font-size: 28px; }
	.author-stats { justify-content: center; }
	.cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
	.cart-table { box-shadow: none; border: 0; }
	.cart-table thead { display: none; }
	.cart-table tr { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; padding: 12px; }
	.cart-table td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; }
	.cart-table td:first-child { display: block; padding-inline-end: 40px; }
	.cart-table td[data-label]::before { content: attr(data-label); font-size: 13px; color: var(--muted); }
	.cart-table .cell-remove { position: absolute; top: 8px; left: 8px; width: auto; padding: 0; }
	.nf-code { font-size: 72px; }
	.nf-circle { width: 120px; height: 120px; }
	.notfound h1 { font-size: 23px; }
	.kit-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
	.offer-text { max-width: 68%; padding: 20px; }
	.offer-text b { font-size: 19px; }
	.footer-main { grid-template-columns: 1fr 1fr; }
	.newsletter-field .btn { padding: 0 16px; }
	.header-search .btn { padding: 0 14px; }
	.coupon .btn { padding: 0 14px; }
}

/* ---------------------------------------------------------------- الإصدار الثاني: إيقاع الرئيسيّة */
/* قسمان أبيضان متتاليان لا يجمعان حشوتَيهما: مسافةٌ واحدة بين كلّ قسمين */
.section:not(.section-soft, .section-tint) + .section:not(.section-soft, .section-tint) { padding-top: 0; }
.section-tint { background: var(--primary-softer); }
.head-text { display: grid; gap: 2px; }
.section-sub { font-size: 14px; color: var(--muted); }
.head-tools { display: flex; align-items: center; gap: 16px; }

/* النظرة السريعة: تطفو فوق الغلاف تحت المفضّلة، ولا تحجز مكانًا */
.quick-btn { position: absolute; top: 48px; left: 8px; z-index: 2; width: 34px; height: 34px; border-color: transparent; }
.quick-btn .icon { width: 17px; height: 17px; }
@media (hover: hover) {
	.quick-btn { opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
	.book-card:hover .quick-btn, .book-card:focus-within .quick-btn { opacity: 1; transform: none; }
}

/* صفوفٌ كاملة: لا صفّ نصف فارغ أيًّا كان عدد الكتب في الصفّ */
body[data-books-per-row="4"] .row-fill > :nth-child(n+5),
body[data-books-per-row="5"] .row-fill > :nth-child(n+6) { display: none; }

/* دوّارٌ أفقيّ: مختارات المتجر */
.book-scroll {
	display: grid; grid-auto-flow: column; gap: 20px;
	grid-auto-columns: calc((100% - (var(--per-row) - 1) * 20px) / var(--per-row));
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.book-scroll::-webkit-scrollbar { display: none; }
.book-scroll > * { scroll-snap-align: start; }

/* تبويبات «الأكثر مبيعًا» */
.has-tabs .row-tabs { margin-inline: 28px auto; }
.row-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.row-tabs::-webkit-scrollbar { display: none; }
.row-tab { flex: none; min-height: 40px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--white); font-size: 14px; font-weight: 500; color: var(--ink); transition: background .2s, border-color .2s, color .2s; }
.row-tab:hover { border-color: var(--store-primary); }
.row-tab[aria-selected="true"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--white); font-weight: 700; }
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

/* كتاب الأسبوع: كتابٌ واحد بغلافٍ كبير */
.week-box { position: relative; display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 56px; padding: 36px 48px 40px; border-radius: var(--r-lg); background: linear-gradient(115deg, var(--primary-soft) 0%, var(--primary-softer) 46%, #FFFFFF 100%); border: 1px solid var(--line); overflow: hidden; }
.week-box::after { content: ""; position: absolute; left: -90px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; border: 36px solid color-mix(in srgb, var(--store-primary) 7%, transparent); pointer-events: none; }
.week-head { position: relative; z-index: 1; grid-column: 2; grid-row: 1; display: grid; gap: 2px; justify-items: start; margin-bottom: 14px; }
/* المقال والحاوية لا يرسمان صندوقًا: الغلاف والنصّ يأخذان عمودَي الصندوق مباشرةً */
.week-items, .week-book { display: contents; }
.week-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--store-primary-dark); }
.week-kicker .icon { width: 16px; height: 16px; color: var(--gold); fill: currentColor; }
.week-cover { position: relative; z-index: 1; grid-column: 1; grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #FFFFFF 58%, rgba(255, 255, 255, 0) 71%); }
.week-cover img { width: 58%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 18px 36px rgba(20, 20, 20, .22); transform: rotate(-3deg); transition: transform .3s; }
.week-cover:hover img { transform: rotate(0); }
.week-cover .type-dot { position: absolute; top: 14%; right: 14%; z-index: 1; }
.week-body { position: relative; z-index: 1; grid-column: 2; grid-row: 2; display: grid; gap: 10px; justify-items: start; align-content: start; }
.week-title { font-size: 32px; font-weight: 800; line-height: 1.25; }
.week-title a:hover { color: var(--store-primary-dark); }
.week-author { color: var(--muted); }
.week-author a { color: var(--store-primary-dark); font-weight: 700; }
.week-desc { max-width: 760px; color: #3A3D40; line-height: 1.85; }
.week-desc p + p { margin-top: 6px; }
.week-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.week-facts li { display: grid; padding: 8px 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); line-height: 1.4; }
.week-facts small { font-size: 12px; color: var(--muted); }
.week-facts b { font-size: 14px; }
.week-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 6px; }

@media (max-width: 1279px) {
	body[data-books-per-row="6"] .row-fill > :nth-child(n+6) { display: none; }
	/* أزرار السلايدر على جهة الرسم حتّى لا تغطّي زرّ الشريحة */
	.slider-nav { right: auto; left: 24px; }
	.promo { padding-inline: 92px 14px; }
	.promo-arrow { display: none; }
	.promo-text b { font-size: 15px; }
	/* بانرات العروض: شريطٌ يُمرَّر بدل ثلاثة أعمدةٍ ضيّقة */
	.offer-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.offer-row::-webkit-scrollbar { display: none; }
	.offer-row .offer { flex: 0 0 calc(50% - 8px); scroll-snap-align: start; }
}
@media (max-width: 1099px) {
	body[data-books-per-row="5"] .row-fill > :nth-child(n+5),
	body[data-books-per-row="6"] .row-fill > :nth-child(n+5) { display: none; }
	.week-box { grid-template-columns: 250px minmax(0, 1fr); column-gap: 32px; }
	.week-title { font-size: 28px; }
}
@media (max-width: 980px) {
	body[data-books-per-row] .row-fill > :nth-child(n) { display: flex; }
	body[data-books-per-row] .row-fill > :nth-child(n+7) { display: none; }
	.has-tabs { flex-wrap: wrap; }
	.has-tabs .row-tabs { order: 3; width: 100%; margin: 0; }
	.offer-row .offer { flex-basis: 62%; }
	.promo-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.promo-row::-webkit-scrollbar { display: none; }
	.promo-row .promo { flex: 0 0 44%; scroll-snap-align: start; }
	.week-box { padding: 28px 28px 32px; }
}
@media (max-width: 760px) {
	.section-sub { font-size: 13px; }
	.head-tools .see-all { display: none; }
	.book-scroll { gap: 12px; grid-auto-columns: 44%; }
	.row-tab { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
	/* شريط الثقة: شريطٌ واحد يُمرَّر */
	.trust-bar { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; border: 0; border-radius: 0; }
	.trust-bar::-webkit-scrollbar { display: none; }
	.trust-bar li, .trust-bar li:nth-child(n) { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); scroll-snap-align: start; }
	.trust-bar li + li { border-inline-start: 1px solid var(--line); }
	.trust-bar p { white-space: nowrap; }
	.trust-icon { width: 36px; height: 36px; }
	.trust-icon .icon { width: 18px; height: 18px; }
	/* البانرات الصغيرة: شريطٌ يُمرَّر */
	.promo-row { gap: 10px; }
	.promo-row .promo { flex-basis: 80%; min-height: 72px; }
	.slide-img { aspect-ratio: 16 / 10; }
	.offer-row .offer { flex-basis: 86%; }
	/* تسوّق حسب النوع: أربع بطاقاتٍ صغيرة */
	.type-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.type-tile { min-height: 150px; padding: 16px; }
	.type-tile-text { max-width: 100%; }
	.type-tile-text b { font-size: 17px; }
	.type-tile-text small { font-size: 13px; }
	.type-tile-text .link-arrow { margin-top: 4px; }
	.type-tile img { top: 12px; left: 10px; width: 42%; transform: none; }
	.type-tile:hover img { transform: scale(1.05); }
	.week-box { padding: 22px 16px 26px; }
	.week-box { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
	.week-head, .week-cover, .week-body { grid-column: 1; grid-row: auto; }
	.week-head { justify-items: center; text-align: center; margin-bottom: 4px; }
	.week-cover { width: min(240px, 70%); justify-self: center; }
	.week-body { justify-items: center; text-align: center; }
	.week-title { font-size: 24px; }
	.week-facts, .week-buy { justify-content: center; }
}

/* ---------------------------------------------------------------- الإصدار الثاني: صفحة الكتاب والتصنيف والمؤلّف */
/* اختيار النسخة (book.formats): يُخفى إن لم يكن للعنوان غير صيغةٍ واحدة */
.formats-box { display: grid; gap: 8px; width: 100%; }
.formats-box:not(:has([data-repeat="format"] ~ .format-opt)) { display: none; }
.formats-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.formats { display: flex; flex-wrap: wrap; gap: 10px; }
.format-opt { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 14px 6px 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--white); transition: border-color .2s, background .2s; }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt[aria-current] { border-color: var(--store-primary); background: var(--primary-softer); box-shadow: inset 0 0 0 1px var(--store-primary); }
.format-opt .type-dot { width: 28px; height: 28px; box-shadow: none; }
.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); }
.format-opt[aria-current] .format-price { color: var(--store-primary-dark); font-weight: 700; }
/* الكمّيّة قبل الإضافة: في صفحة الكتاب وحدها */
.qty-lg button { width: 42px; height: 48px; }
.qty-lg input { width: 48px; height: 48px; font-weight: 700; }
.pdp-buttons .qty { flex: none; }

/* التصنيف: عرض الشبكة أو القائمة، والتصفية الحاليّة */
.view-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--white); }
.view-switch button { display: grid; place-items: center; width: 40px; height: 38px; border: 0; background: none; color: var(--muted); }
.view-switch button + button { border-inline-start: 1px solid var(--line-strong); }
.view-switch button[aria-pressed="true"] { background: var(--primary-soft); color: var(--store-primary-dark); }
.view-switch .icon { width: 18px; height: 18px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 18px; }
.active-label { font-size: 13px; color: var(--muted); }
.chip-x { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--primary-softer); border-color: color-mix(in srgb, var(--store-primary) 30%, #FFFFFF); font-size: 13px; color: var(--store-primary-dark); }
.chip-x .icon { width: 14px; height: 14px; }
.clear-link { font-size: 13px; font-weight: 700; color: var(--store-accent); text-decoration: underline; text-underline-offset: 3px; }
.listing-main.is-list .book-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
.listing-main.is-list .book-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; }
.listing-main.is-list .book-body { padding: 4px 0; justify-content: center; }
.listing-main.is-list .book-body .btn { margin-top: 4px; width: auto; align-self: start; padding: 0 22px; }
.listing-main.is-list .book-title { font-size: 17px; }

@media (max-width: 760px) {
	.format-opt { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 6px; text-align: center; }
	.format-opt .type-dot { display: none; }
	.pdp-buttons .qty { order: -1; }
	.pdp-buttons .btn-primary { flex: 1 1 0; }
	.view-switch { display: none; }
	.listing-main.is-list .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.listing-main.is-list .book-card { display: flex; }
}

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