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

:root {
	--store-primary: #FF9900;
	--store-primary-dark: #E07E00;
	--store-accent: #202C3C;
	--store-bg: #F2F3F8;
	--store-text: #202326;

	/* محايدة ومشتقّة */
	--surface: #FFFFFF;
	--soft: #F5F6F9;
	--line: #E3E5EC;
	--line-strong: #D3D6DF;
	--muted: #585D70;
	--topbar: color-mix(in srgb, var(--store-accent) 70%, #000);
	--on-dark: #FFFFFF;
	--on-dark-muted: #C3CAD6;
	--sale: #C62828;
	--new: #2E7D32;
	--gold: #F5A623;
	--type-print: #DB7056;
	--type-ebook: #5675A3;
	--type-audio: #986AB0;
	--type-educational: #3f8f6b;

	--r: 8px;
	--r-sm: 6px;
	--per-row: 5;
	--container: 1210px;
	--font: "Tajawal", system-ui, sans-serif;
}

body[data-corners="sharp"] { --r: 0px; --r-sm: 0px; }
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-padding-top: 150px; }
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 { margin: 0; line-height: 1.35; font-weight: 700; }
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; flex: none;
	fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }
.visually-hidden {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link {
	position: absolute; top: -60px; right: 12px; z-index: 100;
	background: var(--store-primary); color: var(--store-accent); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: 8px; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
main { padding-bottom: 28px; }

/* ---------- الأزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 0 20px; border-radius: var(--r-sm);
	border: 1px solid transparent; font-weight: 700; font-size: 14.5px; white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--store-primary); color: var(--store-accent); }
.btn-primary:hover { background: var(--store-primary-dark); }
.btn-outline { background: var(--surface); color: var(--store-accent); border-color: var(--store-primary); }
.btn-outline:hover { background: var(--store-primary); }
.btn-ghost { background: var(--soft); color: var(--store-accent); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--store-accent); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { min-height: 48px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.link-btn {
	display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0;
	color: var(--store-accent); font-weight: 500; font-size: 14px;
}
.link-btn .icon { width: 18px; height: 18px; color: var(--muted); }
.link-btn[aria-pressed="true"] .icon { color: var(--sale); fill: currentColor; }

/* ---------- الشريط العلويّ */
/* الرأس ثابتٌ في الأعلى؛ الشريط العلويّ وحده يمضي مع التمرير (يضبط theme.js مقدار top بارتفاعه) */
.site-header { position: sticky; top: -42px; z-index: 50; background: var(--store-accent); }
.topbar { background: var(--topbar); color: var(--on-dark); font-size: 13.5px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; }
.topbar-note { font-weight: 500; text-align: center; flex: 1; }
.topbar-note:empty { display: none; }
.topbar-links { display: flex; gap: 18px; }
.topbar-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--on-dark); }
.topbar-links a:hover { color: var(--store-primary); }
.topbar-links .icon { width: 16px; height: 16px; }
.social { display: flex; gap: 6px; align-items: center; }
.social a { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.social .icon { width: 16px; height: 16px; }
.topbar-social a:hover { color: var(--store-primary); }

/* ---------- الرأس الكحليّ */
.header-main { background: var(--store-accent); color: var(--on-dark); }
.header-main .container { display: flex; align-items: center; gap: 26px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: -.2px; }
.header-search {
	flex: 1; display: flex; align-items: stretch; min-width: 0; height: 50px;
	background: var(--surface); border-radius: var(--r-sm); overflow: hidden;
}
.header-search select {
	flex: none; width: 150px; border: 0; background: #E9EBF0; color: var(--store-text);
	padding: 0 14px; font-size: 14px; cursor: pointer;
}
.header-search input { flex: 1; min-width: 0; border: 0; padding: 0 16px; font-size: 14.5px; background: transparent; color: var(--store-text); }
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus { outline: none; }
.header-search:focus-within { box-shadow: 0 0 0 2px var(--store-primary); }
.header-search button { flex: none; width: 56px; border: 0; background: var(--store-primary); color: var(--store-accent); display: grid; place-items: center; }
.header-search button:hover { background: var(--store-primary-dark); }
.header-call { display: flex; align-items: center; gap: 10px; flex: none; }
.header-call small { display: block; font-size: 13px; color: var(--on-dark-muted); line-height: 1.3; }
.header-call b { font-size: 15px; font-weight: 700; }
.call-icon { width: 30px; height: 30px; color: var(--store-primary); stroke-width: 1.5; }
.header-actions { display: flex; gap: 6px; flex: none; }
.hdr-icon {
	position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
	border-radius: 50%; border: 0; background: transparent; color: inherit;
}
.hdr-icon .icon { width: 25px; height: 25px; stroke-width: 1.6; }
.hdr-icon:hover { color: var(--store-primary); }
.count-badge {
	position: absolute; top: 2px; left: 2px; min-width: 19px; height: 19px; padding: 0 5px;
	border-radius: 10px; background: var(--store-primary); color: var(--store-accent);
	font-size: 11.5px; font-weight: 800; line-height: 19px; text-align: center;
}
.menu-toggle { display: none; }

/* ---------- صفّ التنقّل */
.header-nav { background: var(--store-accent); color: var(--on-dark); border-top: 1px solid rgba(255,255,255,.08); }
.header-nav .container { display: flex; align-items: center; gap: 30px; min-height: 52px; }
.cats-menu { position: relative; align-self: stretch; display: flex; }
.cats-btn {
	display: flex; align-items: center; gap: 10px; padding: 0 14px; min-width: 258px;
	background: transparent; border: 0; border-bottom: 3px solid var(--store-primary); color: var(--on-dark); font-weight: 700; font-size: 15px;
}
.cats-btn .icon:last-child { margin-inline-start: auto; width: 16px; height: 16px; transition: transform .2s; }
.cats-menu.open .cats-btn .icon:last-child { transform: rotate(180deg); }
.cats-drop {
	position: absolute; top: 100%; inset-inline-start: 0; width: 258px; z-index: 40;
	background: var(--surface); color: var(--store-text); border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r);
	padding: 8px 0; box-shadow: 0 14px 30px rgba(15, 22, 35, .14);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.cats-menu.open .cats-drop, .cats-menu:hover .cats-drop, .cats-menu:focus-within .cats-drop { opacity: 1; visibility: visible; transform: none; }
.cats-drop a { display: block; padding: 9px 18px; font-size: 14.5px; }
.cats-drop a:hover { background: var(--soft); color: var(--store-accent); }
.nav-list { display: flex; gap: 28px; }
.nav-list a { font-weight: 500; font-size: 15px; padding: 14px 0; display: inline-block; }
.nav-list a:hover { color: var(--store-primary); }
.nav-track { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark-muted); font-size: 14.5px; padding-inline-start: 18px; border-inline-start: 1px solid rgba(255,255,255,.2); }
.nav-track .icon { width: 18px; height: 18px; }
.nav-track:hover { color: var(--store-primary); }

