/* ==========================================================================
   علاجات البشرة والكوسمتيكا — الموقع الرسمي
   الهوية: عاجي دافئ، بنّي إسبريسو، برونزي هادئ، كحلي للّمسات العلمية.
   الألوان والخط مأخوذة من غلاف الكتاب نفسه.
   ========================================================================== */

/* IBM Plex Sans Arabic: خط غلاف الكتاب وعناوينه نفسه. ثلاثة أوزان فقط (400، 600، 700). */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/plex-arabic-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/plex-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/plex-arabic-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/plex-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/plex-arabic-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('../fonts/plex-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #F6F1E7;
  --sand: #ECE5D8;
  --panel: #E1D9C6;
  --paper: #FCFAF5;
  --ink: #33211A;
  --ink-2: #5E4A3F;
  --bronze: #987840;
  --bronze-ink: #6F5426;
  --navy: #1E3350;
  --rule: rgba(51, 33, 26, 0.18);
  --rule-strong: rgba(51, 33, 26, 0.42);
  --danger: #8A2B1C;
  --on-ink: #F3ECDF;
  --on-ink-2: #CFC3B0;

  --display: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;

  --wrap: 1120px;
  --gutter: 20px;
  --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 0.22em; }
h1, h2, h3, p, dl, dd, ol, ul, figure, blockquote, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius);
}
.skip:focus { top: 12px; }

/* ---------- الطباعة ---------- */

h1 {
  font-size: clamp(2rem, 8.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.25;
}
/* العنوان بلونَي الغلاف: السطر الثاني برونزي كما في الكتاب المطبوع. */
h1 span { display: block; }
h1 .title-2 { color: var(--bronze); }
h2 {
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
}

.prose {
  font-size: 1.0625rem;
  line-height: 1.9;
  max-width: 60ch;
}
.prose + .prose { margin-top: 0.9em; }
.prose-lead { font-size: 1.25rem; line-height: 1.8; }

/* ---------- الأزرار ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.btn:hover { background: #20130E; }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: rgba(51, 33, 26, 0.07); }
.btn-light { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
.btn-light:hover { background: #FFFFFF; }
.btn[aria-busy='true'] { opacity: 0.65; cursor: progress; }

.link-button {
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  cursor: pointer;
}

/* ---------- الترويسة ---------- */

.site-header { border-bottom: 1px solid var(--rule); background: var(--bg); }
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand, .footer-brand {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze-ink);
  text-decoration: none;
}
.header-nav, .site-header .btn { display: none; }
/* رابط واتساب ظاهر في الترويسة على كل المقاسات: لمن يفضّل أن يسأل قبل أن يطلب. */
.header-wa {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header-wa:hover span { text-decoration: underline; }
.header-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 8px 4px;
}
.header-nav a:hover { text-decoration: underline; }

/* ---------- 1. الكتاب ---------- */

/* الجوال: العنوان والغلاف جنبًا إلى جنب ليظهر زر الطلب والسعر في الشاشة الأولى. */
.hero { padding-block: 24px 44px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(40%, 280px));
  column-gap: 18px;
  align-items: center;
}
.hero-text { display: contents; }
.hero-head { grid-column: 1; grid-row: 1; min-width: 0; }
.hero-cover { grid-column: 2; grid-row: 1; }
.hero-lede, .buy { grid-column: 1 / -1; }
.hero-head h1 { font-size: clamp(1.4rem, 6.5vw, 2.6rem); }
.hero-cover img {
  width: 100%;
  border-radius: 2px;
  box-shadow:
    0 1px 1px rgba(51, 33, 26, 0.14),
    0 12px 26px -10px rgba(51, 33, 26, 0.38),
    0 34px 54px -32px rgba(51, 33, 26, 0.42);
}
.hero-sub { margin-top: 8px; font-size: 1rem; line-height: 1.6; color: var(--ink-2); }
.hero-author { margin-top: 4px; font-weight: 600; color: var(--bronze-ink); }
.hero-lede {
  margin-top: 18px;
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 32em;
}

.buy { margin-top: 22px; }
.buy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.buy-actions .btn { flex: 1 1 150px; padding-inline: 16px; }
.buy-price {
  margin-top: 16px;
  min-height: 3.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}
