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

:root {
  /* ألوان الهويّة — قيم تجريبيّة يستبدلها كلّ ناشر */
  --store-primary: #F3C81C;
  --store-primary-dark: #263746;
  --store-accent: #E8871A;
  --store-bg: #FFFFFF;
  --store-text: #1F2A35;

  /* محايدات ثابتة (ليست من الهويّة) */
  --bh-soft: #F4F5F7;       /* ألواح البطاقات والدوائر */
  --bh-soft-2: #ECEEF1;
  --bh-lav: #F7F7F9;
  --bh-cream: #F4F5F7;
  --bh-peach: #FFF7DD;
  --bh-line: #E3E6EA;
  --bh-dash: #C9CED6;
  --bh-muted: #5B6470;
  --bh-ink: #1F2A35;
  --bh-on-dark: #FFFFFF;
  --bh-on-primary: #1F2A35;  /* النصّ فوق اللون الأساسيّ الفاتح */
  --bh-on-accent: #1F2A35;
  --bh-coal: #252525;        /* التذييل */
  --bh-coal-2: #171717;
  --bh-coal-text: #C9C9C9;
  --bh-star: #F2B01E;
  --bh-star-off: #DCE0E5;
  --bh-ok: #2E7D32;
  --bh-out: #6B7280;
  --bh-sale: #C62828;
  --bh-overlay: rgba(20, 28, 38, .55);

  /* ألوان أنواع الكتب — ثابتة في المنصّة */
  --bh-type-paper: #DB7056;
  --bh-type-ebook: #5675A3;
  --bh-type-audio: #986AB0;
  --bh-type-edu: #3f8f6b;

  /* الخطّ والمقاسات */
  --bh-font: "Baloo Bhaijaan 2", "Segoe UI", Tahoma, Arial, sans-serif;
  --bh-fs-xs: .8125rem;
  --bh-fs-sm: .9375rem;
  --bh-fs-md: 1rem;
  --bh-fs-lg: 1.25rem;
  --bh-fs-xl: 2.375rem;
  --bh-fs-2xl: 3.25rem;

  --bh-r-xs: 5px;
  --bh-r-sm: 8px;
  --bh-r-md: 14px;
  --bh-r-lg: 22px;
  --bh-r-full: 999px;
  --bh-shadow: 0 10px 30px rgba(31, 42, 53, .1);
  --bh-shadow-cover: 0 12px 22px -12px rgba(20, 28, 38, .5);
  --bh-container: 1200px;
  --bh-gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --bh-gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; scroll-padding-top: 160px; }
body { margin: 0; font-family: var(--bh-font); font-size: var(--bh-fs-md); line-height: 1.65; color: var(--store-text); background: var(--store-bg); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; font-weight: 800; color: var(--store-primary-dark); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--store-accent); outline-offset: 2px; border-radius: 4px; }
.bh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bh-flip { transform: scaleX(-1); }
.bh-note { color: var(--bh-muted); font-size: var(--bh-fs-sm); }

.bh-container { width: 100%; max-width: var(--bh-container); margin-inline: auto; padding-left: var(--bh-gutter-l); padding-right: var(--bh-gutter-r); }
.bh-section { padding-block: 80px; position: relative; }
.bh-section--lav, .bh-section--cream, .bh-section--soft { background: var(--bh-soft); }
.bh-section--peach { background: var(--bh-peach); }

/* ---------- الأيقونات ---------- */
.bh-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bh-icon--sm { width: 18px; height: 18px; }
.bh-icon--xs { width: 15px; height: 15px; }

/* ---------- الأزرار ---------- */
.bh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 26px;
  border: 2px solid transparent; border-radius: var(--bh-r-xs);
  font-weight: 700; font-size: var(--bh-fs-sm); line-height: 1.2;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.bh-btn:active { transform: translateY(1px); }
.bh-btn--primary { background: var(--store-primary); color: var(--bh-on-primary); box-shadow: 0 4px 0 rgba(31, 42, 53, .18); }
.bh-btn--primary:hover { background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-btn--dark { background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-btn--dark:hover { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-btn--outline { background: transparent; border-color: var(--store-primary-dark); color: var(--store-primary-dark); }
.bh-btn--outline:hover { background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-btn--light { background: var(--store-bg); color: var(--bh-ink); }
.bh-btn--light:hover { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-btn--ghost { background: var(--bh-soft); color: var(--store-text); }
.bh-btn--ghost:hover { background: var(--bh-soft-2); }
.bh-btn--block { width: 100%; }
.bh-btn--sm { min-height: 40px; padding: 6px 18px; font-size: .875rem; }
.bh-btn--xs { min-height: 34px; padding: 4px 12px; font-size: var(--bh-fs-xs); }
.bh-btn[disabled] { background: var(--bh-soft); color: var(--bh-muted); border-color: transparent; box-shadow: none; cursor: not-allowed; transform: none; }
.bh-btn .bh-arrow { transform: scaleX(-1); }

.bh-icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--store-bg); color: var(--bh-ink); box-shadow: var(--bh-shadow);
  transition: background-color .2s, color .2s;
}
.bh-icon-btn:hover { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-icon-btn--plain { box-shadow: none; background: transparent; }
.bh-icon-btn--plain:hover { background: var(--bh-soft); color: var(--store-primary-dark); }
.bh-icon-btn--cart { border-radius: var(--bh-r-xs); background: var(--store-primary); color: var(--bh-on-primary); box-shadow: none; }
.bh-icon-btn--cart:hover { background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-icon-btn[aria-pressed="true"] { color: var(--bh-sale); }
.bh-icon-btn[aria-pressed="true"] .bh-icon { fill: currentColor; }

.bh-count {
  position: absolute; top: -7px; inset-inline-end: -9px;
  min-width: 19px; height: 19px; padding-inline: 4px; border-radius: var(--bh-r-full);
  background: var(--store-primary); color: var(--bh-on-primary);
  font-size: .6875rem; font-weight: 800; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums;
}
.bh-count:empty { display: none; }

/* ---------- عنوان القسم ---------- */
.bh-title { display: grid; justify-items: center; gap: 8px; text-align: center; margin-bottom: 44px; }
.bh-title__mark { display: grid; place-items: center; width: 40px; height: 26px; color: var(--store-primary); }
.bh-title__mark .bh-icon { width: 30px; height: 26px; stroke-width: 2.4; }
.bh-title h2, .bh-title h1 { font-size: var(--bh-fs-xl); font-weight: 800; color: var(--store-primary-dark); }
.bh-title__eyebrow { font-size: var(--bh-fs-sm); font-weight: 700; color: var(--bh-muted); }
.bh-title__sub { color: var(--bh-muted); font-size: var(--bh-fs-md); max-width: 62ch; }
.bh-title--start { justify-items: start; text-align: start; }
.bh-title--light h2, .bh-title--light h1, .bh-title--light .bh-title__sub, .bh-title--light .bh-title__eyebrow { color: var(--bh-on-dark); }
.bh-title--light .bh-title__sub { opacity: .85; }
.bh-head { margin-bottom: 30px; }

/* التبويبات: كبسولات */
.bh-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: -14px 0 36px; }
.bh-tabs button { border: 2px solid var(--bh-line); background: var(--store-bg); padding: 7px 22px; border-radius: var(--bh-r-full); font-weight: 700; font-size: var(--bh-fs-sm); color: var(--store-primary-dark); }
.bh-tabs button:hover { border-color: var(--store-primary); }
.bh-tabs button:is([aria-pressed="true"], [aria-selected="true"]) { background: var(--store-primary); border-color: var(--store-primary); color: var(--bh-on-primary); }

/* ---------- شريط ألوان الأنواع ---------- */
.bh-stripe { display: grid; grid-template-columns: repeat(4, 1fr); height: 6px; }
.bh-stripe span:nth-child(1) { background: var(--bh-type-paper); }
.bh-stripe span:nth-child(2) { background: var(--bh-type-edu); }
.bh-stripe span:nth-child(3) { background: var(--bh-type-ebook); }
.bh-stripe span:nth-child(4) { background: var(--bh-type-audio); }

/* ---------- الشريط العلويّ ---------- */
.bh-topbar { background: var(--store-bg); color: var(--bh-muted); font-size: var(--bh-fs-xs); border-bottom: 1px solid var(--bh-line); }
.bh-topbar .bh-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.bh-topbar__msg { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bh-topbar__end { display: flex; align-items: center; gap: 18px; }
.bh-topbar__phone { display: inline-flex; align-items: center; gap: 6px; }
.bh-topbar__phone bdi { color: var(--bh-ink); font-weight: 700; }
.bh-topbar__social { display: flex; gap: 10px; }
.bh-topbar__social a:hover { color: var(--store-primary-dark); }

/* ---------- الرأس ---------- */
.bh-header { position: sticky; top: 0; z-index: 30; background: var(--store-bg); }
.bh-header.is-stuck { box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .35); }
.bh-header .bh-bar { display: flex; align-items: center; gap: 30px; min-height: 92px; }
.bh-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.bh-brand img { width: 48px; height: 48px; border-radius: 14px; }
.bh-brand > span { display: grid; line-height: 1.1; }
.bh-brand__name { font-size: 1.5rem; font-weight: 800; color: var(--store-primary-dark); white-space: nowrap; }
.bh-brand__tag { font-size: .75rem; font-weight: 600; color: var(--bh-muted); }
.bh-brand--light .bh-brand__name { color: var(--bh-on-dark); }
.bh-hsearch { display: flex; align-items: stretch; flex: 1; max-width: 560px; height: 46px; margin-inline: auto; border: 2px solid var(--bh-line); border-radius: var(--bh-r-xs); background: var(--store-bg); overflow: hidden; }
.bh-hsearch:focus-within { border-color: var(--store-primary); }
.bh-hsearch__cat { flex: none; max-width: 150px; padding-inline: 12px 8px; border: 0; border-inline-end: 1px solid var(--bh-line); background: var(--bh-lav); font-size: var(--bh-fs-sm); color: var(--bh-ink); }
.bh-hsearch input { flex: 1; min-width: 0; padding-inline: 14px; border: 0; background: transparent; font-size: var(--bh-fs-sm); }
.bh-hsearch input:focus, .bh-hsearch__cat:focus { outline: none; }
.bh-hsearch__btn { display: grid; place-items: center; flex: none; width: 52px; border: 0; background: var(--store-primary); color: var(--bh-on-primary); }
.bh-hsearch__btn:hover { background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-actions { display: flex; align-items: center; gap: 22px; flex: none; }
.bh-actions__link { position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--store-primary-dark); }
.bh-actions__link:hover { color: var(--bh-ink); }
.bh-actions__link .bh-icon { width: 26px; height: 26px; }
.bh-actions__cart b { font-weight: 800; font-size: var(--bh-fs-sm); font-variant-numeric: tabular-nums; }
.bh-actions__cart .bh-count { inset-inline-end: auto; inset-inline-start: 14px; }
.bh-menu-btn { display: none; }

/* شريط القائمة بلون الهويّة */
.bh-navbar { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-navbar__inner { display: flex; align-items: center; gap: 34px; min-height: 52px; }
.bh-menu { display: flex; align-items: center; gap: 30px; }
.bh-menu a { position: relative; display: block; padding-block: 14px; font-weight: 700; font-size: var(--bh-fs-sm); }
.bh-menu a::after { content: ""; position: absolute; inset-inline: 0; bottom: 9px; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transition: transform .2s; }
.bh-menu a:hover::after, .bh-menu [aria-current="page"]::after { transform: scaleX(1); }

/* «كلّ التصنيفات» */
.bh-depts { position: relative; flex: none; width: 270px; align-self: stretch; }
.bh-depts__btn { display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; padding-inline: 18px; border: 0; background: var(--store-primary-dark); color: var(--bh-on-dark); font-weight: 700; font-size: var(--bh-fs-sm); }
.bh-depts__chev { margin-inline-start: auto; transform: rotate(-90deg); transition: transform .2s; }
.bh-depts__btn[aria-expanded="true"] .bh-depts__chev { transform: rotate(90deg); }
.bh-depts__list { position: absolute; top: 100%; inset-inline: 0; z-index: 25; display: none; padding-block: 6px; background: var(--store-bg); color: var(--store-text); border: 1px solid var(--bh-line); border-top: 0; box-shadow: var(--bh-shadow); }
.bh-depts__list.is-open { display: block; }
.bh-depts__list a { display: flex; align-items: center; gap: 12px; padding: 10px 18px; font-weight: 600; font-size: var(--bh-fs-sm); }
.bh-depts__list li + li a { border-top: 1px solid var(--bh-soft-2); }
.bh-depts__list a .bh-icon { color: var(--bh-muted); }
.bh-depts__list a:hover { background: var(--bh-peach); color: var(--store-primary-dark); }
.bh-depts__list a:hover .bh-icon { color: var(--store-accent); }

.bh-field { flex: 1; min-width: 0; padding: 11px 16px; border: 2px solid var(--bh-line); border-radius: var(--bh-r-xs); background: var(--store-bg); font-size: var(--bh-fs-sm); }
.bh-field:focus { outline: none; border-color: var(--store-primary); }

/* ---------- الدرج الجانبيّ ---------- */
.bh-drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.bh-drawer.is-open { visibility: visible; }
.bh-drawer__backdrop { position: absolute; inset: 0; background: var(--bh-overlay); opacity: 0; transition: opacity .25s; }
.bh-drawer.is-open .bh-drawer__backdrop { opacity: 1; }
.bh-drawer__panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(86vw, 340px); background: var(--store-bg);
  display: flex; flex-direction: column; overflow-y: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(100%); transition: transform .3s ease;
}
.bh-drawer.is-open .bh-drawer__panel { transform: translateX(0); }
.bh-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bh-drawer__head .bh-brand__name { font-size: 1.25rem; }
.bh-drawer__title { font-size: var(--bh-fs-xs); font-weight: 700; color: var(--bh-muted); margin: 16px 0 6px; }
.bh-drawer__links a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--bh-line); font-weight: 600; }
.bh-drawer__links a:hover { color: var(--store-primary-dark); background: var(--bh-peach); }
.bh-drawer__contacts { margin-top: auto; padding-top: 18px; display: grid; gap: 6px; font-size: var(--bh-fs-sm); color: var(--bh-muted); }

/* ---------- بطاقة الكتاب ---------- */
.bh-grid { display: grid; gap: 34px 26px; grid-template-columns: repeat(var(--bh-cols, 4), minmax(0, 1fr)); }
.bh-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; text-align: center; }
.bh-card__media { position: relative; display: flex; flex-direction: column; border-radius: var(--bh-r-sm); background: var(--bh-soft); overflow: hidden; transition: background-color .3s; }
.bh-card__media > .bh-cover { margin: 24px 19% 18px; }
.bh-card:hover .bh-card__media { background: var(--bh-peach); }
.bh-cover { position: relative; display: block; aspect-ratio: 2 / 3; max-width: 100%; border-radius: 4px; overflow: hidden; box-shadow: var(--bh-shadow-cover); background: var(--bh-line); }
.bh-cover img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s ease; }
.bh-cover__back { position: absolute; inset: 0; opacity: 0; }
.bh-card:hover .bh-cover__back, .bh-card:focus-within .bh-cover__back { opacity: 1; }