/* ---------- الدرج الجانبيّ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 22, .5); z-index: 80; opacity: 0; visibility: hidden; transition: .2s; }
.drawer {
	position: fixed; top: 0; bottom: 0; right: 0; width: min(320px, 86vw); z-index: 90;
	background: var(--surface); overflow-y: auto; padding-bottom: 20px; display: none;
}
body.drawer-open .drawer { display: block; animation: slide-in .25s ease-out; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
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: 12px 16px; background: var(--store-accent); color: var(--on-dark); }
.drawer-head .brand-name { font-size: 21px; }
.drawer-head .brand img { width: 36px; height: 36px; }
.drawer-nav { padding: 6px 0; border-bottom: 1px solid var(--line); }
.drawer-nav a { display: block; padding: 10px 18px; font-weight: 500; }
.drawer-cats a { padding-inline-start: 28px; font-weight: 400; font-size: 14.5px; }
.drawer-label { padding: 12px 18px 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.drawer-call { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 700; color: var(--store-accent); }
.drawer-call .icon { color: var(--store-primary); }

/* ---------- الصناديق: بصمة العائلة */
.box { background: var(--surface); border-radius: var(--r); padding: 22px; margin-top: 20px; }
.box-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.box-title { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; color: var(--store-text); }
.box-title small { font-size: 15px; color: var(--muted); font-weight: 500; }
.box-icon { width: 24px; height: 24px; color: var(--store-primary); stroke-width: 2; }
.see-all { display: inline-flex; align-items: center; gap: 2px; font-size: 14.5px; color: var(--muted); font-weight: 500; }
.see-all .icon { width: 16px; height: 16px; }
.see-all:hover { color: var(--store-accent); }

/* ---------- الواجهة: قائمة مفتوحة + سلايدر + بانران + بطاقات الأنواع */
.hero-wrap { display: flex; margin-top: 18px; background: var(--surface); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.side-cats { flex: 0 0 268px; border-inline-end: 1px solid var(--line); padding: 10px 0; }
.side-quick { padding: 0 8px 10px; margin: 0 12px 6px; border-bottom: 1px solid var(--line); }
.side-quick a, .side-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; font-size: 14.5px; border-radius: var(--r-sm); }
.side-quick .icon, .side-list .icon { width: 19px; height: 19px; color: var(--muted); }
.side-quick a:hover, .side-list a:hover { background: var(--soft); }
.side-quick a:hover .icon, .side-list a:hover .icon { color: var(--store-primary-dark); }
.side-list { padding: 0 12px; }
.side-list a { padding-block: 11px; }
.side-list .chev { margin-inline-start: auto; width: 15px; height: 15px; }
.hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hero-top { display: flex; flex: 1; min-height: 0; }
.hero-top:not(:has(*)) { display: none; }
.hero-main:not(:has(.hero-slider, .hero-pair)) .type-tiles { flex: 1; border-top: 0; }
.hero-slider { flex: 2; min-width: 0; position: relative; }
.hero-pair { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hero-pair .banner { flex: 1; border-radius: 0; }
.hero-top > .hero-pair:only-child { flex-direction: row; }

.slider { position: relative; height: 100%; min-height: 380px; background: var(--store-accent); }
.slides { display: flex; height: 100%; 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; display: flex; align-items: center; padding: 40px 44px 64px; color: var(--on-dark); overflow: hidden; }
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-text { position: relative; max-width: 52%; }
.kicker { display: inline-block; font-weight: 800; color: var(--store-primary); font-size: 15px; margin-bottom: 8px; }
.slide h1, .slide h2 { font-size: 38px; font-weight: 800; line-height: 1.25; margin-bottom: 12px; }
.slide p { color: #E6EAF1; font-size: 15.5px; margin-bottom: 22px; }
.slider-nav { position: absolute; z-index: 3; bottom: 16px; inset-inline: 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
.slider-arrow { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; }
.slider-arrow:hover { background: var(--store-primary); color: var(--store-accent); }
.slider-arrow .icon { width: 16px; height: 16px; }
.slider-dots { display: flex; gap: 6px; }
.slider-dots button { width: 8px; height: 8px; padding: 0; border-radius: 4px; border: 0; background: rgba(255,255,255,.45); transition: width .2s; }
.slider-dots button[aria-current="true"] { width: 24px; background: var(--store-primary); }

.type-tiles { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.type-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 20px 12px 18px; background: var(--soft); border-inline-start: 1px solid var(--line); transition: background .15s; }
.type-tile:first-child { border-inline-start: 0; }
.type-tile:hover { background: var(--surface); }
.tile-dot { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.tile-dot .icon { width: 26px; height: 26px; }
.type-tile[data-type="print"] .tile-dot { background: var(--type-print); }
.type-tile[data-type="ebook"] .tile-dot { background: var(--type-ebook); }
.type-tile[data-type="audio"] .tile-dot { background: var(--type-audio); }
.type-tile[data-type="educational"] .tile-dot { background: var(--type-educational); }
.type-tile small { color: var(--muted); font-size: 13.5px; }
.type-tile strong { font-size: 18px; font-weight: 800; color: var(--store-text); }
.type-tile em { font-style: normal; box-shadow: inset 0 -4px 0 var(--store-primary); }
body[data-show-type-tiles="false"] .type-tiles { display: none; }
/* إن أُخفي كلّ ما في الواجهة بقيت القائمة؛ فلا داعي لها وحدها */
.hero-wrap:not(:has(.hero-slider, .hero-pair, .type-tiles)) { display: none; }
body[data-show-type-tiles="false"] .hero-wrap:not(:has(.hero-slider, .hero-pair)) { display: none; }

/* ---------- البانرات */
.banner {
	position: relative; display: flex; align-items: center; overflow: hidden; border-radius: var(--r);
	color: var(--on-dark); background: var(--store-accent); min-height: 150px;
}
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.banner:hover > img { transform: scale(1.03); }
.banner-text { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 22px 26px; max-width: 62%; }
.banner-text strong { font-size: 22px; font-weight: 800; line-height: 1.3; }
.banner-text p { color: #E6EAF1; font-size: 14px; }
.banner-text .btn { margin-top: 10px; }
.banner-side .banner-text { max-width: 58%; }
.banner-side .banner-text strong { font-size: 20px; }
.hero-pair .banner + .banner { border-top: 1px solid rgba(255,255,255,.1); }
.banner-pair { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px; }
.banner-pair .banner { min-height: 240px; }
.banner-wide .banner-text strong { font-size: 28px; }
.banner-tall { height: 100%; min-height: 440px; align-items: flex-start; }
.banner-tall .banner-text { max-width: 100%; padding-top: 30px; }
.banner-tall .banner-text strong { font-size: 26px; }
.banner-cat { min-height: 190px; border-radius: var(--r-sm); }
.banner-strip { min-height: 130px; margin-top: 20px; justify-content: center; }
.banner-strip > img { object-position: left center; }
.banner-strip .banner-text { max-width: 70%; align-items: center; text-align: center; }
.banner-strip .banner-text strong { font-size: 26px; }

/* ---------- شريط الثقة */
.trust-bar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-radius: var(--r); margin-top: 20px; }
.trust-item { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-inline-start: 1px solid var(--line); }
.trust-item:first-child { border-inline-start: 0; }
.trust-item > .icon { width: 34px; height: 34px; color: var(--store-primary-dark); stroke-width: 1.5; }
.trust-item b { display: block; font-size: 15.5px; }
.trust-item small { color: var(--muted); font-size: 13.5px; }
body[data-show-trust-bar="false"] .trust-bar { display: none; }

/* ---------- بطاقة الكتاب: إطارٌ رماديّ رفيع وسعرٌ داكن */
.book-grid { display: grid; grid-template-columns: repeat(var(--per-row), minmax(0, 1fr)); gap: 18px; }
.book-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color .15s; }
.book-card:hover { border-color: var(--line-strong); }
.book-media { position: relative; padding: 16px 16px 0; }
.book-media > a { display: block; background: var(--soft); border-radius: calc(var(--r-sm) - 2px); padding: 14px 18px; }
.book-media img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 6px 14px rgba(20, 28, 40, .18); }
body[data-card-style="plain"] .book-card { border-color: transparent; }
body[data-card-style="plain"] .book-media { padding: 0; }
body[data-card-style="plain"] .book-media > a { border: 1px solid var(--line); }
body[data-card-style="plain"] .book-body { padding-inline: 2px; }
body[data-card-style="plain"] .type-dot { top: 8px; inset-inline-start: 8px; }

.type-dot {
	position: absolute; top: 22px; inset-inline-start: 22px; z-index: 2;
	width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff;
	box-shadow: 0 0 0 2px var(--surface);
}
.type-dot .icon { width: 16px; height: 16px; stroke-width: 2; }
.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-educational); }