.price-now {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
/* inline-block يفصل الرمز عن الرقم في ترتيب الاتجاه، فيظهر ₪ بعد الرقم كما في بقية النصوص. */
.cur { display: inline-block; font-size: 0.62em; font-weight: 600; margin-inline-start: 0.25em; }
.price-note { font-size: 0.9375rem; color: var(--ink-2); }

/* ---------- الأقسام ---------- */

.band { padding-block: clamp(52px, 9vw, 92px); }
.band-sand { background: var(--sand); }
.band-rule { border-top: 1px solid var(--rule); }
.band-ink { background: var(--ink); color: var(--on-ink); }
.section-head { margin-bottom: 30px; }
.section-head p { margin-top: 8px; color: var(--ink-2); max-width: 52ch; }
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 24px;
}
.section-head-row > div { flex: 1 1 320px; min-width: 0; }

/* ---------- 2. لماذا هذا الكتاب ---------- */

.why-grid { display: grid; gap: 34px; }
.why-main h2 { margin-bottom: 16px; }
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-inline-start: 1px solid var(--rule);
}
.stats div {
  display: flex;
  flex-direction: column-reverse;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--rule);
  border-inline-end: 1px solid var(--rule);
}
.stats dd {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bronze-ink);
  font-variant-numeric: tabular-nums;
}
.stats dt { font-size: 0.9375rem; color: var(--ink-2); }

.trio { display: grid; gap: 22px; }
.trio li { padding-top: 16px; border-top: 2px solid var(--ink); }
.trio p { margin-top: 4px; color: var(--ink-2); }

/* ---------- 3. لمن هذا الكتاب ---------- */