.bh-type {
  position: absolute; bottom: 8px; inset-inline-start: 8px; z-index: 2;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  color: #FFFFFF; border: 2px solid #FFFFFF; box-shadow: 0 2px 8px rgba(20, 28, 38, .3);
}
.bh-type .bh-icon { width: 15px; height: 15px; stroke-width: 2; }
.bh-type--paper { background: var(--bh-type-paper); }
.bh-type--ebook { background: var(--bh-type-ebook); }
.bh-type--audio { background: var(--bh-type-audio); }
.bh-type--edu   { background: var(--bh-type-edu); }

.bh-badges { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3; display: grid; justify-items: start; gap: 4px; }
.bh-badge { padding: 1px 10px; border-radius: var(--bh-r-xs); font-size: .75rem; font-weight: 800; line-height: 1.7; color: var(--bh-on-dark); }
.bh-badge--sale { background: var(--bh-sale); }
.bh-badge--new  { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-badge--out  { background: var(--bh-out); }

/* المفضّلة والنظرة السريعة تطفوان فوق الغلاف: تظهران عند الوقوف في الحاسوب، ودائمًا في اللمس */
.bh-card__wish, .bh-card__quick { position: absolute; inset-inline-end: 10px; z-index: 3; width: 36px; height: 36px; opacity: 0; transition: opacity .25s, background-color .2s, color .2s; }
.bh-card__wish { top: 10px; }
.bh-card__quick { top: 52px; }
/* شريط «أضف إلى السلّة» الكحليّ: جزءٌ من لوح الغلاف، ظاهرٌ دائمًا */
.bh-card__add {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; width: 100%; margin-top: auto; padding: 6px 8px;
  border: 0; background: var(--store-primary-dark); color: var(--bh-on-dark); font-weight: 700; font-size: var(--bh-fs-sm); line-height: 1.2;
  transition: background-color .2s, color .2s;
}
.bh-card__add:hover { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-card__add[disabled] { background: var(--bh-soft-2); color: var(--bh-muted); cursor: not-allowed; }
.bh-card:hover :is(.bh-card__wish, .bh-card__quick), .bh-card:focus-within :is(.bh-card__wish, .bh-card__quick) { opacity: 1; }
@media (hover: none) { .bh-card__wish, .bh-card__quick { opacity: 1; } }
.bh-card.is-out .bh-cover img:not(.bh-cover__back) { filter: grayscale(1); opacity: .6; }
.bh-card.is-out .bh-cover__back { display: none; }

.bh-card__body { display: grid; justify-items: center; gap: 2px; flex: 1; align-content: start; }
.bh-card__cat { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-card__cat:hover { color: var(--store-primary-dark); text-decoration: underline; }
.bh-card__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.45; color: var(--store-primary-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bh-card__title a:hover { text-decoration: underline; text-decoration-color: var(--store-primary); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- البند الصغير ---------- */
.bh-mini { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; align-items: center; min-width: 0; }
.bh-mini__media { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--bh-r-sm); background: var(--bh-soft); padding: 8px; }
.bh-mini__media img { height: 100%; width: auto; border-radius: 3px; box-shadow: 0 6px 12px -6px rgba(20, 28, 38, .45); }
.bh-mini__title { font-size: 1rem; font-weight: 700; line-height: 1.45; margin-bottom: 2px; }
.bh-mini__title a:hover { text-decoration: underline; }
.bh-mini .bh-price { justify-content: flex-start; }

/* ---------- السعر ---------- */
.bh-price { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 8px; }
.bh-price__now { font-size: 1.125rem; font-weight: 800; color: var(--store-primary-dark); font-variant-numeric: tabular-nums; }
.bh-price__old { font-size: var(--bh-fs-sm); color: var(--bh-muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.bh-price--start { justify-content: flex-start; }

/* ---------- التقييم ---------- */
.bh-rating { display: inline-flex; align-items: center; gap: 6px; font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-stars { position: relative; display: inline-block; width: 80px; height: 16px; flex: none; }
.bh-stars svg { position: absolute; inset: 0; width: 80px; height: 16px; }
.bh-stars__off { fill: var(--bh-star-off); }
.bh-stars__on { fill: var(--bh-star); clip-path: inset(0 calc(100% - var(--bh-score, 0) * 20%) 0 0); }
[dir="rtl"] .bh-stars__on { clip-path: inset(0 0 0 calc(100% - var(--bh-score, 0) * 20%)); }
.bh-rating--lg .bh-stars, .bh-rating--lg .bh-stars svg { width: 110px; height: 22px; }
.bh-rating--lg { font-size: var(--bh-fs-sm); }
.bh-rating__value { font-weight: 800; color: var(--store-text); font-variant-numeric: tabular-nums; }

/* ---------- البطاقة الأفقيّة ---------- */
.bh-hcard { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: start; padding: 18px; border-radius: var(--bh-r-md); background: var(--bh-soft); min-width: 0; }
.bh-hcard .bh-type { width: 24px; height: 24px; bottom: 5px; inset-inline-start: 5px; }
.bh-hcard .bh-type .bh-icon { width: 12px; height: 12px; }
.bh-hcard__body { display: grid; gap: 4px; min-width: 0; }
.bh-hcard__cat { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-hcard__title { font-size: 1.0625rem; font-weight: 700; color: var(--store-primary-dark); line-height: 1.45; }
.bh-hcard__title a:hover { text-decoration: underline; }
.bh-hcard__desc { font-size: var(--bh-fs-sm); color: var(--bh-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bh-hcard__buy { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.bh-qty { display: inline-flex; align-items: center; height: 42px; border: 2px solid var(--bh-line); border-radius: var(--bh-r-xs); background: var(--store-bg); }
.bh-qty button { width: 34px; height: 100%; border: 0; background: transparent; font-size: 1.125rem; font-weight: 700; }
.bh-qty button:hover { color: var(--store-accent); }
.bh-qty input { width: 34px; border: 0; background: transparent; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.bh-qty input::-webkit-inner-spin-button, .bh-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- بطاقة العرض الأفقيّة (شريط «متاح / بيع») ---------- */
.bh-fcard { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; padding: 18px; border-radius: var(--bh-r-md); border: 2px solid var(--bh-line); background: var(--store-bg); min-width: 0; }
.bh-fcard .bh-type { width: 24px; height: 24px; bottom: 5px; inset-inline-start: 5px; }
.bh-fcard .bh-type .bh-icon { width: 12px; height: 12px; }
.bh-fcard__body { display: grid; gap: 4px; align-content: start; min-width: 0; }
.bh-fcard .bh-btn { margin-top: 8px; justify-self: start; }

/* ---------- بطاقة «وصل حديثًا» ---------- */
.bh-ncards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.bh-ncard { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: var(--bh-r-md); background: var(--store-bg); color: var(--store-text); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .45); }
.bh-ncard__media { position: relative; display: grid; place-items: center; padding: 28px 0; background: var(--bh-peach); }
.bh-ncard__media .bh-cover { width: 120px; }
.bh-ncard__body { display: grid; gap: 8px; justify-items: center; align-content: start; padding: 22px 24px 26px; text-align: center; }
.bh-ncard__title { font-size: 1.25rem; font-weight: 800; color: var(--store-primary-dark); }
.bh-ncard__desc { font-size: var(--bh-fs-sm); color: var(--bh-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bh-ncard .bh-price__now { font-size: 1.25rem; }
.bh-ncard .bh-btn { margin-top: 6px; }

/* ---------- بطاقة الغلاف الكامل ---------- */
.bh-poster { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--bh-r-md); background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.bh-poster:hover img { transform: scale(1.04); }
.bh-poster__text { position: absolute; inset: auto 0 0 0; display: grid; gap: 6px; padding: 70px 22px 22px; background: linear-gradient(to top, rgba(20, 28, 38, .92) 25%, rgba(20, 28, 38, 0)); }
.bh-poster__text h3 { color: var(--bh-on-dark); font-size: var(--bh-fs-lg); }
.bh-poster__text p { font-size: var(--bh-fs-sm); opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bh-poster__price { font-weight: 800; color: var(--store-primary); font-variant-numeric: tabular-nums; }
.bh-poster .bh-type { top: 14px; bottom: auto; inset-inline-start: 14px; }

/* ---------- دوائر التصنيفات ---------- */
.bh-circles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 20px; }
.bh-circle { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; text-align: center; }
.bh-circle__disc { display: grid; place-items: center; width: 130px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--bh-soft); padding: 18px; margin-bottom: 10px; transition: background-color .3s, transform .3s; }
.bh-circle__disc img { width: 82%; height: auto; }
.bh-circle:hover .bh-circle__disc { background: var(--store-primary); transform: translateY(-4px); }
.bh-circle__name { font-size: 1.0625rem; font-weight: 800; color: var(--store-primary-dark); line-height: 1.3; }
.bh-circle__count { font-size: var(--bh-fs-xs); color: var(--bh-muted); }

/* ---------- رأي قارئ ---------- */
.bh-quote { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; padding: 24px; border-radius: var(--bh-r-md); background: var(--bh-soft); }
.bh-avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--store-primary); color: var(--bh-on-primary); font-weight: 800; font-size: 1.125rem; }
.bh-quote__text { font-size: var(--bh-fs-md); color: var(--bh-muted); margin-block: 6px 10px; }
.bh-quote__name { font-weight: 800; color: var(--bh-ink); }
.bh-quote__role { font-size: var(--bh-fs-xs); color: var(--bh-muted); }

/* ---------- العدّاد التنازليّ ---------- */

/* ---------- ترقيم الصفحات ---------- */
.bh-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.bh-pager a, .bh-pager span { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding-inline: 8px; border-radius: var(--bh-r-xs); border: 2px solid var(--bh-line); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--store-text); }
.bh-pager a:hover { border-color: var(--store-primary); }
.bh-pager [aria-current="page"] { background: var(--store-primary); border-color: var(--store-primary); color: var(--bh-on-primary); }
.bh-pager .is-gap { border-color: transparent; color: var(--bh-muted); }
.bh-pager .bh-icon { width: 16px; height: 16px; }
.bh-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.bh-dots button { width: 12px; height: 12px; padding: 0; border: 2px solid var(--store-primary-dark); border-radius: var(--bh-r-full); background: transparent; transition: width .25s, background-color .25s; }
.bh-dots button[aria-current="true"] { width: 30px; background: var(--store-primary-dark); }

/* ---------- البانرات: صورةٌ يرفعها الناشر (banner.image) ونصٌّ اختياريّ فوقها ---------- */
.bh-banner { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 300px; padding: 40px 48px; overflow: hidden; border-radius: var(--bh-r-md); background: var(--store-primary-dark); color: var(--bh-on-dark); }
.bh-banner__img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: transform .6s ease; }
[dir="ltr"] .bh-banner__img { object-position: right center; }
a.bh-banner:hover .bh-banner__img, .bh-banner:hover .bh-banner__img { transform: scale(1.03); }
.bh-banner__text { position: relative; display: grid; justify-items: start; gap: 10px; max-width: 52%; }
.bh-banner__eyebrow { justify-self: start; padding: 2px 12px; border-radius: var(--bh-r-xs); background: var(--store-primary); color: var(--bh-on-primary); font-size: var(--bh-fs-xs); font-weight: 800; }
.bh-banner__title { font-size: 2.125rem; font-weight: 800; line-height: 1.2; color: var(--bh-on-dark); }
.bh-banner__lead { font-size: var(--bh-fs-md); opacity: .92; max-width: 40ch; }
.bh-banner .bh-btn { margin-top: 6px; }
/* عدّاد العرض محدود المدّة (offer.ends_at): يرسمه theme.js، ويُخفى إن غاب التاريخ أو انقضى */
.bh-countdown { display: flex; gap: 8px; direction: rtl; }
.bh-countdown[hidden] { display: none; }
.bh-countdown__unit { display: grid; justify-items: center; min-width: 58px; padding: 6px 4px 5px; border-radius: var(--bh-r-sm); background: var(--bh-on-dark); color: var(--bh-ink); line-height: 1.1; }
.bh-countdown__unit b { font-size: 1.375rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bh-countdown__unit small { font-size: .75rem; font-weight: 600; color: var(--bh-muted); }
/* البانر الوسطيّ: نصٌّ في الوسط فوق تظليل */
.bh-banner--center { justify-content: center; text-align: center; }
.bh-banner--center::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(20, 28, 38, .45); }
.bh-banner--center .bh-banner__text { justify-items: center; max-width: 80%; }
.bh-banner--center .bh-banner__eyebrow { justify-self: center; }
/* البانر بالصورة وحدها: تحذف المنصّة .bh-banner__text إن كانت الصورة تحمل نصّها */
.bh-banner--plain { display: block; min-height: 0; padding: 0; background: var(--bh-soft); }
.bh-banner--plain .bh-banner__img { position: static; z-index: auto; height: auto; }

/* ---------- السلايدر بجانب قائمة التصنيفات ---------- */
.bh-hero { position: relative; background: var(--bh-soft); }
.bh-hero__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.bh-hero__track::-webkit-scrollbar { display: none; }
.bh-slide { position: relative; isolation: isolate; flex: 0 0 100%; scroll-snap-align: start; min-height: 560px; display: flex; align-items: center; }
.bh-slide__img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: 62% center; }
.bh-slide .bh-container { display: flex; justify-content: flex-end; }
.bh-slide__text { display: grid; justify-items: start; gap: 12px; width: min(430px, 100%); }
.bh-slide__eyebrow { padding: 3px 14px; border-radius: var(--bh-r-xs); background: var(--store-primary-dark); color: var(--bh-on-dark); font-size: var(--bh-fs-sm); font-weight: 700; }
.bh-slide__title { font-size: 3.25rem; font-weight: 800; line-height: 1.1; color: var(--store-primary-dark); }
.bh-slide__lead { font-size: 1.125rem; color: var(--bh-ink); max-width: 40ch; }
.bh-slide__price { font-size: 1.25rem; color: var(--bh-ink); }
.bh-slide__price b { font-size: 1.75rem; font-weight: 800; color: var(--store-primary-dark); }
.bh-slide .bh-btn { margin-top: 6px; }
.bh-hero .bh-dots { position: absolute; bottom: 26px; inset-inline: auto; inset-inline-end: max(16px, calc(50% - 584px)); width: 430px; justify-content: flex-start; margin: 0; }
.bh-hero__nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); }
.bh-hero__nav--prev { inset-inline-start: calc(50% - 600px + 290px); }
.bh-hero__nav--next { inset-inline-end: 24px; }

/* ---------- بطاقات العرض الثلاث ---------- */
.bh-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
.bh-tiles .bh-banner { border-radius: 0; min-height: 300px; padding: 34px 32px; align-items: flex-end; }
.bh-tiles .bh-banner__text { max-width: 56%; }
.bh-tiles .bh-banner__title { font-size: 1.75rem; }
.bh-tiles .bh-banner__img { object-position: left bottom; }

/* ---------- الأكثر مبيعًا: بانرٌ وأربع بطاقات متبادلة ---------- */
.bh-best { display: grid; gap: 50px; }
.bh-best__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: stretch; }
.bh-best__row--flip > .bh-banner { order: 2; }
.bh-best__row > .bh-banner { min-height: 100%; }
.bh-best__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.bh-best__grid .bh-card__media > .bh-cover { margin: 16px 26% 14px; }
/* إن حذف الناشر بانر الصفّ اتّسعت البطاقات الأربع إلى عرضه كلّه */
.bh-best__row:not(:has(> .bh-banner)) { grid-template-columns: minmax(0, 1fr); }
.bh-best__row:not(:has(> .bh-banner)) .bh-best__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bh-best__row:not(:has(> .bh-banner)) .bh-best__grid .bh-card__media > .bh-cover { margin: 24px 19% 18px; }

/* ---------- قسمٌ كحليّ منقوش (وصل حديثًا، المزايا) ---------- */
.bh-navy { position: relative; isolation: isolate; background: var(--store-primary-dark); color: var(--bh-on-dark); overflow: hidden; }
.bh-navy::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07;
  background-image: radial-gradient(circle at 20px 20px, #FFFFFF 3px, transparent 4px), radial-gradient(circle at 60px 60px, #FFFFFF 2px, transparent 3px);
  background-size: 80px 80px; }
.bh-navy::after { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; inset-inline-end: -160px; top: -180px; border-radius: 50%; background: var(--store-primary); opacity: .1; }

/* ---------- مزايانا: شريطٌ مدمج تحت بطاقات العرض ---------- */
.bh-trust { background: var(--bh-peach); border-bottom: 1px solid var(--bh-line); }
.bh-trust__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-block: 24px; }
.bh-trust__list li { display: grid; grid-template-columns: 50px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; align-items: center; }
.bh-trust__list .bh-feature__icon { grid-row: 1 / 3; width: 50px; height: 50px; margin: 0; box-shadow: 0 0 0 5px rgba(243, 200, 28, .22); }
.bh-trust__list .bh-feature__icon .bh-icon { width: 24px; height: 24px; stroke-width: 1.8; }
.bh-trust__list b { align-self: end; font-size: 1rem; font-weight: 800; color: var(--store-primary-dark); line-height: 1.35; }
.bh-trust__list small { align-self: start; font-size: var(--bh-fs-xs); color: var(--bh-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* أيقونة الميزة: دائرةٌ بلون الهويّة */
.bh-feature__icon { display: grid; place-items: center; width: 110px; height: 110px; border-radius: 50%; background: var(--store-primary); color: var(--bh-on-primary); margin-bottom: 10px; box-shadow: 0 0 0 10px rgba(255, 255, 255, .08); }

/* ---------- المؤلّفون: صورٌ مستديرة ---------- */
.bh-authors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px; }
.bh-author { display: grid; justify-items: center; gap: 6px; text-align: center; }
.bh-author img { width: 190px; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--bh-soft); border: 6px solid var(--bh-soft); margin-bottom: 8px; transition: border-color .3s; }
.bh-author:hover img { border-color: var(--store-primary); }
.bh-author__name { font-size: 1.125rem; font-weight: 800; color: var(--store-primary-dark); line-height: 1.35; }
.bh-author__meta { font-size: var(--bh-fs-xs); font-weight: 700; color: var(--bh-muted); }
.bh-author__bio { font-size: var(--bh-fs-sm); color: var(--bh-muted); max-width: 24ch; }
.bh-featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ---------- شوهد مؤخّرًا ---------- */
.bh-recent { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; }
.bh-recent a { display: grid; place-items: center; aspect-ratio: 1; padding: 14px; border-radius: var(--bh-r-sm); background: var(--bh-soft); transition: background-color .3s; }
.bh-recent a:hover { background: var(--bh-peach); }
.bh-recent img { height: 100%; width: auto; border-radius: 3px; box-shadow: var(--bh-shadow-cover); }

/* الشبكة فوق قسمٍ رماديّ: ألواح البطاقات بيضاء */
.bh-section--soft .bh-card__media { background: var(--store-bg); }
.bh-section--soft .bh-card:hover .bh-card__media { background: var(--bh-peach); }

/* ---------- صفّ «عرض الكلّ» ---------- */
.bh-more { display: flex; justify-content: center; margin-top: 44px; }

/* ---------- التذييل الفحميّ ---------- */
.bh-footer { background: var(--bh-coal); color: var(--bh-coal-text); }
.bh-footer__grid { display: grid; grid-template-columns: 1.35fr .8fr .8fr 1.25fr; gap: 44px; padding-block: 64px 48px; }
.bh-footer h3 { color: var(--store-primary); font-size: 1.125rem; margin-bottom: 18px; }
.bh-footer__about { display: grid; gap: 18px; align-content: start; }
.bh-footer__about p { font-size: var(--bh-fs-sm); max-width: 42ch; }
.bh-footer__sub { display: grid; gap: 14px; align-content: start; }
.bh-footer__sub h3 { margin-bottom: 0; }
.bh-footer__sub p { font-size: var(--bh-fs-sm); }
.bh-subscribe { display: flex; gap: 6px; max-width: 400px; }
.bh-subscribe input { flex: 1; min-width: 0; padding: 0 14px; border: 2px solid transparent; border-radius: var(--bh-r-xs); background: #333333; color: var(--bh-on-dark); font-size: var(--bh-fs-sm); }
.bh-subscribe input::placeholder { color: #B5B5B5; }
.bh-subscribe input:focus { outline: none; border-color: var(--store-primary); }
.bh-footer__links { display: grid; gap: 10px; font-size: var(--bh-fs-sm); }
.bh-footer__links a:hover { color: var(--store-primary); }
.bh-contact { display: grid; gap: 12px; font-size: var(--bh-fs-sm); }
.bh-contact li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.bh-contact .bh-icon { width: 18px; height: 18px; margin-top: 3px; color: var(--store-primary); }
.bh-contact bdi { color: var(--bh-on-dark); font-weight: 700; }
.bh-social { display: flex; gap: 8px; }
.bh-social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #333333; color: var(--bh-on-dark); transition: background-color .2s, color .2s; }
.bh-social a:hover { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-social .bh-icon { width: 17px; height: 17px; }
.bh-footer__bottom { background: var(--bh-coal-2); font-size: var(--bh-fs-xs); }
.bh-footer__bottom .bh-container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 18px; }
.bh-pay { display: flex; gap: 6px; flex-wrap: wrap; }
.bh-pay span { padding: 3px 10px; border-radius: var(--bh-r-xs); background: #2E2E2E; font-weight: 700; font-size: .75rem; color: var(--bh-on-dark); }

/* ---------- المواضع الاختياريّة ---------- */
.bh-cover__back:not([src]), .bh-cover__back[src=""] { display: none; }
.bh-contact__addr:has([data-slot="store.address"]:empty) { display: none; }

/* ---------- معرض صفحة الكتاب: الغلاف وظهره ---------- */
.bh-gallery { display: grid; gap: 14px; justify-items: center; }
.bh-gallery__stage { position: relative; width: min(300px, 100%); }
.bh-gallery__stage .bh-cover { box-shadow: 0 26px 44px -20px rgba(20, 28, 38, .55); }
.bh-gallery.is-flipped .bh-cover__back { opacity: 1; }
.bh-gallery__tools { display: flex; align-items: center; justify-content: center; gap: 10px; }
.bh-thumbs { display: flex; gap: 8px; }
.bh-thumbs button { width: 52px; padding: 3px; border-radius: var(--bh-r-xs); border: 2px solid var(--bh-line); background: var(--store-bg); }
.bh-thumbs button[aria-pressed="true"] { border-color: var(--store-primary); }
.bh-thumbs img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; }
.bh-flip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--bh-line); border-radius: var(--bh-r-xs); background: var(--store-bg); font-size: var(--bh-fs-sm); font-weight: 700; }
.bh-flip-btn:hover { border-color: var(--store-primary); }
.bh-gallery:not(:has(.bh-cover__back[src]:not([src=""]))) .bh-gallery__tools { display: none; }

/* ---------- الشريط السفليّ للهاتف ---------- */
.bh-tabbar { display: none; }
/* ==========================================================================
   صفحة التصنيف (وتُستعمل للبحث والعروض)
   ========================================================================== */
.bh-pagehead { position: relative; overflow: hidden; background: var(--bh-lav); padding-block: 46px; text-align: center; }
.bh-pagehead h1 { font-size: 2.5rem; font-weight: 800; color: var(--bh-ink); }
.bh-pagehead p { color: var(--bh-muted); font-size: var(--bh-fs-sm); margin-top: 6px; }
.bh-pagehead .bh-blob { opacity: .8; }
.bh-crumbs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: var(--bh-fs-xs); color: var(--bh-muted); margin-bottom: 8px; }
.bh-crumbs a:hover { color: var(--store-primary-dark); }
.bh-crumbs .bh-icon { width: 13px; height: 13px; transform: scaleX(-1); }
.bh-crumbs [aria-current="page"] { color: var(--store-text); font-weight: 700; }

.bh-shop { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; align-items: start; padding-block: 44px 64px; }
.bh-shop .bh-grid { --bh-cols: 4; gap: 34px 22px; }
.bh-shop__strip { margin-bottom: 34px; }
.bh-shop__strip .bh-title { margin-bottom: 22px; }
.bh-shop__strip .bh-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bh-shop__strip .bh-fcard:nth-child(n+3) { display: none; }

/* التصفية: عمودٌ جانبيّ في الحاسوب، ودرجٌ في الجهاز اللوحيّ والهاتف */
.bh-drawer--filters { position: static; visibility: visible; z-index: auto; }
.bh-drawer--filters .bh-drawer__backdrop, .bh-drawer--filters .bh-drawer__head, .bh-drawer--filters .bh-drawer__foot { display: none; }
.bh-drawer--filters .bh-drawer__panel { position: static; transform: none; width: auto; padding: 0; overflow: visible; background: transparent; }
.bh-filters { display: grid; gap: 30px; }
.bh-filter h2 { position: relative; font-size: var(--bh-fs-md); font-weight: 800; color: var(--bh-ink); padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--bh-line); }
.bh-filter h2::after { content: ""; position: absolute; bottom: -1px; inset-inline-start: 0; width: 46px; height: 2px; background: var(--store-primary); }
.bh-filter__body { display: grid; gap: 11px; }
.bh-check { display: flex; align-items: center; gap: 10px; font-size: var(--bh-fs-sm); cursor: pointer; }
.bh-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--store-primary-dark); flex: none; }
.bh-check__count { margin-inline-start: auto; min-width: 30px; padding: 1px 8px; border-radius: var(--bh-r-full); background: var(--bh-lav); font-size: .75rem; color: var(--bh-muted); text-align: center; font-variant-numeric: tabular-nums; }
.bh-check .bh-type { position: static; width: 24px; height: 24px; box-shadow: none; }
.bh-check .bh-type .bh-icon { width: 13px; height: 13px; }
.bh-check .bh-rating { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.bh-range input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--bh-line); border-radius: var(--bh-r-xs); font-size: var(--bh-fs-sm); font-variant-numeric: tabular-nums; background: var(--store-bg); }
.bh-range input:focus { outline: none; border-color: var(--store-primary); }
.bh-range span { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.bh-taglist a { padding: 5px 12px; border: 1px solid var(--bh-line); border-radius: var(--bh-r-xs); font-size: var(--bh-fs-xs); }
.bh-taglist a:hover { border-color: var(--store-primary); color: var(--store-primary-dark); }
.bh-filters__actions { display: flex; gap: 10px; }
.bh-filters__actions .bh-btn { flex: 1; white-space: nowrap; }
.bh-side-promo { position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: start; gap: 8px; min-height: 0; padding: 0 0 22px; background: var(--bh-cream); border-radius: var(--bh-r-md, 10px); text-align: center; }
.bh-side-promo > :not(img) { padding-inline: 18px; }
.bh-side-promo .bh-btn { justify-self: center; }
.bh-side-promo .bh-banner__img { position: static; width: 100%; height: auto; aspect-ratio: 270/300; object-fit: cover; margin-bottom: 8px; z-index: auto; }
.bh-side-promo b { font-size: var(--bh-fs-lg); font-weight: 800; color: var(--bh-ink); line-height: 1.4; }
.bh-side-promo p { font-size: var(--bh-fs-sm); color: var(--bh-muted); }
.bh-side-promo .bh-btn { margin-top: 6px; }

.bh-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--bh-line); }
.bh-toolbar__count { font-size: var(--bh-fs-sm); color: var(--bh-muted); }
.bh-toolbar__count b { color: var(--store-text); font-variant-numeric: tabular-nums; }
.bh-toolbar__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bh-select { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: var(--bh-fs-sm); }
.bh-select select { appearance: none; -webkit-appearance: none; padding: 8px 14px; padding-inline-end: 32px; border: 1px solid var(--bh-line); border-radius: var(--bh-r-xs); background: var(--store-bg); font-size: var(--bh-fs-sm); color: var(--store-text); }
.bh-select select:focus { outline: none; border-color: var(--store-primary); }
.bh-select::after { content: ""; position: absolute; inset-inline-end: 13px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.bh-select__label { color: var(--bh-muted); }
.bh-filter-btn { display: none; }
.bh-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.bh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; padding-inline-end: 8px; border: 0; border-radius: var(--bh-r-full); background: var(--bh-lav); font-size: var(--bh-fs-xs); font-weight: 700; color: var(--store-text); }
.bh-chip .bh-icon { width: 14px; height: 14px; }
.bh-chip:hover { background: var(--bh-peach); color: var(--store-primary-dark); }
.bh-chip--clear { background: transparent; color: var(--store-primary-dark); text-decoration: underline; padding-inline: 4px; }
.bh-shop .bh-pager { margin-top: 48px; }
.bh-pager .bh-icon { width: 16px; height: 16px; }