.badge { display: inline-block; padding: 3px 10px; font-size: 12.5px; font-weight: 800; color: #fff; border-radius: 3px; line-height: 1.5; }
.badge-sale { background: var(--sale); }
.badge-new { background: var(--new); }
.book-media > .badge { position: absolute; top: 24px; left: 0; z-index: 2; border-radius: 0; padding: 3px 16px 3px 10px; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%); }
.stock-band { position: absolute; inset-inline: 16px; bottom: 40%; z-index: 2; text-align: center; padding: 6px; background: rgba(32, 35, 38, .86); color: #fff; font-weight: 700; font-size: 13.5px; }
.book-card.is-out .book-media img { filter: grayscale(.7); opacity: .75; }
.wish-btn {
	position: absolute; top: 22px; inset-inline-end: 22px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
	border: 1px solid var(--line); background: var(--surface); color: var(--store-accent); display: grid; place-items: center;
	opacity: 0; transition: opacity .15s;
}
.wish-btn .icon { width: 17px; height: 17px; }
.book-media > .badge ~ .wish-btn { top: 58px; }
.book-card:hover .wish-btn, .wish-btn:focus-visible, .wish-btn[aria-pressed="true"] { opacity: 1; }
.wish-btn[aria-pressed="true"] { color: var(--sale); }
.wish-btn[aria-pressed="true"] .icon { fill: currentColor; }
@media (hover: none) { .wish-btn { opacity: 1; } }

.book-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px 14px; 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); text-decoration: underline; text-decoration-color: var(--store-primary); }
.book-author { color: var(--muted); font-size: 13.5px; }
.rating-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rating .stars { display: inline-flex; gap: 1px; color: var(--gold); }
.rating .icon { width: 15px; height: 15px; }
.rating .off { color: #D6D9E0; }
.rating-lg .rating .icon { width: 19px; height: 19px; }
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; font-weight: 800; font-size: 16px; color: var(--store-text); }
.price del { font-size: 13.5px; }
.price-lg { font-size: 24px; }
.price-lg del { font-size: 16px; }
.cart-btn {
	flex: none; width: 38px; height: 38px; border-radius: var(--r-sm); border: 0;
	background: var(--store-primary); color: var(--store-accent); display: grid; place-items: center;
}
.cart-btn .icon { width: 19px; height: 19px; }
.cart-btn:hover { background: var(--store-primary-dark); }
.cart-btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* البطاقة الأفقيّة */
.hcard { display: flex; gap: 16px; align-items: center; }
.hcard-media { position: relative; flex: 0 0 80px; }
.hcard-media img { width: 80px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 4px 10px rgba(20, 28, 40, .16); }
.hcard-media .type-dot { top: 4px; inset-inline-start: 4px; width: 26px; height: 26px; }
.hcard-media .type-dot .icon { width: 14px; height: 14px; }
.hcard-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.hcard-body .btn { margin-top: 8px; }
.hlist { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 28px; }
.hlist-one { grid-template-columns: 1fr; gap: 22px; }

/* البطاقة المصغّرة واللوحات الثلاث */
.tri-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.tri-panels > .box { margin-top: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px 14px; }
.mini-card { grid-column: span 2; display: flex; flex-direction: column; gap: 6px; }
.mini-media { position: relative; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: grid; place-items: center; height: 150px; background: var(--surface); }
.mini-media img { height: 124px; width: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 4px 10px rgba(20, 28, 40, .16); }
.mini-media > a { display: flex; align-items: center; justify-content: center; }
.mini-media .type-dot { top: 6px; inset-inline-start: 6px; width: 24px; height: 24px; box-shadow: none; }
.mini-media .type-dot .icon { width: 13px; height: 13px; }
.mini-card .book-title { font-size: 14px; font-weight: 500; }
.mini-card .price { font-size: 14px; }
.mini-card .price del { font-size: 12.5px; }

/* ---------- التصنيفات في دوائر */
.cat-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 16px; }
.cat-circle { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cat-img { width: 100%; max-width: 118px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--soft); transition: transform .2s; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-circle:hover .cat-img { transform: translateY(-3px); }
.cat-name { font-size: 14.5px; font-weight: 500; }

/* ---------- التوصيات بتبويبات */
.rec-row { display: grid; grid-template-columns: 345px 1fr; gap: 20px; margin-top: 20px; align-items: stretch; }
.rec-row > .box { margin-top: 0; min-width: 0; }
.rec-banner { display: flex; }
.rec-banner .banner { flex: 1; }
.tab-btns { display: flex; gap: 22px; }
.tab-btns button { background: none; border: 0; padding: 4px 0 6px; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; }
.tab-btns button[aria-selected="true"] { color: var(--store-text); font-weight: 700; border-bottom-color: var(--store-primary); }
.tab-btns button:hover { color: var(--store-text); }

/* ---------- ثلاثيّة: بانر التصنيف وروابطه، ورائج الآن، وكتاب اليوم */
.trio-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 20px; margin-top: 20px; }
.trio-row > .box { margin-top: 0; min-width: 0; }
.cat-panel { padding: 0; overflow: hidden; }
.cat-panel .banner-cat { border-radius: 0; }
.cat-links-wrap { padding: 18px 22px 22px; }
.cat-links { columns: 2; column-gap: 20px; }
.cat-links li { break-inside: avoid; }
.cat-links a { display: block; padding: 5px 0; color: var(--muted); font-size: 14.5px; }
.cat-links a:hover { color: var(--store-text); }
.read-more { display: inline-flex; align-items: center; gap: 2px; margin-top: 10px; font-weight: 700; color: var(--new); font-size: 14.5px; }
.read-more .icon { width: 16px; height: 16px; }
.spot-card { display: flex; flex-direction: column; gap: 6px; }
.spot-gallery { display: flex; gap: 12px; margin-bottom: 8px; }
.thumbs { display: flex; flex-direction: column; gap: 8px; }
.thumbs button { width: 58px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--soft); }
.thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.thumbs img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.gallery-main { position: relative; flex: 1; display: grid; place-items: center; background: var(--soft); border-radius: var(--r-sm); padding: 14px; }
.gallery-main img { width: auto; max-width: 100%; max-height: 300px; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 8px 20px rgba(20, 28, 40, .22); }
.gallery-main .type-dot { top: 10px; inset-inline-start: 10px; }
.spot-gallery .gallery-main img { height: 250px; width: auto; max-height: none; }
.spot-card .book-title { font-size: 18px; }
.spot-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.spot-meta .price { font-size: 20px; }
.stock-line { color: var(--muted); font-size: 14px; }
.stock-line b { color: var(--new); }
.spot-card .btn { margin-top: 8px; }