.audience { display: grid; gap: 12px; }
.audience li {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.audience p { margin-top: 6px; color: var(--ink-2); }

.howto { margin-top: 32px; }
.steps {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
}
.steps li::before {
  content: counter(step);
  flex: 0 0 1.9em;
  height: 1.9em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-size: 0.875rem;
  color: var(--bronze-ink);
  font-variant-numeric: tabular-nums;
}
.limits {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------- 4. ماذا في الكتاب ---------- */

.parts { display: grid; gap: 12px; align-items: start; }
.part {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.part summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 14px;
  align-items: baseline;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}
.part summary::-webkit-details-marker { display: none; }
.part-no { font-size: 0.8125rem; font-weight: 600; color: var(--bronze-ink); }
.part-range {
  grid-row: 1;
  grid-column: 2;
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.part-range::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-start: 10px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}
.part[open] .part-range::after { transform: translateY(1px) rotate(-135deg); }
.part-title { grid-column: 1 / -1; font-size: 1.125rem; font-weight: 600; line-height: 1.5; }
.part-desc { grid-column: 1 / -1; font-size: 0.9375rem; color: var(--ink-2); line-height: 1.65; }

.toc-list { padding: 4px 20px 16px; border-top: 1px solid var(--rule); }
.toc-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0 0;
  line-height: 1.7;
}
.toc-n {
  flex: 0 0 1.7em;
  font-size: 0.9375rem;
  color: var(--bronze-ink);
  font-variant-numeric: tabular-nums;
}
.toc-l {
  flex: 1 1 24px;
  min-width: 16px;
  border-bottom: 1px dotted var(--rule-strong);
  transform: translateY(-0.3em);
}
.toc-p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.appendices { margin-top: 20px; color: var(--ink-2); font-size: 0.9375rem; }
.appendices strong { color: var(--ink); font-weight: 600; }

/* فتح وإغلاق هادئ للأقسام القابلة للطي حيث يدعمه المتصفح */
details::details-content {
  height: 0;
  overflow: clip;
  transition: height 0.26s var(--ease), content-visibility 0.26s allow-discrete;
}
details[open]::details-content { height: auto; }

/* ---------- 5. شاهد داخل الكتاب ---------- */

.pages-nav { display: none; gap: 8px; }
.pages-nav button {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.pages-nav button:hover { background: rgba(51, 33, 26, 0.07); }

.pages {
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--edge);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.pages-track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding: 6px var(--edge) 22px;
}
.pages-track li { scroll-snap-align: start; }
.page {
  display: block;
  width: min(68vw, 290px);
  padding: 0;
  background: none;
  border: 0;
  text-align: start;
  cursor: zoom-in;
}
.page img {
  width: 100%;
  background: var(--paper);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(51, 33, 26, 0.2), 0 12px 22px -14px rgba(51, 33, 26, 0.45);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.page-cap { display: block; margin-top: 12px; }
.page-title { display: block; font-weight: 600; font-size: 0.9375rem; line-height: 1.5; }
.page-no { display: block; font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 6–8. أشكال حقيقية من الكتاب ---------- */

.split-figure { display: grid; gap: 24px; }
.split-figure h2 { margin-bottom: 14px; }
.sf-body .points { margin-top: 0; }
#science h2 { color: var(--navy); }

.points { margin-top: 20px; display: grid; gap: 12px; max-width: 60ch; }
.points li {
  position: relative;
  padding-inline-start: 20px;
  color: var(--ink-2);
  line-height: 1.75;
}
.points li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.8em;
  width: 9px;
  height: 1.5px;
  background: var(--bronze);
}
.points strong { color: var(--ink); font-weight: 600; }
.points + .btn { margin-top: 24px; }

.figure-btn {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: zoom-in;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(51, 33, 26, 0.12), 0 16px 28px -20px rgba(51, 33, 26, 0.4);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.figure-btn img { width: 100%; }
.figure figcaption { margin-top: 10px; font-size: 0.875rem; color: var(--ink-2); line-height: 1.6; }
.figure figcaption strong { display: block; color: var(--ink); font-size: 1rem; font-weight: 600; }

.examples { display: grid; gap: 28px; align-items: start; }
.also { margin-top: 28px; color: var(--ink-2); max-width: 62ch; }
.also strong { color: var(--ink); font-weight: 600; }

.pull {
  margin-top: 24px;
  padding-inline-start: 18px;
  border-inline-start: 3px solid var(--bronze);
  max-width: 34em;
}
.pull p { font-size: 1.25rem; line-height: 1.8; }
.pull footer { margin-top: 6px; font-size: 0.875rem; color: var(--ink-2); }

/* ---------- 9. المعاينة الكاملة ---------- */

.preview-row { display: grid; gap: 22px; align-items: center; }
.preview-row h2 { color: var(--on-ink); }
.preview-row p { margin-top: 8px; color: var(--on-ink-2); max-width: 52ch; }
.preview-row .preview-note { font-size: 0.875rem; }
.band-ink :focus-visible { outline-color: var(--on-ink); }

/* ---------- 10. بيانات الكتاب ---------- */

.split { display: grid; gap: 22px; }
.book-photo { margin-top: 18px; max-width: 300px; }
.book-photo img { width: 100%; height: auto; border-radius: 3px; }
.book-photo figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--ink-2); }
.specs { border-top: 1px solid var(--rule-strong); }
.specs div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.specs dt { color: var(--ink-2); font-size: 0.9375rem; }
.specs dd { font-weight: 600; }

/* ---------- 11. المؤلف ---------- */

.author-grid { display: grid; gap: 22px; }
.author-photo { width: 132px; border-radius: var(--radius); }
.author-name { margin-top: 10px; font-size: 1.375rem; font-weight: 600; }
.author-creds { color: var(--bronze-ink); font-weight: 600; margin-bottom: 14px; }

/* ---------- 12. الطلب ---------- */

.band-order { border-top: 1px solid var(--rule); }
.order { display: grid; gap: 28px; }
.field-group + .field-group { margin-top: 30px; }
.field-group > legend {
  float: none;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 50px;
  height: 50px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.qty-btn:disabled { opacity: 0.4; cursor: default; }
.qty-val {
  min-width: 56px;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.choices { display: grid; gap: 10px; }
.choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 4px 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { margin: 0.42em 0 0; width: 18px; height: 18px; accent-color: var(--ink); }
.choice-label { display: block; font-weight: 600; }
.choice-note { display: block; font-size: 0.875rem; color: var(--ink-2); line-height: 1.6; }
.choice-end { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.field + .field, .field + .field-row, .field-row + .field { margin-top: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.field-row .field + .field { margin-top: 0; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9375rem; }
.optional { font-weight: 400; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.5;
}
.field textarea { resize: vertical; }
.field input[dir='ltr'] { text-align: right; }
.field input[aria-invalid='true'] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.error { margin-top: 6px; color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.error-form { margin: 0 0 14px; }
.hint { margin-top: 10px; font-size: 0.875rem; color: var(--ink-2); line-height: 1.65; }
.note, .notice {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.notice { margin: 0 0 14px; border-inline-start: 3px solid var(--navy); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.order-summary, .confirm {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.order-summary h3 { margin-bottom: 12px; }
.sum { margin-bottom: 18px; }
.sum div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.sum dt { color: var(--ink-2); }
.sum dd { font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; }
.sum .sum-total { border-bottom: 0; padding-top: 12px; }
.sum .sum-total dt { color: var(--ink); font-weight: 600; }
.sum .sum-total dd { font-size: 1.375rem; font-weight: 700; }
.support { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 0.9375rem; }

.confirm { max-width: 640px; }
.confirm h3 { font-size: 1.5rem; margin-bottom: 12px; }
.confirm-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8em;
}
.confirm .prose { margin-bottom: 18px; }
.confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.confirm-actions [hidden] { display: none; }

/* خطوة التحويل: إطار أزرق داكن هادئ يميّزها عن ملخّص الطلب لأنها ما بقي على المشتري. */
.confirm-bank {
  margin: 0 0 18px;
  padding: 16px 16px 18px;
  border: 1px solid var(--navy);
  border-inline-start-width: 4px;
  border-radius: var(--radius);
  background: var(--bg);
}
.confirm-bank h4 { font-size: 1.0625rem; color: var(--navy); margin-bottom: 6px; }
.confirm-bank p { margin-bottom: 10px; }
.confirm-bank .sum { margin-bottom: 14px; }
.confirm-bank .btn { width: 100%; }
.copyable { user-select: all; -webkit-user-select: all; letter-spacing: 0.04em; }

/* ---------- 13. طلب كمية ---------- */

.bulk-grid { display: grid; gap: 22px; align-items: start; }
.bulk-grid h2 { margin-bottom: 10px; }
.bulk > summary { list-style: none; width: 100%; }
.bulk > summary::-webkit-details-marker { display: none; }
.bulk[open] > summary { display: none; }
.bulk-form {
  padding: 22px 20px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}
.bulk-form .btn { margin-top: 18px; width: 100%; }
.bulk-form .notice, .bulk-form .error-form { margin: 16px 0 0; }

/* ---------- 14. أسئلة شائعة ---------- */

.faq { border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.6;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  flex: 0 0 auto;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--bronze-ink);
}
.faq details[open] summary::after { content: '−'; }
.faq details p {
  padding-bottom: 18px;
  line-height: 1.9;
  max-width: 60ch;
}

/* ---------- 15. الخاتمة ---------- */

.final-row { display: grid; gap: 22px; align-items: center; }
.final-row p { margin-top: 8px; color: var(--ink-2); max-width: 48ch; }
.final-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.final-actions .btn { flex: 1 1 150px; padding-inline: 16px; }

/* ---------- التذييل ---------- */

.site-footer {
  background: var(--ink);
  color: #E9E1D2;
  /* مساحة إضافية أسفل التذييل بقدر شريط الطلب الثابت على الجوال */
  padding-block: 40px calc(40px + 72px + env(safe-area-inset-bottom, 0px));
  font-size: 0.9375rem;
}
.site-footer a { color: inherit; }
.site-footer-short { padding-block: 28px; }
.footer-grid { display: grid; gap: 22px; }
.footer-brand { color: #C9AE7C; margin-bottom: 8px; }
.footer-links li + li { margin-top: 6px; }
.footer-copy { color: #BDB1A0; font-size: 0.8125rem; }

/* ---------- شريط الطلب على الجوال ---------- */

.buybar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--rule-strong);
  transition: transform 0.28s var(--ease), opacity 0.28s ease;
}
.buybar.is-hidden { transform: translateY(110%); opacity: 0; }
.buybar-price { line-height: 1.35; }
.buybar-price strong { display: block; font-size: 1.1875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.buybar-price > span { display: block; font-size: 0.78rem; color: var(--ink-2); }

/* ---------- عارض الصفحات ---------- */

.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #241710;
  color: var(--on-ink);
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(20, 12, 8, 0.7); }
.viewer-bar, .viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}
.viewer-nav { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.viewer-cap { font-size: 0.9375rem; line-height: 1.5; }
.viewer-count { font-size: 0.875rem; color: var(--on-ink-2); font-variant-numeric: tabular-nums; }
.viewer-btn {
  min-height: 46px;
  min-width: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: inherit;
  border: 1px solid rgba(243, 236, 223, 0.4);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.viewer-btn:hover { background: rgba(243, 236, 223, 0.1); }
.viewer-btn:disabled { opacity: 0.35; cursor: default; }
.viewer :focus-visible { outline-color: var(--on-ink); }
.viewer-stage {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 8px;
}
.viewer-stage img {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  background: var(--paper);
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}
.viewer-stage img.is-loading { opacity: 0; }
.viewer-stage.is-zoomed img { width: 190%; max-width: none; cursor: zoom-out; }

/* ==========================================================================
   الحركة: هادئة وقصيرة، وتُلغى كلها مع prefers-reduced-motion.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  /* دخول الشاشة الأولى: الكتاب وحده يستقرّ في مكانه مرة واحدة. لا شفافية من الصفر:
     النصوص والغلاف مرئية من أول إطار، فلا يتأخر ظهور المحتوى (FCP/LCP).
     backwards وليس both: بعد انتهاء الحركة يعود التحويل لقواعد الصفحة، فيعمل تأثير المرور على الغلاف. */
  @keyframes book-settle {
    from { transform: translateY(18px) scale(0.975); }
    to { transform: none; }
  }
  .hero-cover img { animation: book-settle 1.1s var(--ease) 0.05s backwards; }

  /* إبراز قصير للمجموع حين يتغيّر بفعل المشتري: يؤكد له أن السعر تحدّث. */
  @keyframes total-update {
    from { background-color: rgba(152, 120, 64, 0.2); }
    to { background-color: rgba(152, 120, 64, 0); }
  }
  .sum .sum-total.is-updated { animation: total-update 1s ease-out; border-radius: 4px; }

  /* ظهور الأقسام عند التمرير. يعمل فقط بعد أن يضيف السكربت has-motion، فالصفحة كاملة بدونه. */
  .has-motion .reveal {
    transition: opacity 0.6s ease, transform 0.6s var(--ease);
  }
  .has-motion .reveal:not(.is-in) { opacity: 0; transform: translateY(14px); }
  .has-motion .stagger > .reveal:nth-child(2) { transition-delay: 0.07s; }
  .has-motion .stagger > .reveal:nth-child(3) { transition-delay: 0.14s; }
  .has-motion .stagger > .reveal:nth-child(4) { transition-delay: 0.07s; }
  .has-motion .stagger > .reveal:nth-child(5) { transition-delay: 0.14s; }
  .has-motion .stagger > .reveal:nth-child(6) { transition-delay: 0.21s; }

  @keyframes viewer-in {
    from { opacity: 0; transform: scale(0.985); }
    to { opacity: 1; transform: none; }
  }
  .viewer[open] { animation: viewer-in 0.22s var(--ease); }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .hero-cover img { transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
  .hero-cover img:hover {
    transform: translateY(-4px) rotate(-0.4deg);
    box-shadow:
      0 1px 1px rgba(51, 33, 26, 0.14),
      0 18px 34px -12px rgba(51, 33, 26, 0.4),
      0 44px 64px -34px rgba(51, 33, 26, 0.46);
  }
  .page:hover img, .figure-btn:hover { transform: translateY(-3px); }
  .figure-btn:hover { box-shadow: 0 1px 2px rgba(51, 33, 26, 0.14), 0 22px 34px -20px rgba(51, 33, 26, 0.46); }
}

/* الطباعة وحفظ PDF: كل المحتوى ظاهر حتى الأقسام التي لم يُمرَّر إليها بعد، وبلا شريط الطلب. */
@media print {
  .has-motion .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .buybar { display: none !important; }
}

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

/* ==========================================================================
   الشاشات الأوسع
   ========================================================================== */

@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 760px) {
  :root { --gutter: 32px; }
  .site-footer { padding-block: 40px; }
  .buybar { display: none; }
  .site-header .btn { display: inline-flex; }

  .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
  .audience { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .examples { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

  .author-grid { grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
  .author-photo { width: 220px; }
  .author-grid h2 { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
  .author-name { margin-top: 2px; font-size: 1.75rem; }

  .preview-row, .final-row { grid-template-columns: 1fr auto; gap: 40px; }
  .final-actions .btn { flex: 0 0 auto; min-width: 190px; }
  .buy-actions .btn { flex: 0 0 auto; min-width: 190px; }
  .bulk > summary { width: auto; }
  .footer-grid { grid-template-columns: 1.4fr 1fr; }
  .footer-copy { grid-column: 1 / -1; }
  .viewer-stage.is-zoomed img { width: 1400px; }
}

@media (min-width: 900px) {
  .site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
  html { scroll-padding-top: 84px; }
  .header-nav { display: flex; gap: 22px; margin-inline: auto 12px; }
  .header-wa { margin-inline-start: 0; }

  .hero { padding-block: 64px 84px; }
  .hero-grid { grid-template-columns: 1fr 380px; column-gap: 72px; }
  .hero-text { display: block; grid-column: 1; grid-row: 1; }
  .hero-head h1 { font-size: clamp(2.6rem, 4.6vw, 3.6rem); }
  .hero-sub { font-size: 1.125rem; }
  .buy { margin-top: 30px; }
  .price-now { font-size: 2rem; }

  .why-grid { grid-template-columns: 1.3fr 1fr; gap: 48px 72px; align-items: start; }
  .why-grid .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
  .why-grid .trio { grid-column: 1 / -1; }
  /* النص في عمود والشكل في العمود المقابل على امتداد الصفّين */
  .split-figure { grid-template-columns: 1fr 1.05fr; column-gap: 64px; row-gap: 22px; }
  .sf-head { grid-column: 1; grid-row: 1; align-self: end; }
  .sf-body { grid-column: 1; grid-row: 2; align-self: start; }
  .sf-fig { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .split-figure-flip { grid-template-columns: 1.05fr 1fr; }
  .split-figure-flip .sf-head, .split-figure-flip .sf-body { grid-column: 2; }
  .split-figure-flip .sf-fig { grid-column: 1; }
  .split { grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
  .bulk-grid { grid-template-columns: 1fr 440px; gap: 56px; }
  .order { grid-template-columns: 1fr 380px; gap: 56px; align-items: start; }
  .order-summary { position: sticky; top: 92px; }
  .page { width: 300px; }
}

@media (min-width: 760px) and (hover: hover) and (pointer: fine) {
  .pages-nav { display: flex; }
}

/* ==========================================================================
   صفحة شروط الشراء والخصوصية
   ========================================================================== */

.terms { padding-block: 36px 64px; }
.terms-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); }
.terms h1 { margin-top: 12px; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.terms-lede { margin-top: 8px; color: var(--ink-2); max-width: 60ch; }
.terms-toc { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9375rem; }
.terms section { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--rule); max-width: 66ch; }
.terms h2 { font-size: 1.25rem; margin-bottom: 10px; }
.terms p, .terms li { line-height: 1.9; }
.terms p + p { margin-top: 10px; }
.terms ul { display: grid; gap: 6px; padding-inline-start: 1.2em; list-style: disc; }
.terms ul + p { margin-top: 14px; }
.terms .ltr-value { text-align: right; }
.terms .specs { margin-top: 4px; }
.terms .specs div { grid-template-columns: 9em 1fr; }
.terms-note { margin-top: 12px; padding: 12px 14px; background: var(--sand); border-radius: var(--radius); font-size: 0.9375rem; }
.terms-end { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