@media (max-width: 1199px) {
  .bh-shop { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
  .bh-shop .bh-grid { --bh-cols: 3; }
}
@media (max-width: 1023px) {
  .bh-shop { grid-template-columns: 1fr; padding-block: 30px 48px; }
  .bh-filter-btn { display: inline-flex; }
  .bh-drawer--filters { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
  .bh-drawer--filters.is-open { visibility: visible; }
  .bh-drawer--filters .bh-drawer__backdrop { display: block; }
  .bh-drawer--filters .bh-drawer__head { display: flex; }
  .bh-drawer--filters .bh-drawer__foot { display: flex; position: sticky; bottom: 0; gap: 10px; background: var(--store-bg); padding-top: 14px; margin-top: auto; }
  .bh-drawer--filters .bh-drawer__foot .bh-btn { flex: 1; white-space: nowrap; padding-inline: 12px; }
  .bh-drawer--filters .bh-drawer__panel {
    position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(88vw, 360px);
    background: var(--store-bg); transform: translateX(100%); overflow-y: auto;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .bh-drawer--filters.is-open .bh-drawer__panel { transform: translateX(0); }
  .bh-filters { gap: 24px; padding-bottom: 16px; }
  .bh-filters__actions.is-desktop, .bh-drawer--filters .bh-side-promo { display: none; }
}
@media (max-width: 767px) {
  .bh-pagehead { padding-block: 28px; }
  .bh-pagehead h1 { font-size: var(--bh-fs-xl); }
  .bh-pagehead .bh-blob { display: none; }
  .bh-shop .bh-grid { --bh-cols: 2; gap: 26px 14px; }
  .bh-shop__strip .bh-featured { grid-template-columns: 1fr; }
  .bh-shop__strip .bh-fcard:nth-child(n+2) { display: none; }
  .bh-toolbar__tools { width: 100%; }
  .bh-toolbar__tools .bh-select:not(.bh-select--per) { flex: 1; }
  .bh-toolbar__tools .bh-select select { width: 100%; }
  .bh-select__label { display: none; }
}

/* ==========================================================================
   صفحة المنتج: كتاب ورقيّ، وإلكترونيّ، وصوتيّ، ووسيلة تعليميّة
   ========================================================================== */
.bh-pagehead__cat { font-size: 2rem; font-weight: 800; color: var(--bh-ink); }
.bh-pagehead .bh-pagehead__cat { margin: 0; font-size: 2rem; font-weight: 800; color: var(--bh-ink); }
.bh-product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 250px; gap: 40px; align-items: start; padding-block: 44px 56px; }
@media (min-width: 1200px) { .bh-product:not(:has(.bh-aside)) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
/* الغلاف وعمود «قد يعجبك أيضًا» يبقيان في النظر بجانب البيانات الطويلة */
@media (min-width: 1024px) { .bh-product__media, .bh-aside { position: sticky; top: 210px; } }
.bh-product__media { position: relative; display: grid; place-items: center; padding: 36px 24px 24px; border-radius: var(--bh-r-lg); background: var(--bh-peach); }
.bh-product__media .bh-badges { top: 16px; inset-inline-start: 16px; }
.bh-product__media .bh-gallery__stage { width: min(320px, 100%); }

.bh-info { display: grid; gap: 16px; min-width: 0; }
.bh-info__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--bh-fs-sm); color: var(--bh-muted); }
.bh-info__kicker a { color: var(--store-primary-dark); font-weight: 700; }
.bh-info__kind { display: inline-flex; align-items: center; gap: 6px; }
.bh-info__kind .bh-type { position: static; width: 24px; height: 24px; box-shadow: none; }
.bh-info__kind .bh-type .bh-icon { width: 13px; height: 13px; }
.bh-info__title { font-size: 1.75rem; font-weight: 800; line-height: 1.35; color: var(--bh-ink); }
.bh-info__by { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: var(--bh-fs-sm); color: var(--bh-muted); }
.bh-info__by a { color: var(--store-text); font-weight: 700; }
.bh-info__by a:hover { color: var(--store-primary-dark); }
.bh-info .bh-price { gap: 12px; align-items: baseline; }
.bh-info .bh-price__now { font-size: 1.875rem; }
.bh-info .bh-price__old { font-size: 1.125rem; }
.bh-off { display: inline-block; padding: 2px 8px; border-radius: var(--bh-r-xs); background: var(--bh-peach); color: var(--store-primary-dark); font-size: .8125rem; font-weight: 800; }
.bh-avail { display: inline-flex; align-items: center; gap: 6px; font-size: var(--bh-fs-sm); font-weight: 700; color: var(--bh-ok); }
.bh-avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.bh-info__lead { color: var(--bh-muted); max-width: 62ch; }
.bh-info hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--bh-line); }