/* ---------- وسوم رائجة */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { padding: 8px 18px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14.5px; color: var(--store-text); transition: .15s; }
.tag:hover { background: var(--store-accent); border-color: var(--store-accent); color: var(--on-dark); }

/* ---------- بطاقات العروض: غلافٌ أمام دائرة بلون المتجر */
.offer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.offer-card { background: var(--soft); border-radius: var(--r); padding: 18px 18px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.offer-media { position: relative; width: 100%; display: flex; justify-content: center; padding-top: 10px; }
.offer-disc { position: absolute; top: 16px; left: 50%; width: 76%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: var(--store-primary); }
.offer-media > a { position: relative; width: 46%; }
.offer-media img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; box-shadow: 0 10px 22px rgba(20, 28, 40, .3); }
.offer-media .type-dot { top: 6px; inset-inline-start: 6px; }
.offer-body { position: relative; z-index: 1; margin-top: -14px; width: 92%; background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 4px 12px rgba(20, 28, 40, .07); }
.offer-body .book-title { font-size: 15px; }
.offer-kit { grid-template-columns: 1fr; }

/* ---------- المؤلّفون */
.author-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.author-circle { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.author-circle img { width: 100%; max-width: 132px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin-bottom: 8px; border: 4px solid var(--soft); transition: border-color .2s; }
.author-circle:hover img { border-color: var(--store-primary); }
.author-circle b { font-size: 15px; }
.author-circle small { color: var(--muted); font-size: 13.5px; }

/* ---------- شاهدتَه مؤخّرًا */
.recent-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.recent-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.recent-media { position: relative; flex: 0 0 52px; }
.recent-media img { width: 52px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.recent-media .type-dot { top: -6px; inset-inline-start: -6px; width: 22px; height: 22px; }
.recent-media .type-dot .icon { width: 12px; height: 12px; }
.recent-card .book-title { font-size: 13.5px; }
.recent-card .price { font-size: 13.5px; }
.recent-card .price del { font-size: 12px; }

/* ---------- النشرة البريديّة */
.newsletter {
	display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 28px;
	background: var(--store-accent); color: var(--on-dark); border-radius: var(--r); padding: 34px 44px;
	background-image: radial-gradient(circle at 12% 120%, rgba(255,255,255,.06) 0 90px, transparent 91px), radial-gradient(circle at 46% -30%, rgba(255,255,255,.05) 0 70px, transparent 71px);
}
.nl-text { display: flex; align-items: center; gap: 18px; }
.nl-icon { width: 46px; height: 46px; color: var(--store-primary); stroke-width: 1.4; }
.newsletter h2 { font-size: 21px; font-weight: 800; }
.newsletter p { color: var(--on-dark-muted); font-size: 14.5px; }
.nl-field { display: flex; flex: 0 1 540px; background: var(--surface); border-radius: var(--r-sm); overflow: hidden; }
.nl-field input { flex: 1; min-width: 0; border: 0; padding: 0 18px; font-size: 14.5px; color: var(--store-text); background: transparent; }
.nl-field input::placeholder { color: var(--muted); }
.nl-field input:focus { outline: none; }
.nl-field .btn { border-radius: 0; min-height: 52px; padding: 0 26px; }
body[data-show-newsletter="false"] .newsletter { display: none; }

/* ---------- التذييل الأبيض */
.site-footer { background: var(--surface); margin-top: 32px; padding-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer-col h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.footer-col li a { display: inline-block; padding: 4px 0; color: var(--muted); font-size: 14.5px; }
.footer-col li a:hover { color: var(--store-text); }
.footer-contact p { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14.5px; margin-bottom: 10px; }
.footer-contact p .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--store-text); }
.footer-phone { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: var(--store-accent); margin-bottom: 14px; }
.footer-phone .call-icon { width: 28px; height: 28px; }
.footer-social { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; }
.footer-social .social a { background: var(--soft); color: var(--store-accent); }
.footer-social .social a:hover { background: var(--store-primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 36px; padding: 18px 0 22px; }
.footer-bottom .brand-name { font-size: 22px; color: var(--store-accent); }
.footer-bottom .brand img { width: 38px; height: 38px; }
.footer-bottom p { color: var(--muted); font-size: 14px; }

/* ---------- رأس الصفحات الداخليّة */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-block: 10px; }
.page-head h1 { font-size: 23px; font-weight: 700; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 8px; color: var(--line-strong); }
.breadcrumb a { display: inline-flex; align-items: center; }
.breadcrumb a:hover { color: var(--store-text); }
.breadcrumb .icon { width: 18px; height: 18px; color: var(--store-primary-dark); }

/* ---------- التصنيف */
.listing-layout { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.listing-main { min-width: 0; }
.filters-head { display: none; }
.fbox { padding: 18px; }
.fbox-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.fbox-head h2 { font-size: 16.5px; font-weight: 700; }
.clear-link { color: var(--sale); text-decoration: underline; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px 5px 6px; background: var(--soft); border-radius: var(--r-sm); font-size: 13.5px; }
.chip button { border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--muted); }
.chip .icon { width: 14px; height: 14px; }
.fsearch { position: relative; margin-bottom: 12px; }
.fsearch input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px 0 36px; background: var(--surface); }
.fsearch .icon { position: absolute; left: 10px; top: 10px; width: 18px; height: 18px; color: var(--muted); }
.check-list li + li { margin-top: 8px; }
.check-list label { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check-list input { width: 17px; height: 17px; accent-color: var(--store-accent); flex: none; margin: 0; }
.check-list .type-dot { position: static; width: 24px; height: 24px; box-shadow: none; }
.check-list .type-dot .icon { width: 13px; height: 13px; }
.fcount { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 0 8px; }
.range-track { display: block; height: 4px; background: var(--line); border-radius: 2px; position: relative; margin: 8px 6px 18px; }
.range-track span { position: absolute; inset-block: 0; right: 8%; left: 30%; background: var(--store-accent); border-radius: 2px; }
.range-track span::before, .range-track span::after { content: ""; position: absolute; top: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--store-accent); }
.range-track span::before { right: -8px; }
.range-track span::after { left: -8px; }
.price-inputs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.price-inputs input { width: 0; flex: 1; height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; text-align: center; color: var(--store-text); background: var(--surface); }

.strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.strip-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; text-align: center; }
.strip-item img { width: 100%; aspect-ratio: 1.1; object-fit: cover; border-radius: var(--r-sm); }
.strip-item:hover span { text-decoration: underline; }
.sort-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 18px; }
.sort-field { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.sort-field select, select.field { height: 40px; border: 0; background: var(--soft); border-radius: var(--r-sm); padding: 0 12px; font-size: 14.5px; color: var(--store-text); }
.listing-count { color: var(--muted); font-size: 14px; }
.listing-count b { color: var(--store-text); font-weight: 500; }
.col-switch { display: flex; gap: 6px; margin-inline-start: auto; }
.col-switch button { width: 38px; height: 38px; border: 0; border-radius: var(--r-sm); background: var(--soft); color: var(--store-accent); display: grid; place-items: center; }
.col-switch button[aria-pressed="true"] { background: var(--store-primary); }
.filters-toggle { display: none; }
.listing-grid { margin-top: 20px; }
.listing-grid[data-cols="3"] { --per-row: 3; }
.listing-grid[data-cols="4"] { --per-row: 4; }
.listing-grid[data-cols="5"] { --per-row: 5; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.pagination span { border: 0; background: none; }
.pagination a[aria-current="page"] { background: var(--store-accent); border-color: var(--store-accent); color: var(--on-dark); }
.pagination a:hover:not([aria-current]) { border-color: var(--store-primary); }
.pagination .icon { width: 16px; height: 16px; }

/* ---------- صفحة الكتاب: معرض ومعلومات في صندوق، وصندوق شراءٍ ثابت */
.pdp { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.pdp-main { display: grid; grid-template-columns: 340px 1fr; grid-template-areas: "gallery info" "extra info"; grid-template-rows: auto 1fr; gap: 0 28px; margin-top: 22px; }
.pdp-extra { grid-area: extra; display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pdp-info { grid-area: info; }
.pdp-gallery { grid-area: gallery; display: flex; flex-direction: column; gap: 12px; }
.pdp-gallery .gallery-main { padding: 28px; }
.pdp-gallery .gallery-main img { max-height: 420px; }
.pdp-gallery .thumbs { flex-direction: row; justify-content: center; }
.pdp-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; border-inline-start: 1px solid var(--line); padding-inline-start: 26px; }
.pdp-type { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.pdp-type .type-dot { position: static; width: 26px; height: 26px; box-shadow: none; }
.pdp-type .type-dot .icon { width: 14px; height: 14px; }
.pdp-title { font-size: 30px; font-weight: 800; }
.pdp-author { color: var(--muted); }
.pdp-author a { color: var(--store-text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--store-primary); text-underline-offset: 4px; }
.rating-lg .count a { color: var(--store-text); text-decoration: underline; }
.rating-lg { font-size: 14.5px; }
.pdp-lead { color: var(--muted); font-size: 15.5px; line-height: 1.8; }
.pdp-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
.pdp-section h3 { font-size: 18px; margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; }
.detail-grid div { display: flex; gap: 6px; font-size: 14.5px; }
.detail-grid small { color: var(--muted); font-size: 14.5px; }
.detail-grid small::after { content: ":"; }
.prose p + p { margin-top: 10px; }
.prose { color: var(--store-text); line-height: 1.85; }
.spec-list li { display: flex; gap: 8px; padding: 6px 0; font-size: 14.5px; }
.spec-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); margin-top: 10px; flex: none; }
.spec-list span { color: var(--muted); min-width: 92px; }
.perks li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14.5px; }
.perks .icon { color: var(--store-primary-dark); }
.pdp-side { position: sticky; top: 153px; display: flex; flex-direction: column; gap: 20px; margin-top: 22px; }
.pdp-side .box { margin-top: 0; }
.buy-title { font-size: 21px; font-weight: 800; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.buy-item { display: flex; align-items: center; gap: 14px; }
.buy-item img { width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; background: var(--soft); }
.buy-item small { display: block; color: var(--muted); font-size: 13.5px; }
.buy-item b { font-size: 14.5px; }
.buy-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; background: var(--soft); border-radius: var(--r-sm); padding: 4px; }
.qty button { width: 32px; height: 32px; border: 0; background: var(--surface); border-radius: var(--r-sm); display: grid; place-items: center; color: var(--store-accent); }
.qty .icon { width: 16px; height: 16px; }
.qty input { width: 44px; border: 0; background: transparent; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stock { font-weight: 700; color: var(--new); font-size: 14.5px; }
.buy-total { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.buy-total > span:first-child { color: var(--muted); font-size: 14.5px; margin-inline-end: auto; }
.buy-box .btn + .btn { margin-top: 10px; }
.buy-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.pdp-side .banner { min-height: 200px; }

/* الآراء */
.reviews-layout { display: grid; grid-template-columns: 320px 1fr; gap: 32px; }
.reviews-summary { display: flex; align-items: center; gap: 14px; }
.reviews-summary strong { font-size: 44px; font-weight: 800; line-height: 1; }
.reviews-summary small { display: block; color: var(--muted); }
.rating-bars { margin: 16px 0 20px; }
.rating-bars li { display: grid; grid-template-columns: 58px 1fr 38px; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); padding: 3px 0; }
.bar { height: 7px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.review-form { background: var(--soft); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.review-form h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.review-form h3 .icon { color: var(--store-primary-dark); }
.review-form p { color: var(--muted); font-size: 14px; }
.review-form textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); resize: vertical; }
.star-field { border: 0; padding: 0; margin: 0; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
[dir="rtl"] .star-input { flex-direction: row-reverse; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: #D6D9E0; }
.star-input label .icon { width: 24px; height: 24px; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--gold); }
.star-input input:focus-visible + label { outline: 2px solid var(--store-primary); }
.review-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-item:first-child { padding-top: 0; }
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--store-accent); color: var(--on-dark); display: grid; place-items: center; font-weight: 700; }
.review-top .rating { margin-inline-start: auto; }
.review-item p { line-height: 1.8; }
.review-item small { color: var(--muted); font-size: 13px; }

/* ---------- المؤلّف */
.author-head { display: grid; grid-template-columns: 250px 1fr 250px; gap: 0; padding: 26px 0; margin-top: 22px; }
.author-head > * { padding-inline: 26px; }
.author-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.author-card img { width: 120px; height: 120px; border-radius: var(--r); object-fit: cover; margin-bottom: 8px; }
.author-card h2 { font-size: 22px; }
.author-card p { color: var(--muted); font-size: 14.5px; }
.author-bio { border-inline: 1px solid var(--line); line-height: 1.85; color: var(--store-text); }
.author-bio p + p { margin-top: 10px; }
.author-facts { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.author-facts small { display: block; color: var(--muted); font-size: 13.5px; }
.author-facts b { font-size: 15px; }

/* ---------- السلّة */
.cart-layout { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.cart-layout > .box { margin-top: 22px; }
.clear-btn { background: none; border: 0; color: var(--sale); text-decoration: underline; font-size: 15px; font-weight: 500; }
.cart-items { border-top: 1px solid var(--line); }
.cart-row { display: grid; grid-template-columns: 96px 1fr auto 110px 40px; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { position: relative; background: var(--soft); border-radius: var(--r-sm); padding: 10px 14px; }
.cart-thumb img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.cart-thumb .type-dot { top: -6px; inset-inline-start: -6px; width: 24px; height: 24px; }
.cart-thumb .type-dot .icon { width: 13px; height: 13px; }
.cart-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-line { font-weight: 800; text-align: end; }
.remove-btn { width: 38px; height: 38px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); display: grid; place-items: center; }
.remove-btn:hover { background: var(--soft); color: var(--sale); }
.empty-cart { text-align: center; padding: 40px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-cart[hidden] { display: none; }
.empty-icon { width: 54px; height: 54px; color: var(--muted); }
.summary .box-title { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 15px; color: var(--muted); }
.summary-row b { color: var(--store-text); font-weight: 700; }
.summary-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; margin-bottom: 14px; color: var(--store-text); font-weight: 800; font-size: 18px; }
.summary-total b { font-weight: 800; font-size: 20px; }
.coupon { padding: 12px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.coupon label { font-weight: 700; font-size: 14.5px; }
.coupon-field { display: flex; width: 100%; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.coupon-field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; height: 44px; }
.coupon-field button { border: 0; background: var(--store-accent); color: var(--on-dark); padding: 0 18px; font-weight: 700; }
.summary-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.summary-note .icon { width: 18px; height: 18px; color: var(--new); }

/* ---------- 404 */
.notfound { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 44px 22px; margin-top: 26px; }
.nf-art { width: 280px; max-width: 100%; height: auto; }
.nf-shelf { fill: var(--store-accent); }
.nf-b1 { fill: var(--type-print); }
.nf-b2 { fill: var(--type-ebook); }
.nf-b3 { fill: var(--store-primary); }
.nf-glass { fill: none; stroke: var(--store-accent); stroke-width: 7; }
.nf-handle { stroke: var(--store-accent); stroke-width: 9; stroke-linecap: round; }
.nf-code { font-size: 64px; font-weight: 800; line-height: 1; color: var(--store-accent); }
.notfound h1 { font-size: 28px; }
.notfound > p { color: var(--muted); max-width: 520px; }
.nf-search { display: flex; gap: 10px; width: 100%; max-width: 520px; margin: 8px 0; }
.nf-search input { flex: 1; min-width: 0; height: 46px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 14px; background: var(--surface); }

/* ---------- صفحة المكوّنات */
.kit-note { color: var(--muted); margin-bottom: 14px; }
.kit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.kit-row .type-dot { position: static; box-shadow: none; }
.kit-label { font-weight: 700; min-width: 110px; }
.kit-grid { --per-row: 4; }
.kit-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kit-list { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
.kit-list > .box, .kit-list .side-banner { margin-top: 20px; }
@media (max-width: 1024px) { .kit-trio, .kit-list { grid-template-columns: 1fr; } .kit-list .side-banner { display: flex; min-height: 300px; } }

/* ==========================================================================
   العروض
   ========================================================================== */
@media (max-width: 1200px) {
	.header-call { display: none; }
	.side-cats { flex-basis: 236px; }
	.slide-text { max-width: 62%; }
	.slide h1, .slide h2 { font-size: 32px; }
	.cats-btn { min-width: 220px; }
	.recent-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
	.book-grid { --per-row: 4 !important; }
	.listing-grid { --per-row: 3 !important; }
	.side-cats { display: none; }
	.tri-panels { grid-template-columns: 1fr 1fr; }
	.tri-panels > :last-child { grid-column: 1 / -1; }
	.trio-row { grid-template-columns: 1fr 1fr; }
	.trio-row > :first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
	.cat-row { grid-template-columns: repeat(4, 1fr); }
	.rec-row { grid-template-columns: 1fr; }
	.rec-banner .banner { min-height: 260px; }
	.banner-tall .banner-text { max-width: 60%; }
	.author-row { grid-template-columns: repeat(3, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.pdp { grid-template-columns: 1fr; }
	.pdp-side { position: static; display: grid; grid-template-columns: 1fr 1fr; margin-top: 0; }
	.reviews-layout { grid-template-columns: 1fr; }
	.author-head { grid-template-columns: 220px 1fr; }
	.author-facts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 24px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
	.author-bio { border-inline-end: 0; }
	.cart-layout { grid-template-columns: 1fr; }
	.cart-layout > .summary { margin-top: 0; }
	.listing-layout { grid-template-columns: 1fr; }
	.filters {
		position: fixed; top: 0; bottom: 0; right: 0; z-index: 90; width: min(330px, 88vw); overflow-y: auto;
		background: var(--store-bg); padding: 0 12px 20px; display: none;
	}
	body.filters-open .filters { display: block; animation: slide-in .25s ease-out; }
	.filters-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; background: var(--store-accent); color: var(--on-dark); margin: 0 -12px; padding: 10px 16px; }
	.filters-toggle { display: inline-flex; }
	.col-switch [data-cols="3"], .col-switch [data-cols="4"] { display: none; }
	.strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
	.menu-toggle { display: inline-grid; }
	.header-nav, .topbar-links, .topbar-social { display: none; }
	.header-main .container { flex-wrap: wrap; gap: 8px 12px; min-height: 0; padding-block: 10px 12px; }
	.brand { margin-inline-end: auto; }
	.brand-name { font-size: 23px; }
	.brand img { width: 38px; height: 38px; }
	.header-search { order: 5; flex-basis: 100%; height: 46px; }
	.header-search select { width: 118px; padding: 0 8px; }
	.hero-top { flex-direction: column; }
	.hero-pair { flex-direction: row; }
	.hero-pair .banner { min-height: 170px; }
	.hero-pair .banner + .banner { border-top: 0; border-inline-start: 1px solid rgba(255,255,255,.1); }
	.slider { min-height: 340px; }
	.trust-bar { grid-template-columns: 1fr 1fr; }
	.trust-item:nth-child(3) { border-inline-start: 0; }
	.trust-item:nth-child(n+3) { border-top: 1px solid var(--line); }
	.newsletter { flex-direction: column; align-items: stretch; padding: 26px 22px; }
	.nl-field { flex-basis: auto; }
}

@media (max-width: 680px) {
	body { font-size: 14.5px; }
	.box { padding: 16px; margin-top: 14px; }
	.box-title { font-size: 19px; }
	.book-grid, .listing-grid { --per-row: 2 !important; gap: 12px; }
	.book-media { padding: 10px 10px 0; }
	.book-media > a { padding: 10px 12px; }
	.type-dot { top: 15px; inset-inline-start: 15px; width: 27px; height: 27px; }
	.wish-btn { top: 15px; inset-inline-end: 15px; }
	.book-media > .badge { top: 16px; }
	.book-media > .badge ~ .wish-btn { top: 48px; }
	.book-body { padding: 10px 10px 12px; }
	.price { font-size: 15px; }
	.cart-btn { width: 34px; height: 34px; }
	.hero-wrap { margin-top: 12px; }
	.slider { min-height: 0; }
	.slide { flex-direction: column; align-items: stretch; padding: 0 0 58px; }
	.slide > img { position: static; height: 170px; object-position: 22% 62%; }
	.slide-text { max-width: 100%; padding: 16px 20px 0; }
	.slide h1, .slide h2 { font-size: 26px; }
	.slide p { font-size: 14.5px; }
	.hero-pair .banner { min-height: 128px; }
	.hero-pair .banner > img { object-position: 12% 50%; }
	.hero-pair .banner-text { max-width: 100%; padding: 14px 12px 14px 14px; }
	.hero-pair .banner-text strong { font-size: 15.5px !important; }
	.hero-pair .kicker { font-size: 13px; margin-bottom: 0; }
	.hero-pair .btn-sm { min-height: 32px; padding: 0 12px; }
	.banner-text { max-width: 78%; padding: 18px; }
	.banner-text strong { font-size: 19px !important; }
	.type-tile { padding: 12px 4px 10px; gap: 2px; }
	.type-tile small { display: none; }
	.tile-dot { width: 40px; height: 40px; }
	.tile-dot .icon { width: 20px; height: 20px; }
	.type-tile strong { font-size: 13.5px; }
	.trust-bar { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-top: 12px; }
	.trust-bar::-webkit-scrollbar { display: none; }
	.trust-item { flex: 0 0 74%; scroll-snap-align: start; padding: 12px 14px; gap: 10px; border-top: 0 !important; }
	.trust-item:nth-child(3) { border-inline-start: 1px solid var(--line); }
	.trust-item > .icon { width: 28px; height: 28px; }
	.trust-item b { font-size: 14.5px; }
	.trust-item small { font-size: 12.5px; }
	.tri-panels, .trio-row { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
	.trio-row > :first-child { display: block; }
	.banner-pair { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
	.banner-pair .banner { min-height: 190px; }
	.rec-row { gap: 14px; margin-top: 14px; }
	.cat-row, .author-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding-bottom: 6px; scrollbar-width: thin; }
	.cat-circle, .author-circle { flex: 0 0 96px; scroll-snap-align: start; }
	.hlist { grid-template-columns: 1fr; gap: 18px; }
	.tab-btns { gap: 14px; overflow-x: auto; max-width: 100%; }
	.tab-btns button { white-space: nowrap; font-size: 14px; }
	.offer-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.offer-card { padding: 12px 10px; }
	.offer-media > a { width: 60%; }
	.recent-row { grid-template-columns: 1fr 1fr; gap: 10px; }
	.recent-card { flex-direction: column; align-items: flex-start; }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
	.footer-contact { grid-column: 1 / -1; }
	.footer-bottom { justify-content: center; text-align: center; }
	.newsletter { margin-top: 20px; }
	.nl-text { align-items: flex-start; }
	.nl-field { flex-direction: column; background: transparent; gap: 10px; }
	.nl-field input { flex: none; background: var(--surface); border-radius: var(--r-sm); height: 48px; }
	.banner-strip > img { object-position: right center; }
	.spot-gallery .gallery-main img { height: 240px; }
	.nl-field .btn { border-radius: var(--r-sm); min-height: 46px; }
	.page-head h1 { font-size: 20px; }
	.strip { grid-template-columns: repeat(3, 1fr); gap: 10px; }
	.sort-bar { gap: 10px; padding: 12px; }
	.sort-field { flex: 1; min-width: 0; }
	.sort-field select { flex: 1; min-width: 0; }
	.listing-count { flex-basis: 100%; }
	.pdp-main { grid-template-columns: 1fr; grid-template-areas: "gallery" "info" "extra"; gap: 18px; }
	.pdp-extra { margin-top: 0; }
	.pdp-gallery .gallery-main img { max-height: 320px; }
	.pdp-info { border: 0; padding: 0; }
	.pdp-title { font-size: 25px; }
	.detail-grid { grid-template-columns: 1fr; }
	.pdp-side { grid-template-columns: 1fr; }
	.author-head { grid-template-columns: 1fr; padding: 20px 0; }
	.author-head > * { padding-inline: 18px; }
	.author-bio { border: 0; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
	.cart-row { grid-template-columns: 74px 1fr auto; grid-template-areas: "thumb info remove" "thumb qty total"; gap: 8px 12px; }
	.cart-thumb { grid-area: thumb; padding: 6px 8px; }
	.cart-info { grid-area: info; }
	.cart-row .qty { grid-area: qty; justify-self: start; }
	.cart-line { grid-area: total; justify-self: end; }
	.remove-btn { grid-area: remove; }
	.nf-search { flex-direction: column; }
	.nf-code { font-size: 52px; }
	.notfound h1 { font-size: 23px; }
}

/* ==========================================================================
   ميزات المنصّة المعتمدة (SPEC، الملحق 8)
   ========================================================================== */
/* النظرة السريعة تحت زرّ المفضّلة */
.quick-btn {
	position: absolute; top: 62px; inset-inline-end: 22px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
	border: 1px solid var(--line); background: var(--surface); color: var(--store-accent); display: grid; place-items: center;
	opacity: 0; transition: opacity .15s;
}
.quick-btn .icon { width: 17px; height: 17px; }
.quick-btn:hover { border-color: var(--store-primary); }
.book-media > .badge ~ .quick-btn { top: 98px; }
.book-card:hover .quick-btn, .quick-btn:focus-visible { opacity: 1; }
@media (hover: none) { .quick-btn { opacity: 1; } }

/* العدّادات: «عروض اليوم» و«كتاب اليوم» */
.countdown { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.cd-units { display: flex; gap: 5px; }
.cd-unit { display: flex; align-items: baseline; gap: 3px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--store-accent); color: var(--on-dark); }
.cd-unit b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: 11.5px; color: var(--on-dark-muted); }
.box-cd { margin-inline-start: 6px; margin-inline-end: auto; }
.spot-cd { margin: 4px 0 2px; }

/* وسم التصنيف في القائمة الجانبيّة */
.cat-badge { padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.6; color: #fff; }
.cat-badge[data-badge="trending"] { background: var(--sale); }
.cat-badge[data-badge="new"] { background: var(--new); }

/* المدوّنة */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; transition: border-color .15s; }
.post-card:hover { border-color: var(--store-primary); }
.post-media { display: block; background: var(--soft); }
.post-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-body { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 14px 16px 16px; }
.post-date { font-size: 13px; color: var(--muted); }
.post-title { font-size: 16.5px; font-weight: 700; line-height: 1.45; }
.post-title a:hover { color: var(--store-primary-dark); text-decoration: underline; text-decoration-color: var(--store-primary); }
.post-excerpt { font-size: 14px; color: var(--muted); }
.post-more { margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--store-accent); }
.post-more:hover { color: var(--store-primary-dark); }
.post-narrow { max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.post-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm); }
.post-content { display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.9; }

/* الأسئلة الشائعة */
.faq-list { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-sm); }
.faq-item[open] { border-color: var(--line-strong); background: var(--soft); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-ic { flex: none; width: 18px; height: 18px; color: var(--store-primary-dark); transition: transform .2s; }
.faq-item[open] .faq-ic { transform: rotate(45deg); }
.faq-item p { padding: 0 16px 14px; color: var(--muted); font-size: 14.5px; }

@media (max-width: 991px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid:not(.post-grid-page) .post-card:nth-child(3) { display: none; }
}
@media (max-width: 680px) {
	.quick-btn { top: 55px; inset-inline-end: 15px; }
	.book-media > .badge ~ .quick-btn { top: 88px; }
	.box-cd { flex-basis: 100%; order: 3; margin: 0; }
}
@media (max-width: 599px) {
	.post-grid { grid-template-columns: minmax(0, 1fr); }
	.post-grid:not(.post-grid-page) .post-card:nth-child(3) { display: flex; }
	.post-content { font-size: 16px; }
}

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

/* ==========================================================================
   الإصدار الثاني: صفوفٌ كاملة بلا فراغ، وآراء القرّاء، واختيار النسخة، والقائمة
   ========================================================================== */
/* صفّ واحدٌ كامل لكلّ قيمةٍ من books_per_row: ستّة كتبٍ يُخفى منها ما يزيد على عدد الأعمدة */
.row-1 > :nth-child(n+6) { display: none; }
body[data-books-per-row="4"] .row-1 > :nth-child(n+5) { display: none; }
body[data-books-per-row="6"] .row-1 > :nth-child(6) { display: flex; }
.book-desc { display: none; }

/* الواجهة: بانر التصنيف يملأ عموده */
.cat-panel { display: flex; flex-direction: column; }
.cat-panel > [data-region="home_cat_banner"] { flex: 1; display: flex; }
.cat-panel .banner-cat { flex: 1; }

/* آراء القرّاء: صندوقٌ كحليّ بين الصناديق البيضاء */
.home-reviews { background: var(--store-accent); color: var(--on-dark); }
.home-reviews .box-title { color: var(--on-dark); }
.hr-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
.hr-score { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-sm); padding: 18px; }
.hr-score strong { font-size: 54px; font-weight: 800; line-height: 1; color: var(--store-primary); }
.hr-score .rating .icon { width: 19px; height: 19px; }
.hr-score small { color: var(--on-dark-muted); font-size: 14px; }
.hr-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hr-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); color: var(--store-text); border-radius: var(--r-sm); padding: 16px 18px; }
.hr-card p { font-size: 14.5px; line-height: 1.8; }
.hr-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.hr-foot b { display: block; font-size: 14.5px; }
.hr-foot small { color: var(--muted); font-size: 13px; }
.hr-foot a { color: var(--store-text); text-decoration: underline; text-decoration-color: var(--store-primary); text-underline-offset: 3px; }
body[data-show-reviews="false"] .home-reviews { display: none; }

/* اختيار النسخة في صندوق الشراء (book.formats)، ويختفي إن لم يكن للعنوان غير نسخةٍ واحدة */
.formats-box { display: grid; gap: 8px; }
.formats-label { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; }
.format-opt { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); text-align: center; font-size: 13.5px; transition: border-color .15s; }
.format-opt .type-dot { position: static; width: 26px; height: 26px; box-shadow: none; }
.format-opt .type-dot .icon { width: 14px; height: 14px; }
.format-name { font-weight: 700; }
.format-price { font-size: 12.5px; color: var(--muted); }
.format-opt:hover { border-color: var(--store-primary); }
.format-opt[aria-current="page"] { border-color: var(--store-primary); box-shadow: 0 0 0 1px var(--store-primary); background: var(--soft); }
[data-slot="book.formats"]:not(:has([data-repeat="format"] ~ [data-preview-copy])) { display: none; }

/* صفحة التصنيف: 12 كتابًا (عشرةٌ في خمسة أعمدة)، والقائمة، وبانرٌ يملأ عمود التصفية */
.listing-grid[data-cols="5"] > :nth-child(n+11) { display: none; }
.listing-grid[data-cols="list"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.listing-grid[data-cols="list"] > :nth-child(n) { display: flex; }
.listing-grid[data-cols="list"] .book-card { flex-direction: row; }
.listing-grid[data-cols="list"] .book-media { flex: 0 0 150px; padding: 14px 0 14px 0; padding-inline-start: 14px; }
.listing-grid[data-cols="list"] .book-media > a { padding: 10px 12px; }
.listing-grid[data-cols="list"] .book-body { padding: 16px; min-width: 0; }
.listing-grid[data-cols="list"] .book-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--muted); font-size: 14px; margin-top: 4px; }
.listing-grid[data-cols="list"] .type-dot { top: 20px; inset-inline-start: 20px; }
.listing-grid[data-cols="list"] .book-media > .badge { top: 22px; }
.listing-grid[data-cols="list"] .wish-btn, .listing-grid[data-cols="list"] .quick-btn { inset-inline-end: 8px; }
.listing-side { display: flex; flex-direction: column; align-self: stretch; min-width: 0; }
.side-banner { flex: 1; display: flex; margin-top: 20px; min-height: 180px; }
.banner-col { flex: 1; align-items: flex-start; }
.banner-col > img { object-position: center bottom; }
.banner-col .banner-text { max-width: 100%; padding: 24px 20px; }
.banner-col .banner-text strong { font-size: 21px; }