.bh-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bh-fact { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--bh-r-sm); background: var(--bh-lav); }
.bh-fact .bh-icon { width: 22px; height: 22px; color: var(--store-primary-dark); flex: none; }
.bh-fact small { display: block; font-size: .75rem; color: var(--bh-muted); line-height: 1.4; }
.bh-fact b { display: block; font-size: var(--bh-fs-sm); font-weight: 700; line-height: 1.4; }

.bh-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border: 1.5px dashed var(--store-primary); border-radius: var(--bh-r-md); background: var(--store-bg); }
.bh-sample p { flex: 1 1 220px; font-size: var(--bh-fs-sm); color: var(--bh-muted); }
.bh-sample b { color: var(--store-text); }

.bh-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bh-buy .bh-qty { height: 50px; }
.bh-buy .bh-btn { min-height: 50px; padding-inline: 26px; }
.bh-buy .bh-btn--primary { flex: 1 1 180px; }
.bh-buy__or { font-size: var(--bh-fs-xs); font-weight: 700; color: var(--bh-muted); }
.bh-buy .bh-btn--dark { flex: 1 1 140px; }
.bh-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--bh-fs-sm); }
.bh-links button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font-weight: 700; color: var(--store-text); }
.bh-links button:hover, .bh-links button[aria-pressed="true"] { color: var(--store-primary-dark); }
.bh-meta { display: grid; gap: 6px; margin: 0; padding-top: 14px; border-top: 1px solid var(--bh-line); font-size: var(--bh-fs-sm); }
.bh-meta div { display: flex; flex-wrap: wrap; gap: 6px; }
.bh-meta dt { color: var(--bh-muted); }
.bh-meta dd { margin: 0; font-weight: 700; }
.bh-meta dd a:hover { color: var(--store-primary-dark); }