/* صفحة الكتاب: عمود الشراء بطول صندوق المعلومات، والبانر يملأ ما تحته */
.pdp-side { align-self: stretch; position: static; }
.pdp-side > [data-region="product_side_banner"] { flex: 1; display: flex; }
.pdp-side > [data-region="product_side_banner"] .banner { flex: 1; align-items: flex-start; }
.pdp-side > [data-region="product_side_banner"] .banner > img { object-position: 22% bottom; }
.pdp-side > [data-region="product_side_banner"] .banner-text { max-width: 100%; padding-top: 24px; }

/* «رائج الآن» يملأ عموده: صفوفٌ متساوية بفواصل بدل فراغٍ في أسفله */
.trio-row > [data-region="home_trending"] { display: flex; flex-direction: column; }
.trio-row .hlist-one { flex: 1; grid-auto-rows: 1fr; gap: 0; }
.trio-row .hlist-one .hcard { padding-block: 10px; }
.trio-row .hlist-one .hcard + .hcard { border-top: 1px solid var(--line); }

/* صفحة المؤلّف: أعماله السبعة صفٌّ واحد */
.works-row { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 14px; }
.works-row .book-media { padding: 12px 12px 0; }
.works-row .book-media > a { padding: 10px 12px; }
.works-row .book-body { padding: 10px 12px 12px; }
.works-row .type-dot { top: 16px; inset-inline-start: 16px; width: 26px; height: 26px; }
.works-row .wish-btn { top: 16px; inset-inline-end: 16px; }
.works-row .quick-btn { top: 54px; inset-inline-end: 16px; }
.works-row .book-media > .badge { top: 18px; }
.works-row .book-media > .badge ~ .wish-btn { top: 50px; }
.works-row .book-media > .badge ~ .quick-btn { top: 88px; }
.works-row .stock-band { inset-inline: 12px; }

@media (max-width: 1200px) {
	.works-row { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 14px) / 4); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
	.works-row > * { scroll-snap-align: start; }
}
@media (max-width: 1024px) {
	.row-1 > :nth-child(n+5) { display: none !important; }
	.listing-grid[data-cols] > :nth-child(n) { display: flex; }
	.listing-side { display: contents; }
	.side-banner { display: none; }
	.tri-panels > :last-child .mini-grid { grid-template-columns: repeat(12, 1fr); }
	.hr-layout { grid-template-columns: 1fr; }
	.hr-score { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; gap: 6px 14px; padding: 14px 18px; }
	.hr-score strong { font-size: 40px; }
}
@media (max-width: 680px) {
	.row-1 { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
	.row-1 > :nth-child(n) { display: flex !important; scroll-snap-align: start; }
	.works-row { grid-auto-columns: 46%; gap: 12px; }
	.tri-panels > :last-child .mini-grid { grid-template-columns: repeat(6, 1fr); }
	.mini-card:nth-child(n+4) { display: none; }
	.banner-pair .banner::before, .hero-pair .banner::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(270deg, rgba(14, 20, 30, .72) 30%, rgba(14, 20, 30, 0) 85%); }
	.hero-pair .banner-text, .banner-pair .banner-text { z-index: 2; }
	.banner-strip > img { object-position: center center !important; }
	.mini-media { height: 130px; padding: 8px; }
	.mini-media img { height: 110px; }
	.hr-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 6px; }
	.hr-card { flex: 0 0 84%; scroll-snap-align: start; }
	.listing-grid[data-cols="list"] { grid-template-columns: minmax(0, 1fr) !important; }
	.listing-grid[data-cols="list"] .book-media { flex-basis: 118px; padding-inline-start: 10px; }
	.listing-grid[data-cols="list"] .book-media > a { padding: 6px 8px; }
	.listing-grid[data-cols="list"] .type-dot { top: 16px; inset-inline-start: 14px; }
	.listing-grid[data-cols="list"] .book-media > .badge { top: 16px; }
	.listing-grid[data-cols="list"] .book-body { padding: 12px; }
	.col-switch button { width: 36px; height: 36px; }
}

/* تبويبات صفّ الكتب (القاعدة 16): يختفي الشريط إن لم يختر الناشر غير مصدرٍ واحد */
[data-slot="section.tabs"]:not(:has([data-repeat="tab"] ~ [role="tab"])) { display: none; }

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