.bh-aside { display: grid; gap: 14px; padding: 20px; border-radius: var(--bh-r-md); background: var(--bh-lav); }
.bh-aside h2 { font-size: var(--bh-fs-md); font-weight: 800; color: var(--bh-ink); padding-bottom: 10px; border-bottom: 1px solid var(--bh-line); }
.bh-mini { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; }
.bh-mini .bh-cover { border-radius: var(--bh-r-sm); }
.bh-mini .bh-cover .bh-type { display: none; }
.bh-mini h3 { font-size: var(--bh-fs-sm); font-weight: 700; line-height: 1.45; }
.bh-mini h3 a:hover { color: var(--store-primary-dark); }
.bh-mini .bh-price { justify-content: flex-start; font-size: var(--bh-fs-sm); margin-top: 4px; }

/* التبويبات */
.bh-ptabs { margin-bottom: 20px; }
.bh-ptabs__bar { display: flex; justify-content: center; gap: 34px; border-bottom: 1px solid var(--bh-line); overflow-x: auto; scrollbar-width: none; }
.bh-ptabs__bar button { position: relative; padding: 16px 2px; border: 0; background: none; font-weight: 800; font-size: var(--bh-fs-md); color: var(--bh-muted); white-space: nowrap; }
.bh-ptabs__bar button[aria-selected="true"] { color: var(--bh-ink); }
.bh-ptabs__bar button[aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 3px; background: var(--store-primary); }
.bh-ptabs__panel { padding-block: 30px 8px; }
.bh-prose { display: grid; gap: 14px; max-width: 78ch; margin-inline: auto; color: var(--bh-muted); line-height: 1.9; }
.bh-author-box { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: center; max-width: 78ch; margin: 30px auto 0; padding: 22px; border-radius: var(--bh-r-md); background: var(--bh-lav); }
.bh-author-box img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--store-bg); box-shadow: 0 0 0 2px var(--store-primary); }
.bh-author-box h3 { font-size: var(--bh-fs-lg); font-weight: 800; }
.bh-author-box p { font-size: var(--bh-fs-sm); color: var(--bh-muted); margin-block: 4px 10px; }
.bh-author-box a { font-size: var(--bh-fs-sm); font-weight: 700; color: var(--store-primary-dark); text-decoration: underline; }
.bh-specs { width: 100%; max-width: 760px; margin-inline: auto; border-collapse: collapse; font-size: var(--bh-fs-sm); }
.bh-specs th, .bh-specs td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--bh-line); }
.bh-specs th { width: 34%; color: var(--bh-muted); font-weight: 500; background: var(--bh-lav); }
.bh-specs td { font-weight: 700; font-variant-numeric: tabular-nums; }
.bh-reviews { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; max-width: 1000px; margin-inline: auto; }
.bh-score { display: grid; justify-items: start; gap: 6px; padding: 22px; border-radius: var(--bh-r-md); background: var(--bh-peach); }
.bh-score__big { font-size: 3rem; font-weight: 800; line-height: 1; color: var(--bh-ink); }
.bh-bars { display: grid; gap: 6px; width: 100%; margin-top: 6px; }
.bh-bar { display: grid; grid-template-columns: 52px 1fr 30px; align-items: center; gap: 10px; font-size: var(--bh-fs-xs); color: var(--bh-muted); font-variant-numeric: tabular-nums; }
.bh-bar__track { height: 7px; border-radius: 7px; background: var(--store-bg); overflow: hidden; }
.bh-bar__fill { display: block; width: var(--w); height: 100%; border-radius: 7px; background: var(--bh-star); }
.bh-review-list { display: grid; gap: 22px; }
.bh-review { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--bh-line); }
.bh-review header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.bh-review b { font-weight: 800; }
.bh-review time { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-review p { margin-top: 6px; font-size: var(--bh-fs-sm); color: var(--bh-muted); }
.bh-trust--row { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 30px 0; border-block: 1px solid var(--bh-line); }

.bh-sticky-buy { display: none; }

@media (max-width: 1199px) {
  .bh-product { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .bh-aside { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bh-aside h2 { grid-column: 1 / -1; }
  .bh-trust--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .bh-product { grid-template-columns: 1fr; gap: 28px; padding-block: 28px 40px; }
  .bh-reviews { grid-template-columns: 1fr; }
  .bh-trust--row { justify-items: stretch; padding-top: 30px; }
}
@media (max-width: 767px) {
  .bh-pagehead .bh-pagehead__cat { font-size: 1.5rem; }
  .bh-product__media { padding: 28px 16px 18px; }
  .bh-product__media .bh-gallery__stage { width: min(230px, 100%); }
  .bh-info__title { font-size: 1.375rem; }
  .bh-info .bh-price__now { font-size: 1.625rem; }
  .bh-facts { grid-template-columns: 1fr 1fr; }
  .bh-fact { padding: 10px; gap: 8px; }
  .bh-buy__or { display: none; }
  .bh-buy .bh-btn--dark { flex: 1 1 100%; }
  .bh-aside { grid-template-columns: 1fr; }
  .bh-ptabs__bar { justify-content: flex-start; gap: 24px; }
  .bh-author-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .bh-trust--row { grid-template-columns: 1fr; gap: 14px; }
  .bh-trust--row li { justify-content: flex-start; }
  .bh-sticky-buy {
    display: flex; align-items: center; gap: 12px; position: fixed; inset-inline: 0; z-index: 39;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)); padding: 10px 16px;
    background: var(--store-bg); border-top: 1px solid var(--bh-line); box-shadow: 0 -6px 18px rgba(31, 27, 28, .06);
  }
  .bh-sticky-buy .bh-price { flex: 1; justify-content: flex-start; }
  .bh-sticky-buy .bh-btn { min-height: 44px; }
  body.has-sticky-buy { padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   صفحة المؤلّف
   ========================================================================== */
.bh-profile { position: relative; overflow: hidden; background: var(--bh-lav); padding-block: 40px 56px; text-align: center; }
.bh-profile__inner { display: grid; justify-items: center; gap: 12px; max-width: 760px; margin-inline: auto; }
.bh-profile__photo { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; border: 6px solid var(--store-bg); box-shadow: 0 0 0 2px var(--store-primary), 0 20px 40px -18px rgba(31, 27, 28, .4); margin-top: 8px; }
.bh-profile__role { color: var(--store-primary-dark); font-weight: 700; font-size: var(--bh-fs-sm); }
.bh-profile h1 { font-size: var(--bh-fs-2xl); font-weight: 800; color: var(--bh-ink); line-height: 1.25; }
.bh-profile__bio { display: grid; gap: 10px; color: var(--bh-muted); line-height: 1.9; }
.bh-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
.bh-stat { display: grid; min-width: 130px; padding: 14px 18px; border-radius: var(--bh-r-md); background: var(--store-bg); box-shadow: var(--bh-shadow); }
.bh-stat b { font-size: 1.5rem; font-weight: 800; color: var(--store-primary-dark); font-variant-numeric: tabular-nums; }
.bh-stat small { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-grid--5 { --bh-cols: 5; }
.bh-works-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-bottom: 30px; }
.bh-works-tools .bh-tabs { margin: 0; }

@media (max-width: 1199px) { .bh-grid--5 { --bh-cols: 4; } }
@media (max-width: 1023px) { .bh-grid.bh-grid--5 { --bh-cols: 3; } }
@media (max-width: 767px) {
  .bh-profile { padding-block: 28px 40px; }
  .bh-profile__photo { width: 128px; height: 128px; }
  .bh-profile h1 { font-size: var(--bh-fs-xl); }
  .bh-profile .bh-blob { display: none; }
  .bh-stat { min-width: 0; flex: 1 1 90px; padding: 12px; }
  .bh-grid.bh-grid--5 { --bh-cols: 2; }
}

/* ==========================================================================
   السلّة (الشكل فقط)
   ========================================================================== */
.bh-cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; padding-block: 44px 60px; }
.bh-ship-goal { display: grid; gap: 10px; padding: 16px 20px; margin-bottom: 22px; border-radius: var(--bh-r-md); background: var(--bh-peach); font-size: var(--bh-fs-sm); }
.bh-ship-goal b { color: var(--store-primary-dark); }
.bh-progress { height: 8px; border-radius: 8px; background: var(--store-bg); overflow: hidden; }
.bh-progress span { display: block; width: var(--w); height: 100%; border-radius: 8px; background: var(--store-primary); }
.bh-lines { display: grid; }
.bh-lines__head, .bh-line { display: grid; grid-template-columns: minmax(0, 1fr) 120px 130px 120px 40px; gap: 16px; align-items: center; }
.bh-lines__head { padding: 12px 16px; border-radius: var(--bh-r-sm); background: var(--bh-lav); font-size: var(--bh-fs-xs); font-weight: 800; color: var(--bh-muted); }
.bh-line { padding: 18px 16px; border-bottom: 1px solid var(--bh-line); }
.bh-line__item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; }
.bh-line__media { position: relative; display: block; }
.bh-line__media .bh-cover { border-radius: var(--bh-r-sm); }
.bh-line__media .bh-type { width: 24px; height: 24px; bottom: 4px; inset-inline-start: 4px; }
.bh-line__media .bh-type .bh-icon { width: 12px; height: 12px; }
.bh-line__title { display: block; font-weight: 800; line-height: 1.45; color: var(--bh-ink); }
.bh-line__title:hover { color: var(--store-primary-dark); }
.bh-line__meta { font-size: var(--bh-fs-xs); color: var(--bh-muted); margin-top: 4px; }
.bh-line__price { display: grid; font-weight: 700; font-variant-numeric: tabular-nums; }
.bh-line__price del { font-size: var(--bh-fs-xs); font-weight: 400; color: var(--bh-muted); }
.bh-line__total { font-weight: 800; color: var(--store-primary-dark); font-variant-numeric: tabular-nums; }
.bh-line__remove { width: 36px; height: 36px; box-shadow: none; background: transparent; color: var(--bh-muted); }
.bh-line__remove:hover { background: var(--bh-peach); color: var(--store-primary-dark); }
.bh-cart__after { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.bh-back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--bh-fs-sm); }
.bh-back-link:hover { color: var(--store-primary-dark); }

.bh-summary { position: sticky; top: 165px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 26px 24px; border-radius: var(--bh-r-md); background: var(--bh-lav); }
.bh-summary h2 { position: relative; font-size: var(--bh-fs-lg); font-weight: 800; padding-bottom: 12px; border-bottom: 1px solid var(--bh-line); }
.bh-summary h2::after { content: ""; position: absolute; bottom: -1px; inset-inline-start: 0; width: 46px; height: 2px; background: var(--store-primary); }
.bh-coupon { display: flex; gap: 8px; }
.bh-coupon .bh-field { padding-block: 10px; }
.bh-summary dl { display: grid; gap: 10px; margin: 0; font-size: var(--bh-fs-sm); }
.bh-summary dl div { display: flex; justify-content: space-between; gap: 12px; }
.bh-summary dt { color: var(--bh-muted); }
.bh-summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bh-summary .is-discount dd { color: var(--bh-ok); }
.bh-summary .is-total { padding-top: 12px; border-top: 1px dashed var(--bh-line); font-size: var(--bh-fs-lg); }
.bh-summary .is-total dt { color: var(--store-text); font-weight: 800; }
.bh-summary .is-total dd { font-weight: 800; color: var(--store-primary-dark); }
.bh-summary__note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-summary__note .bh-icon { width: 16px; height: 16px; }
.bh-summary .bh-chips { margin: 0; }
.bh-summary .bh-chip { background: var(--store-bg); }
.bh-chip__x { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--bh-muted); }
.bh-chip__x:hover { background: var(--bh-peach); color: var(--store-primary-dark); }

/* ==========================================================================
   صفحة 404
   ========================================================================== */
.bh-404 { position: relative; overflow: hidden; background: var(--bh-lav); }
.bh-404__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 70px; }
.bh-404 .bh-404__num { font-size: 8rem; font-weight: 800; line-height: 1; color: var(--store-primary-dark); letter-spacing: -2px; text-shadow: 6px 6px 0 var(--store-primary); }
.bh-404 h1 { font-size: 2.25rem; font-weight: 800; color: var(--bh-ink); margin-block: 10px; }
.bh-404 p { color: var(--bh-muted); max-width: 52ch; }
.bh-404__search { display: flex; gap: 8px; max-width: 460px; margin-top: 24px; }
.bh-404__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.bh-404__art { position: relative; display: grid; place-items: center; min-height: 380px; }
.bh-404__art::before { content: ""; position: absolute; width: 360px; height: 340px; background: var(--bh-peach); border-radius: 62% 38% 46% 54% / 55% 45% 55% 45%; }
.bh-404__stack { position: relative; display: flex; align-items: flex-end; }
.bh-404__stack .bh-cover { width: 150px; box-shadow: 0 24px 40px -18px rgba(31, 27, 28, .55); }
.bh-404__stack .bh-cover:nth-child(1) { transform: rotate(-9deg) translateX(-40px); }
.bh-404__stack .bh-cover:nth-child(2) { z-index: 2; transform: translateY(-20px); }
.bh-404__stack .bh-cover:nth-child(3) { transform: rotate(9deg) translateX(40px); }

@media (max-width: 1199px) {
  .bh-cart { grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; }
  .bh-lines__head, .bh-line { grid-template-columns: minmax(0, 1fr) 100px 120px 100px 36px; gap: 12px; }
}
@media (max-width: 1023px) {
  .bh-cart { grid-template-columns: 1fr; padding-block: 28px 44px; }
  .bh-summary { position: static; }
  .bh-404__inner { grid-template-columns: 1fr; text-align: center; padding-block: 44px; }
  .bh-404 p { margin-inline: auto; }
  .bh-404__search, .bh-404__actions { margin-inline: auto; justify-content: center; }
  .bh-404__art { min-height: 300px; order: -1; }
}
@media (max-width: 767px) {
  .bh-lines__head { display: none; }
  .bh-line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "item remove" "price price" "qty total"; gap: 12px; padding: 16px 0; }
  .bh-line__item { grid-area: item; grid-template-columns: 64px minmax(0, 1fr); }
  .bh-line__remove { grid-area: remove; align-self: start; }
  .bh-line__price { grid-area: price; display: flex; gap: 8px; align-items: baseline; font-size: var(--bh-fs-sm); }
  .bh-line > .bh-qty, .bh-line > .bh-line__meta { grid-area: qty; justify-self: start; }
  .bh-line__total { grid-area: total; justify-self: end; }
  .bh-summary { padding: 20px 16px; }
  .bh-404 .bh-404__num { font-size: 5.5rem; }
  .bh-404 h1 { font-size: var(--bh-fs-xl); }
  .bh-404__art { min-height: 230px; }
  .bh-404__art::before { width: 250px; height: 230px; }
  .bh-404__stack .bh-cover { width: 104px; }
  .bh-404__stack .bh-cover:nth-child(1) { transform: rotate(-9deg) translateX(-26px); }
  .bh-404__stack .bh-cover:nth-child(3) { transform: rotate(9deg) translateX(26px); }
  .bh-404 .bh-blob { display: none; }
}


/* ---------- كتاب الأسبوع: كتابٌ واحد بغلافٍ كبير على قرصٍ بلون الهويّة ---------- */
.bh-section--banner { padding-block: 72px; }
.bh-feature-sec { overflow: hidden; }
.bh-feature__book { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.bh-feature__media { position: relative; display: grid; place-items: center; padding: 30px 0; }
.bh-feature__disc { position: absolute; width: min(380px, 90%); aspect-ratio: 1; border-radius: 50%; background: var(--store-primary); }
.bh-feature__disc::after { content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 3px dashed var(--store-primary-dark); opacity: .25; }
.bh-feature__media .bh-cover { position: relative; width: min(250px, 62%); transform: rotate(-4deg); box-shadow: 0 30px 46px -22px rgba(20, 28, 38, .6); }
.bh-feature__body { display: grid; justify-items: start; gap: 12px; }
.bh-feature__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: var(--bh-r-xs); background: var(--store-primary-dark); color: var(--bh-on-dark); font-size: var(--bh-fs-sm); font-weight: 700; }
.bh-feature__eyebrow .bh-icon { width: 16px; height: 16px; color: var(--store-primary); }
.bh-feature__title { font-size: 2.5rem; line-height: 1.2; }
.bh-feature__title a:hover { text-decoration: underline; text-decoration-color: var(--store-primary); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.bh-feature__by { color: var(--bh-muted); }
.bh-feature__by a { font-weight: 700; color: var(--store-text); }
.bh-feature__desc { display: grid; gap: 8px; color: var(--bh-muted); max-width: 60ch; }
.bh-feature__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 6px; }
.bh-feature__buy .bh-price__now { font-size: 1.75rem; }
.bh-feature__wish { width: 46px; height: 46px; }
.bh-feature__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--store-primary-dark); text-decoration: underline; text-decoration-color: var(--store-primary); text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* ---------- الدوّار الأفقيّ («وصل حديثًا» وأعمال المؤلّف) ---------- */
.bh-rail { position: relative; }
.bh-rail__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 30px) / 3); grid-template-columns: none; gap: 30px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block: 4px 18px; }
.bh-rail__track::-webkit-scrollbar { display: none; }
.bh-rail__track > * { scroll-snap-align: start; }
.bh-rail__btn { position: absolute; top: calc(50% - 30px); z-index: 4; width: 46px; height: 46px; }
.bh-rail__btn--prev { inset-inline-start: -23px; }
.bh-rail__btn--next { inset-inline-end: -23px; }
.bh-rail__btn .bh-icon { transform: scaleX(-1); }
.bh-rail__btn--prev .bh-icon { transform: none; }
.bh-rail--cards .bh-rail__track { grid-auto-columns: calc((100% - 4 * 24px) / 5); gap: 24px; }

/* ---------- آراء القرّاء ---------- */
.bh-rcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.bh-rcard { position: relative; display: grid; align-content: start; gap: 12px; margin: 0; padding: 30px 26px 24px; border-radius: var(--bh-r-md); background: var(--store-bg); box-shadow: 0 18px 36px -24px rgba(31, 42, 53, .35); }
.bh-rcard__mark { position: absolute; top: -18px; inset-inline-end: 22px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--store-primary); color: var(--bh-on-primary); }
.bh-rcard__mark .bh-icon { width: 20px; height: 20px; }
.bh-rcard__text { margin: 0; color: var(--store-text); line-height: 1.8; }
.bh-rcard__who { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--bh-line); }
.bh-rcard__who img { width: 38px; height: 57px; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 12px -6px rgba(20, 28, 38, .5); }
.bh-rcard__who b { display: block; font-weight: 800; color: var(--store-primary-dark); }
.bh-rcard__who small { font-size: var(--bh-fs-xs); color: var(--bh-muted); }
.bh-rcard__who a { font-weight: 700; color: var(--store-text); }
.bh-rcard__who a:hover { text-decoration: underline; }

/* ---------- المقالات ---------- */
.bh-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.bh-post { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: var(--bh-r-md); background: var(--store-bg); box-shadow: 0 16px 34px -26px rgba(31, 42, 53, .45); }
.bh-post__media { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bh-peach); }
.bh-post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.bh-post:hover .bh-post__media img { transform: scale(1.04); }
.bh-post__body { display: grid; align-content: start; justify-items: start; gap: 8px; padding: 20px 22px 22px; }
.bh-post__date { padding: 1px 10px; border-radius: var(--bh-r-xs); background: var(--store-primary); color: var(--bh-on-primary); font-size: var(--bh-fs-xs); font-weight: 800; }
.bh-post__title { font-size: 1.25rem; line-height: 1.4; }
.bh-post__title a:hover { text-decoration: underline; text-decoration-color: var(--store-primary); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bh-post__excerpt { font-size: var(--bh-fs-sm); color: var(--bh-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bh-post__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--bh-fs-sm); font-weight: 800; color: var(--store-primary-dark); }
.bh-post__more:hover { text-decoration: underline; }
.bh-posts--blog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bh-post--lead { grid-column: 1 / -1; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: none; }
.bh-post--lead .bh-post__media { aspect-ratio: auto; min-height: 100%; }
.bh-post--lead .bh-post__body { align-content: center; padding: 34px; gap: 12px; }
.bh-post--lead .bh-post__title { font-size: 1.875rem; }
.bh-post--lead .bh-post__excerpt { font-size: var(--bh-fs-md); -webkit-line-clamp: 4; }

/* ---------- صفحة المقال ---------- */
.bh-article { max-width: 780px; margin-inline: auto; padding-block: 40px 64px; }
.bh-article__img { width: 100%; height: auto; border-radius: var(--bh-r-lg); margin-bottom: 30px; }
.bh-article__body { display: grid; gap: 16px; font-size: 1.0625rem; line-height: 1.95; color: var(--store-text); }
.bh-article__body h2 { font-size: 1.5rem; margin-top: 12px; }
.bh-article__body blockquote { margin: 6px 0; padding: 18px 22px; border-inline-start: 5px solid var(--store-primary); border-radius: var(--bh-r-sm); background: var(--bh-peach); font-weight: 700; color: var(--store-primary-dark); }
.bh-article__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 34px; padding-top: 22px; border-top: 1px dashed var(--bh-line); }
.bh-pagehead__date { display: inline-block; margin-top: 10px; padding: 1px 12px; border-radius: var(--bh-r-xs); background: var(--store-primary); color: var(--bh-on-primary); font-size: var(--bh-fs-sm); font-weight: 800; }

/* ---------- الصفّ الواحد: بطاقاتٌ بعدد أعمدة الشبكة، بلا صفٍّ ناقص ---------- */
.bh-grid--one > * { display: none; }
.bh-grid--one > :nth-child(-n+4) { display: flex; }
@media (min-width: 1200px) {
  .bh-grid--one.bh-grid--5 > :nth-child(-n+5) { display: flex; }
  body[data-books-per-row="4"] .bh-grid--one.bh-grid--per-row > :nth-child(5) { display: none; }
  body[data-books-per-row="6"] .bh-grid--one.bh-grid--per-row > :nth-child(-n+6) { display: flex; }
}
@media (min-width: 768px) and (max-width: 1023px) { .bh-grid--one > :nth-child(4) { display: none; } }
/* شبكة «منتجاتنا»: اثنا عشر كتابًا تملأ 3 و4 و6 أعمدة؛ ومع 5 أعمدة تُعرض عشرة، وفي الهاتف ثمانية */
@media (min-width: 1200px) { body[data-books-per-row="5"] .bh-grid--fill > :nth-child(n+11) { display: none; } }
@media (max-width: 767px) { .bh-grid--fill > :nth-child(n+9) { display: none; } }

/* ---------- صفحة الكتاب: اختيار الصيغة، والتوصيل والدفع ---------- */
.bh-formats { display: grid; gap: 8px; }
.bh-formats__label { font-size: var(--bh-fs-xs); font-weight: 800; color: var(--bh-muted); }
.bh-formats__list { display: flex; flex-wrap: wrap; gap: 8px; }
.bh-format { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; min-width: 128px; padding: 8px 14px 8px 12px; border: 2px solid var(--bh-line); border-radius: var(--bh-r-sm); background: var(--store-bg); }
.bh-format .bh-type { position: static; grid-row: 1 / 3; width: 26px; height: 26px; box-shadow: none; }
.bh-format .bh-type .bh-icon { width: 13px; height: 13px; }
.bh-format b { font-size: var(--bh-fs-sm); font-weight: 800; line-height: 1.3; }
.bh-format small { font-size: var(--bh-fs-xs); color: var(--bh-muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.bh-format:hover { border-color: var(--store-primary); }
.bh-format[aria-current="page"] { border-color: var(--store-primary-dark); background: var(--bh-peach); }
.bh-formats:not(:has([data-repeat="format"] ~ .bh-format)) { display: none; }
.bh-ship { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--bh-r-md); border: 2px dashed var(--bh-line); }
.bh-ship li { display: flex; align-items: flex-start; gap: 10px; font-size: var(--bh-fs-sm); line-height: 1.5; }
.bh-ship .bh-icon { width: 20px; height: 20px; margin-top: 1px; color: var(--store-primary-dark); }
.bh-ship b { color: var(--store-primary-dark); }
.bh-ship [data-option="delivery_note"]:empty { display: none; }
.bh-ship li:has([data-option="delivery_note"]:empty) { display: none; }

/* ---------- صفحة التصنيف: عرض الشبكة أو القائمة ---------- */
.bh-view { display: inline-flex; border: 1px solid var(--bh-line); border-radius: var(--bh-r-xs); overflow: hidden; }
.bh-view button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: var(--store-bg); color: var(--bh-muted); }
.bh-view button + button { border-inline-start: 1px solid var(--bh-line); }
.bh-view button[aria-pressed="true"] { background: var(--store-primary); color: var(--bh-on-primary); }
.bh-shop .bh-grid.is-list { --bh-cols: 1 !important; gap: 18px; }
.bh-grid.is-list .bh-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; align-items: center; text-align: start; padding: 14px; border: 1px solid var(--bh-line); border-radius: var(--bh-r-md); }
.bh-grid.is-list .bh-card__body { justify-items: start; }
.bh-grid.is-list .bh-price { justify-content: flex-start; }

/* خيار books_per_row: تضعه المنصّة سمةً على <body>، ويطبَّق على شبكات الأقسام في الشاشات الواسعة */
@media (min-width: 1200px) {
  body[data-books-per-row="4"] .bh-section .bh-grid.bh-grid--per-row { --bh-cols: 4; }
  body[data-books-per-row="5"] .bh-section .bh-grid.bh-grid--per-row { --bh-cols: 5; }
  body[data-books-per-row="6"] .bh-section .bh-grid.bh-grid--per-row { --bh-cols: 6; }
}
/* ==========================================================================
   الاستجابة: 1440 / 768 / 390
   ========================================================================== */
@media (max-width: 1199px) {
  .bh-header .bh-bar { gap: 20px; }
  .bh-hsearch__cat { display: none; }
  .bh-menu { gap: 22px; }
  .bh-depts { width: 240px; }
  .bh-slide__title { font-size: 3rem; }
  .bh-slide__text { width: min(400px, 100%); }
  .bh-circles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 20px; }
  .bh-authors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bh-authors > :nth-child(n+4) { display: none; }
  .bh-recent { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bh-recent > :nth-child(n+7) { display: none; }
  .bh-tiles .bh-banner__title { font-size: 1.5rem; }
  .bh-footer__grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .bh-footer__sub { grid-column: 1 / -1; }
  .bh-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bh-trust__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
  .bh-rail--cards .bh-rail__track { grid-auto-columns: calc((100% - 3 * 24px) / 4); }
  .bh-feature__title { font-size: 2.125rem; }
  .bh-rail__btn--prev { inset-inline-start: -8px; }
  .bh-rail__btn--next { inset-inline-end: -8px; }
}
/* قائمة التصنيفات المثبَّتة بجانب السلايدر في الشاشات الواسعة وحدها */
@media (min-width: 1024px) {
  .bh-depts__list.is-pinned { display: block; }
}
@media (max-width: 1023px) {
  .bh-navbar, .bh-hide-md { display: none; }
  .bh-depts__list.is-pinned { display: none; }
  .bh-menu-btn { display: inline-grid; }
  .bh-topbar__phone { display: none; }
  .bh-header .bh-bar { flex-wrap: wrap; gap: 10px 14px; min-height: 0; padding-block: 12px; }
  .bh-header { border-bottom: 4px solid var(--store-primary); }
  .bh-hsearch { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .bh-actions { margin-inline-start: auto; }
  .bh-grid { --bh-cols: 3; }
  .bh-section { padding-block: 64px; }
  .bh-slide { min-height: 440px; }
  .bh-slide__img { object-position: 75% center; }
  .bh-slide__title { font-size: 2.5rem; }
  .bh-tiles { grid-auto-flow: row; }
  .bh-tiles .bh-banner { min-height: 260px; }
  .bh-tiles .bh-banner__text { max-width: 50%; }
  .bh-best__row { grid-template-columns: 1fr; gap: 26px; }
  .bh-best__row--flip > .bh-banner { order: 0; }
  .bh-best__row > .bh-banner { order: 0; }
  .bh-best__row > .bh-banner { min-height: 320px; }
  .bh-best__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .bh-rail__track { grid-auto-columns: calc((100% - 24px) / 2); gap: 24px; }
  .bh-rail--cards .bh-rail__track { grid-auto-columns: calc((100% - 2 * 20px) / 3); gap: 20px; }
  .bh-feature__book { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 32px; }
  .bh-feature__title { font-size: 1.875rem; }
  .bh-rcards { grid-template-columns: 1fr 1fr; }
  .bh-rcards > :nth-child(3) { display: none; }
  .bh-posts { grid-template-columns: 1fr 1fr; }
  .bh-posts:not(.bh-posts--blog) > :nth-child(3) { display: none; }
  .bh-post--lead { grid-template-columns: 1fr; }
  .bh-post--lead .bh-post__media { aspect-ratio: 16 / 9; }
  .bh-section--banner { padding-block: 56px; }
  /* في الجهاز اللوحيّ: صورة الشريحة وصورة بانر العرض فوق نصّهما، لا خلفه */
  .bh-slide { flex-direction: column; align-items: stretch; min-height: 0; }
  .bh-slide__img { position: static; z-index: auto; height: auto; aspect-ratio: 21 / 9; object-position: 60% center; }
  .bh-slide .bh-container { justify-content: flex-start; padding-block: 24px 56px; }
  .bh-hero .bh-dots { bottom: 22px; width: auto; inset-inline: 0; justify-content: center; }
  .bh-banner--offer { flex-direction: column; align-items: stretch; padding: 0; min-height: 0 !important; }
  .bh-banner--offer .bh-banner__img { position: static; z-index: auto; height: auto; aspect-ratio: 16 / 7; object-position: left center; }
  .bh-banner--offer .bh-banner__text { max-width: none; padding: 24px 28px 30px; }
  .bh-banner { padding: 32px; }
  .bh-tiles { grid-auto-flow: column; }
  .bh-tiles .bh-banner { min-height: 230px; padding: 24px 22px; }
  .bh-tiles .bh-banner__text { max-width: 64%; }
  .bh-tiles .bh-banner__title { font-size: 1.25rem; }
  .bh-tiles .bh-banner__lead { display: none; }
  .bh-banner__text { max-width: 62%; }
  .bh-footer__grid { grid-template-columns: 1fr 1fr; }
  .bh-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .bh-section { padding-block: 52px; }
  .bh-grid { --bh-cols: 2; gap: 26px 14px; }
  .bh-title h2, .bh-title h1 { font-size: 1.75rem; }
  .bh-title { margin-bottom: 30px; }
  .bh-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--bh-gutter-l)) calc(-1 * var(--bh-gutter-r)); padding-inline: var(--bh-gutter-l) var(--bh-gutter-r); }
  .bh-tabs::-webkit-scrollbar { display: none; }
  .bh-tabs button { flex: none; }
  .bh-card__media > .bh-cover, .bh-best__grid .bh-card__media > .bh-cover { margin: 16px 16% 12px; }
  .bh-card__add { min-height: 40px; font-size: .8125rem; gap: 4px; }
  .bh-card__add .bh-icon { width: 15px; height: 15px; }
  .bh-card__wish, .bh-card__quick { width: 34px; height: 34px; inset-inline-end: 6px; }
  .bh-card__wish { top: 6px; }
  .bh-card__quick { top: 46px; }
  .bh-card__title { font-size: var(--bh-fs-md); }
  .bh-type { width: 26px; height: 26px; bottom: 6px; inset-inline-start: 6px; }
  .bh-type .bh-icon { width: 13px; height: 13px; }
  .bh-hcard { grid-template-columns: 86px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .bh-fcard { grid-template-columns: 86px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .bh-brand img { width: 40px; height: 40px; border-radius: 12px; }
  .bh-brand__name { font-size: 1.25rem; }
  .bh-brand__tag { display: none; }
  .bh-topbar .bh-container { justify-content: center; }
  .bh-topbar__end { display: none; }
  .bh-hide-sm, .bh-actions__cart b { display: none; }
  .bh-actions { gap: 18px; }
  .bh-hero { background: var(--bh-soft); }
  .bh-slide { flex-direction: column; align-items: stretch; min-height: 0; }
  .bh-slide__img { position: static; z-index: auto; height: auto; aspect-ratio: 16 / 9; object-position: 64% center; }
  .bh-slide .bh-container { justify-content: flex-start; padding-block: 22px 52px; }
  .bh-slide__title { font-size: 2rem; }
  .bh-slide__lead { font-size: 1rem; }
  .bh-hero .bh-dots { bottom: 20px; width: auto; inset-inline: 0; justify-content: center; }
  .bh-banner { flex-direction: column; align-items: stretch; padding: 0; min-height: 0; border-radius: var(--bh-r-md); }
  .bh-banner__img { position: static; z-index: auto; height: auto; aspect-ratio: 16 / 10; object-position: left center; }
  .bh-banner__text { max-width: none; padding: 20px 20px 24px; }
  .bh-banner__title { font-size: 1.5rem; }
  .bh-tiles { grid-auto-columns: 84%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 14px var(--bh-gutter-r) 2px var(--bh-gutter-l); scroll-padding-inline: var(--bh-gutter-l); }
  .bh-tiles::-webkit-scrollbar { display: none; }
  .bh-tiles .bh-banner { scroll-snap-align: start; flex-direction: row; align-items: flex-end; min-height: 176px; padding: 18px; }
  .bh-tiles .bh-banner__img { position: absolute; inset: 0; z-index: -1; height: 100%; aspect-ratio: auto; object-position: left bottom; }
  .bh-tiles .bh-banner__text { max-width: 66%; padding: 0; gap: 6px; }
  .bh-tiles .bh-banner__title { font-size: 1.1875rem; }
  .bh-best__row > .bh-banner { order: 2; flex-direction: row; align-items: center; min-height: 210px; padding: 20px; }
  .bh-best__row > .bh-banner .bh-banner__img { position: absolute; inset: 0; z-index: -1; height: 100%; aspect-ratio: auto; object-position: center; }
  .bh-best__row > .bh-banner .bh-banner__text { padding: 0; }
  .bh-best__row--flip > .bh-banner { order: 2; }
  .bh-banner--center .bh-banner__text { max-width: none; }
  .bh-best { gap: 36px; }
  .bh-best__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .bh-circles { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 30%; overflow-x: auto; scrollbar-width: none; gap: 14px; margin-inline: calc(-1 * var(--bh-gutter-l)) calc(-1 * var(--bh-gutter-r)); padding-inline: var(--bh-gutter-l) var(--bh-gutter-r); }
  .bh-circles::-webkit-scrollbar { display: none; }
  .bh-circle__name { font-size: 1rem; }
  .bh-ncard { grid-template-columns: 116px minmax(0, 1fr); }
  .bh-ncard__media { padding: 18px 0; }
  .bh-ncard__media .bh-cover { width: 80px; }
  .bh-ncard__body { padding: 16px; gap: 4px; }
  .bh-ncard__title { font-size: 1.0625rem; }
  .bh-ncard .bh-price { flex-wrap: nowrap; justify-content: flex-start; }
  .bh-ncard .bh-price__now { font-size: 1.0625rem; }
  .bh-authors { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scrollbar-width: none; gap: 14px; }
  .bh-authors::-webkit-scrollbar { display: none; }
  .bh-authors > :nth-child(n+4) { display: grid; }
  .bh-recent { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .bh-recent > :nth-child(n+5) { display: none; }
  .bh-recent a { padding: 10px; }
  .bh-featured { grid-template-columns: 1fr; }
  .bh-trust__list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; gap: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; padding-block: 14px; margin-inline: calc(-1 * var(--bh-gutter-l)) calc(-1 * var(--bh-gutter-r)); padding-inline: var(--bh-gutter-l) var(--bh-gutter-r); }
  .bh-trust__list::-webkit-scrollbar { display: none; }
  .bh-trust__list li { scroll-snap-align: start; grid-template-columns: 42px minmax(0, 1fr); column-gap: 10px; }
  .bh-trust__list .bh-feature__icon { width: 42px; height: 42px; box-shadow: none; }
  .bh-trust__list .bh-feature__icon .bh-icon { width: 20px; height: 20px; }
  .bh-trust__list b { font-size: var(--bh-fs-sm); }
  .bh-trust__list small { -webkit-line-clamp: 1; }
  .bh-rail__track, .bh-rail--cards .bh-rail__track { grid-auto-columns: 78%; gap: 14px; margin-inline: calc(-1 * var(--bh-gutter-l)) calc(-1 * var(--bh-gutter-r)); padding-inline: var(--bh-gutter-l) var(--bh-gutter-r); scroll-padding-inline: var(--bh-gutter-l); }
  .bh-rail--cards .bh-rail__track { grid-auto-columns: 46%; }
  .bh-rail__btn { display: none; }
  .bh-section--banner { padding-block: 40px; }
  .bh-feature__book { grid-template-columns: 1fr; gap: 10px; }
  .bh-feature__media { padding: 8px 0 18px; }
  .bh-feature__disc { width: 230px; }
  .bh-feature__media .bh-cover { width: 150px; }
  .bh-feature__title { font-size: 1.625rem; }
  .bh-feature__desc p + p { display: none; }
  .bh-rcards, .bh-posts, .bh-posts--blog { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; gap: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--bh-gutter-l)) calc(-1 * var(--bh-gutter-r)); padding: 22px var(--bh-gutter-r) 6px var(--bh-gutter-l); scroll-padding-inline: var(--bh-gutter-l); }
  .bh-posts--blog { grid-auto-flow: row; grid-template-columns: 1fr; overflow: visible; margin: 0; padding: 0; }
  .bh-rcards::-webkit-scrollbar, .bh-posts::-webkit-scrollbar { display: none; }
  .bh-rcards > *, .bh-posts > * { scroll-snap-align: start; }
  .bh-rcards > :nth-child(3), .bh-posts:not(.bh-posts--blog) > :nth-child(3) { display: grid; }
  .bh-post--lead .bh-post__body { padding: 20px 22px 22px; }
  .bh-post--lead .bh-post__title { font-size: 1.375rem; }
  .bh-grid.is-list .bh-card { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 10px; }
  .bh-view { display: none; }
  .bh-format { min-width: 0; flex: 1 1 90px; grid-template-columns: 1fr; padding: 8px 10px; text-align: center; }
  .bh-format .bh-type { display: none; }
  .bh-format small { white-space: nowrap; }
  .bh-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px 18px; padding-block: 46px 30px; }
  .bh-footer__sub { grid-column: 1 / -1; }
  
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .bh-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    background: var(--store-bg); border-top: 3px solid var(--store-primary); box-shadow: 0 -4px 20px rgba(20, 28, 38, .08);
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  }
  .bh-tabbar a, .bh-tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; background: none; border: 0; font-size: .75rem; font-weight: 600; color: var(--store-text); }
  .bh-tabbar__icon { position: relative; display: inline-grid; }
  .bh-tabbar [aria-current="page"] { color: var(--store-primary-dark); font-weight: 800; }
  .bh-tabbar [aria-current="page"] .bh-tabbar__icon::after { content: ""; position: absolute; inset: -4px -10px; z-index: -1; border-radius: var(--bh-r-full); background: var(--store-primary); }
  .bh-tabbar [aria-current="page"] .bh-tabbar__icon { isolation: isolate; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* خيارات الإظهار (الملحق، البند 3) */
body[data-show-trust-bar="false"] .bh-trust-section { display: none; }

body[data-show-reviews="false"] .bh-reviews-sec { display: none; }
/* «شاهدتَه مؤخّرًا» يختفي قسمه كلّه إن لم يتصفّح الزائر شيئًا بعد */
section:has(> .bh-container > [data-slot="recent.items"]:empty) { display: none; }

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

/* شريط الشحن المجّانيّ: يختفي موضعه بلا فراغ حين يُخفيه theme.js */
[data-slot="cart.free_shipping_left"][hidden] { display: none !important; }

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