/* Masterman Publications Ltd — site styles */

:root {
  --ink: #151515;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --paper: #faf9f7;
  --surface: #ffffff;
  --line: #e7e5e1;
  --brand: #e30615;
  --brand-dark: #b8050f;
  --brand-soft: #fde8e9;
  --accent: #f5b301;
  --accent-soft: #fff4d6;
  --green: #1f7a4d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(21, 21, 21, 0.08);
  --max: 1160px;
  --serif: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

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

/* ---------- Top bar & header ---------- */

.topbar {
  background: var(--ink);
  color: #c9c9ce;
  font-size: 0.85rem;
}
.topbar .container {
  display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between;
  padding-top: 8px; padding-bottom: 8px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 76px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { height: 40px; width: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 1.22rem; letter-spacing: 0.02em; text-transform: uppercase; }
.brand-sub { font-family: var(--serif); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }

.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav a:hover { background: #f4f4f5; color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-soft); }
.nav .btn { margin-left: 8px; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  width: 44px; height: 44px; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 880px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 2px; }
  .nav a { border-radius: 10px; padding: 12px 14px; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 6px;
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: #fff; color: var(--brand-dark); }
.btn-accent:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-outline { border-color: currentColor; color: var(--brand); background: transparent; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { color: var(--brand-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn svg { width: 18px; height: 18px; }
.nav .btn-primary { color: #fff; padding: 9px 18px; }
.nav .btn-primary:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 80px 0 90px;
  background:
    radial-gradient(circle at 85% 20%, rgba(227, 6, 21, 0.10), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(245, 179, 1, 0.10), transparent 40%);
}
.hero .container { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand-dark); background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { text-transform: uppercase; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-books { position: relative; height: 420px; }
.book-3d {
  position: absolute; width: 190px; height: 260px; border-radius: 4px 12px 12px 4px;
  box-shadow: var(--shadow), inset 10px 0 0 rgba(0,0,0,0.12);
  padding: 22px 18px 18px 26px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
}
.book-3d .b-subject { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.book-3d .b-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 800; line-height: 1.1; }
.book-3d .b-foot { font-size: 0.72rem; opacity: 0.85; }
.book-3d:nth-child(1) { background: #f08a1c; left: 4%; top: 60px; rotate: -8deg; }
.book-3d:nth-child(2) { background: var(--brand); left: 34%; top: 10px; rotate: 3deg; z-index: 2; }
.book-3d:nth-child(3) { background: #1f7a4d; left: 58%; top: 110px; rotate: 10deg; }

@media (max-width: 880px) {
  .hero { padding: 56px 0 64px; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-books { height: 320px; max-width: 460px; }
  .book-3d { width: 150px; height: 210px; }
  .book-3d .b-title { font-size: 1.1rem; }
}

/* ---------- Page header (inner pages) ---------- */

.page-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #f3f1ee, var(--paper)); border-top: 4px solid var(--brand); }
.page-hero p { color: var(--ink-soft); font-size: 1.1rem; max-width: 42em; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Sections ---------- */

.section { padding: 80px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card p { color: var(--ink-soft); margin-bottom: 0; }
.icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 18px;
}
.icon svg { width: 24px; height: 24px; }

/* Stats */
.stats { background: var(--ink); color: #fff; padding: 48px 0; }
.stats .grid { text-align: center; }
.stat-num { font-family: var(--serif); font-size: 2.1rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-num::after { content: ""; display: block; width: 36px; height: 4px; background: var(--brand); margin: 14px auto 0; }
.stat-label { color: #c9c9ce; font-size: 0.95rem; margin-top: 8px; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.check-list { list-style: none; padding: 0; margin: 0 0 1.5em; }
.check-list li { position: relative; padding-left: 32px; margin-bottom: 12px; color: var(--ink-soft); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat;
}

.panel {
  background: var(--brand); color: #fff; border-radius: 20px; padding: 40px;
  position: relative; overflow: hidden;
}
.panel::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.14);
}
.panel h3 { font-size: 1.6rem; }
.panel p { color: #ffe3e5; }

/* ---------- Books ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; align-items: center; }
.filters input[type="search"], .filters select {
  font: inherit; padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); min-width: 0;
}
.filters input[type="search"] { flex: 1 1 260px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 0.88rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; align-items: start; }
@media (max-width: 420px) { .book-grid { grid-template-columns: 1fr; } }
.series {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.series-head {
  background: var(--c, var(--brand)); color: #fff; padding: 18px 22px 18px 30px;
  box-shadow: inset 8px 0 0 rgba(0,0,0,0.18);
}
.series-head h3 { font-size: 1.12rem; margin: 4px 0 0; line-height: 1.25; }
.series-subject { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.series-body { padding: 16px 22px 20px; }
.series-authors { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; margin-bottom: 10px; }
.price-rows { list-style: none; margin: 0 0 16px; padding: 0; }
.price-rows.long { max-height: 460px; overflow-y: auto; padding-right: 6px; }
.price-rows li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 7px 8px; margin: 0 -8px; border-bottom: 1px dashed var(--line); font-size: 0.92rem; border-radius: 6px;
}
.price-rows li.in-order { background: var(--brand-soft); border-bottom-color: transparent; }
.price-rows li:last-child { border-bottom: 0; }
.item-name { color: var(--ink); }
.item-author { display: block; font-size: 0.8rem; color: var(--muted); }
.item-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.catalogue-note {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 28px; font-size: 0.92rem; color: var(--ink-soft);
}
.catalogue-note strong { color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 64px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700;
  font-family: var(--serif); font-size: 1.2rem;
}

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border-radius: 24px; padding: 56px; display: flex; gap: 32px;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cta h2 { margin: 0 0 8px; }
.cta p { color: #ffe3e5; margin: 0; max-width: 36em; }
@media (max-width: 640px) { .cta { padding: 36px 24px; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(227,6,21,0.15); }
.form-note { font-size: 0.85rem; color: var(--muted); }
.form-status { padding: 14px 16px; border-radius: 10px; background: #e6f4ec; color: var(--green); font-weight: 500; display: none; }
.form-status.show { display: block; }

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list .icon { margin: 0; flex: none; }
.contact-list strong { display: block; }
.contact-list span, .contact-list a { color: var(--ink-soft); }

.map-embed { border: 0; width: 100%; height: 320px; border-radius: var(--radius); margin-top: 28px; filter: saturate(0.9); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9c9ce; border-top: 4px solid var(--brand); padding: 64px 0 28px; margin-top: 80px; font-size: 0.95rem; }
.site-footer.flush { margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-family: var(--sans); color: #fff; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: #c9c9ce; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand-sub { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 48px; padding-top: 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: #a1a1aa;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}

/* Downloads strip */
.downloads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 640px) { .downloads { grid-template-columns: 1fr; } }
.download {
  display: flex; gap: 18px; align-items: center; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: 10px; padding: 22px 24px; transition: box-shadow .2s ease;
}
.download:hover { box-shadow: var(--shadow); color: inherit; }
.download .icon { margin: 0; flex: none; }
.download h3 { margin: 0 0 2px; }
.download p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
@media (max-width: 640px) { .stats .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; } .stat-num { font-size: 1.5rem; } }

/* ---------- Ordering ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.stepper .qty-step {
  width: 30px; height: 30px; border: 0; background: #f4f4f5; color: var(--ink); font-size: 1.05rem; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.stepper .qty-step:hover:not(:disabled) { background: var(--brand); color: #fff; }
.stepper .qty-step:disabled { color: #c4c4c8; cursor: default; }
.stepper .qty {
  width: 42px; height: 30px; border: 0; text-align: center; font: inherit; font-weight: 700; color: var(--ink);
  -moz-appearance: textfield; background: #fff;
}
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper.has-qty { border-color: var(--brand); }
.stepper.has-qty .qty { color: var(--brand-dark); }

.order-hint { font-size: 0.92rem; color: var(--ink-soft); margin: -12px 0 20px; }

.order-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  width: min(760px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 12px 12px 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
.order-bar[hidden] { display: none; }
.order-bar-count { font-size: 0.85rem; color: #c9c9ce; display: block; }
.order-bar-total { font-family: var(--serif); font-weight: 800; font-size: 1.2rem; }
.order-bar .btn { flex: none; }
body.has-order-bar { padding-bottom: 90px; }

.nav-order .badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700;
}

.order-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 980px) { .order-layout { grid-template-columns: 1fr; } }
.order-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.order-table th {
  text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 0 8px 10px; border-bottom: 2px solid var(--ink);
}
.order-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.order-table .ol-price, .order-table .ol-total { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-table .ol-total { font-weight: 700; text-align: right; }
.order-table th:nth-child(4) { text-align: right; }
.ol-remove { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; padding: 0 4px; }
.ol-remove:hover { color: var(--brand); }
.order-total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 8px 0; }
.order-total-row strong { font-family: var(--serif); font-size: 1.5rem; white-space: nowrap; }
.discount-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: #fdecee; border-left: 4px solid var(--brand); color: var(--ink); font-size: 0.92rem; line-height: 1.5; }
.discount-note strong { color: var(--brand); }
.order-table .ol-title { width: 45%; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn-whatsapp { background: #1fa855; color: #fff; }
.btn-whatsapp:hover { background: #178a45; color: #fff; }
.order-status { padding: 14px 16px; border-radius: 10px; background: #e6f4ec; color: #14532d; }
.order-status [data-invoice] { display: flex; width: fit-content; margin-top: 12px; padding: 8px 14px; font-size: 0.9rem; background: #fff; }
.invoice-note { margin: 14px 0 0; font-size: 0.92rem; color: var(--muted); }
.invoice-note .h-link { font-weight: 600; padding: 0 0 1px; }
.h-link-btn:disabled { opacity: .6; cursor: progress; }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
  .order-table thead { display: none; }
  .order-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .order-table td { padding: 0; border: 0; }
  .order-table .ol-title { grid-column: 1 / -1; font-weight: 600; width: auto; }
  .order-table .ol-price { color: var(--muted); }
  .order-table .ol-qty { grid-row: 3; }
  .order-table .ol-total { grid-row: 3; align-self: center; }
  .order-table td:last-child { grid-row: 2; grid-column: 2; text-align: right; }
  .order-bar { padding-left: 16px; }
  .order-bar .btn { padding: 10px 14px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Book covers ---------- */
.series-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.series-covers figure { margin: 0; text-align: center; }
.series-covers img {
  width: 100%; height: auto; border-radius: 3px 6px 6px 3px; display: block;
  box-shadow: 0 6px 16px rgba(0,0,0,0.16), inset 4px 0 0 rgba(0,0,0,0.1);
}
.series-covers figcaption { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin-top: 6px; }
.item-thumb {
  display: inline-block; width: 28px; height: auto; vertical-align: middle; margin-right: 10px;
  border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.book-3d.has-img { padding: 0; height: auto; aspect-ratio: 640 / 839; background: none; box-shadow: none; overflow: visible; text-decoration: none; color: inherit; }

.cover-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 32px 24px; }
@media (max-width: 1080px) { .cover-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cover-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; } }
.cover-card { text-decoration: none; color: inherit; display: block; }
.cover-card img {
  width: 100%; height: auto; border-radius: 4px 8px 8px 4px; display: block;
  box-shadow: 0 12px 28px rgba(0,0,0,0.16), inset 6px 0 0 rgba(0,0,0,0.1); transition: transform .2s ease, box-shadow .2s ease;
}
.cover-card:hover img { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(0,0,0,0.22); }
.cover-card h3 { font-size: 1rem; margin: 14px 0 2px; }
.cover-card p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.cover-card .price { display: block; font-weight: 700; color: var(--brand-dark); white-space: nowrap; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .cover-card img { transition: none; } }

/* ---------- Home page animations ---------- */
@keyframes fan-in { from { opacity: 0; rotate: 0deg; translate: 0 60px; scale: .85; } }
@keyframes bob { 50% { translate: 0 -12px; } }
@keyframes rise { from { opacity: 0; translate: 0 24px; } }
@keyframes shelf-scroll { to { transform: translateX(-50%); } }
@keyframes bump { 40% { scale: 1.08; color: var(--brand); } }

.book-3d.has-img {
  animation: fan-in .9s cubic-bezier(.2,.8,.2,1) var(--d, 0s) both, bob 6s ease-in-out calc(var(--d, 0s) + 1s) infinite;
  transition: box-shadow .3s ease;
}
.hero-books:hover .book-3d.has-img { animation-play-state: running, paused; }

.shelf-section { padding: 40px 0 8px; overflow: hidden; }
.shelf-head { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 18px; }
.shelf-head .eyebrow { margin: 0; }
.shelf-link { font-weight: 600; text-decoration: none; }
.shelf {
  overflow: hidden; padding: 12px 0 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.shelf-track { display: flex; gap: 22px; width: max-content; animation: shelf-scroll var(--shelf-duration, 40s) linear infinite; }
.shelf:hover .shelf-track { animation-play-state: paused; }
.shelf-book { flex: none; width: 150px; display: block; transition: transform .3s ease; }
.shelf-book img {
  width: 100%; height: auto; display: block; border-radius: 3px 7px 7px 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.16), inset 5px 0 0 rgba(0,0,0,0.1);
}
.shelf-book:hover { transform: translateY(-8px) rotate(-2deg); }
@media (max-width: 640px) { .shelf-book { width: 110px; } .shelf-track { gap: 14px; } }

/* Place an order */
.order-section .section-head { margin-bottom: 32px; }
.order-steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .order-steps { grid-template-columns: 1fr; } }
.order-steps li {
  display: flex; gap: 16px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; transition-delay: calc(var(--i, 0) * 120ms);
}
.order-steps h3 { margin: 0 0 4px; font-size: 1.05rem; }
.order-steps p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.os-num {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-family: var(--serif); font-weight: 800; font-size: 1.1rem;
}

.quick-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .quick-layout { grid-template-columns: 1fr; } }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.quick-grid.reveal { opacity: 1; transform: none; }
.quick-grid.in .qcard { animation: rise .6s cubic-bezier(.2,.8,.2,1) calc(var(--i, 0) * 70ms) both; }
.qcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.qcard:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.qcard.in-order { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.qcard img { width: 100%; height: auto; border-radius: 3px 6px 6px 3px; box-shadow: 0 6px 14px rgba(0,0,0,0.14); }
.qcard-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding-top: 12px; }
.qcard h3 { font-size: 0.92rem; margin: 0; line-height: 1.3; }
.qcard p { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 0.85rem; margin-top: auto; }
.qcard-level { color: var(--muted); }
.qcard-price { font-weight: 700; white-space: nowrap; }
.qcard .stepper { align-self: stretch; justify-content: space-between; }
.qcard .stepper .qty { flex: 1; }

.quick-summary {
  position: sticky; top: 96px; background: var(--ink); color: #fff; border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.quick-summary h3 { margin: 0; font-size: 1.1rem; }
.qs-count { margin: 0; color: #c9c9ce; font-size: 0.9rem; }
.qs-total { margin: 0 0 6px; font-family: var(--serif); font-weight: 800; font-size: 2rem; display: inline-block; transform-origin: left center; }
.qs-total.bump { animation: bump .4s ease; }
.quick-summary .btn { width: 100%; }
.quick-summary .btn-outline { color: #fff; border-color: rgba(255,255,255,0.4); }
.quick-summary .btn-outline:hover { border-color: #fff; }
.qs-review.is-disabled { opacity: .55; }
.qs-note { margin: 6px 0 0; font-size: 0.85rem; color: #c9c9ce; }
.qs-note a { color: #fff; }
.qs-note svg { width: 15px; height: 15px; vertical-align: -3px; color: #25d366; }

@media (prefers-reduced-motion: reduce) {
  .book-3d.has-img, .quick-grid.in .qcard, .qs-total.bump { animation: none; }
  .shelf-track { animation: none; }
  .shelf { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .shelf-book, .qcard { transition: none; }
}
@media (max-width: 640px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .qcard { padding: 10px; }
  .qcard h3 { font-size: 0.85rem; }
  .qcard p { flex-direction: column; gap: 2px; }
  .quick-summary {
    position: sticky; top: auto; bottom: 12px; z-index: 5;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 14px 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  }
  .quick-summary h3, .quick-summary .btn-outline, .qs-note { display: none; }
  .qs-count { grid-column: 1; grid-row: 1; font-size: 0.8rem; }
  .qs-total { grid-column: 1; grid-row: 2; font-size: 1.35rem; margin: 0; }
  .quick-summary .qs-review { grid-column: 2; grid-row: 1 / span 2; width: auto; padding: 10px 14px; font-size: 0.88rem; }
}
.qcard.is-extra { display: none; }
.quick-grid.show-all .qcard.is-extra { display: flex; }
.quick-more-wrap { text-align: center; margin: 22px 0 0; }
.quick-more-wrap .btn[hidden] { display: none; }

/* Levels banner below the hero */
.levels-banner {
  margin: 0; text-align: center; font-family: var(--serif); font-weight: 800; letter-spacing: -0.01em;
  font-size: clamp(1.25rem, 2.6vw, 2rem); line-height: 1.3; color: #fff;
}
.levels-banner::after { content: ""; display: block; width: 56px; height: 4px; background: var(--brand); margin: 16px auto 0; }

/* Footer social icons */
.site-footer .social { display: flex; gap: 10px; margin-top: 18px; list-style: none; padding: 0; }
.site-footer .social a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,0.08); color: #fff; transition: background .2s ease, transform .2s ease;
}
.site-footer .social a:hover { background: var(--brand); transform: translateY(-2px); text-decoration: none; }
.site-footer .social svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .site-footer .social a { transition: none; } }

/* ---------- Home page: hero facts ---------- */
.hero-facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--ink-soft); font-size: 0.92rem; }
.hero-facts li { position: relative; padding-left: 16px; }
.hero-facts li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.hero-facts strong { color: var(--ink); }

/* ---------- Level cards ---------- */
.levels-section { background: var(--surface); border-top: 1px solid var(--line); }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 980px) { .level-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .level-grid { grid-template-columns: 1fr; } }
.level-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.level-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand-soft); color: inherit; }
.level-card h3 { margin: 18px 0 4px; }
.level-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 14px; }
.level-count { margin-top: auto; font-weight: 700; color: var(--brand-dark); font-size: 0.9rem; }
.level-covers { position: relative; height: 150px; }
.level-covers img, .lc-plain {
  position: absolute; bottom: 0; width: 92px; height: auto; border-radius: 2px 6px 6px 2px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18); transition: transform .3s ease;
  left: calc(var(--k) * 52px); rotate: calc((var(--k) - 1) * 6deg); z-index: calc(3 - var(--k));
}
.lc-plain { height: 122px; background: var(--c); box-shadow: 0 8px 18px rgba(0,0,0,0.18), inset 6px 0 0 rgba(0,0,0,0.15); }
.level-covers.n1 img { left: 40px; rotate: 0deg; }
.level-card:hover .level-covers img, .level-card:hover .lc-plain { transform: translateY(-6px); }

/* ---------- Printing teaser ---------- */
.print-visual { position: relative; height: 340px; max-width: 460px; }
.pv-sheet { position: absolute; width: 58%; aspect-ratio: 3 / 4; border-radius: 6px; box-shadow: 0 18px 40px rgba(0,0,0,0.15); }
.pv-1 { left: 0; top: 30px; background: linear-gradient(160deg, #fff 0 60%, var(--brand-soft) 60%); rotate: -7deg; }
.pv-2 { left: 22%; top: 0; background: var(--brand); rotate: 3deg;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0 2px, transparent 2px 22px); }
.pv-3 { left: 42%; top: 60px; background: var(--ink); rotate: 9deg;
  background-image: linear-gradient(var(--accent), var(--accent)); background-size: 50% 6px; background-repeat: no-repeat; background-position: 18px 26px; }
.pv-badge {
  position: absolute; left: 8%; bottom: 0; display: flex; align-items: center; gap: 10px; z-index: 2;
  background: #fff; border-radius: 999px; padding: 10px 18px 10px 12px; box-shadow: var(--shadow); font-weight: 700;
}
.pv-badge svg { width: 28px; height: 28px; color: var(--brand); }
.print-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .print-list { grid-template-columns: 1fr; } }
.print-list li { display: flex; gap: 10px; align-items: center; color: var(--ink-soft); font-weight: 500; }
.print-list svg { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); }
@media (max-width: 880px) { .print-visual { height: 260px; max-width: 360px; } }

/* ---------- Catalogue: links and synopsis ---------- */
.series-head h3 a { color: #fff; text-decoration: none; }
.series-head h3 a:hover { text-decoration: underline; }
.series-synopsis { font-size: 0.88rem; color: var(--ink-soft); margin: -4px 0 12px; }
.series-synopsis a { font-weight: 600; white-space: nowrap; }
.qcard h3 a { color: inherit; text-decoration: none; }
.qcard h3 a:hover { color: var(--brand-dark); }
.qcard-cover { display: block; }

/* ---------- Book detail page ---------- */
.book-page { padding-top: 40px; }
.book-page .breadcrumb { margin-bottom: 28px; }
.bd-layout { display: grid; grid-template-columns: 380px 1fr; gap: 56px; align-items: start; }
@media (max-width: 980px) { .bd-layout { grid-template-columns: 300px 1fr; gap: 36px; } }
@media (max-width: 720px) { .bd-layout { grid-template-columns: 1fr; } }
.bd-media { position: sticky; top: 100px; }
@media (max-width: 720px) { .bd-media { position: static; max-width: 320px; margin: 0 auto; width: 100%; } }
.bd-cover img, .bd-cover-plain {
  width: 100%; height: auto; display: block; border-radius: 4px 12px 12px 4px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.2), inset 8px 0 0 rgba(0,0,0,0.1);
}
.bd-cover-plain {
  aspect-ratio: 640 / 839; background: var(--c); color: #fff; padding: 28px 24px 24px 34px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.bd-cover-plain .b-subject { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: .85; }
.bd-cover-plain .b-title { font-family: var(--serif); font-weight: 800; font-size: 1.8rem; line-height: 1.1; }
.bd-cover-plain .b-foot { font-size: 0.8rem; opacity: .85; }
.bd-cover-note { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 10px; }
.bd-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.bd-thumb {
  width: 64px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer;
  font: inherit; font-size: 0.7rem; font-weight: 600; color: var(--ink-soft); text-align: center;
}
.bd-thumb img { width: 100%; height: auto; display: block; border-radius: 3px; margin-bottom: 4px; }
.bd-thumb.is-active { border-color: var(--brand); }
.bd-info h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin: 10px 0 8px; }
.bd-authors { font-style: italic; color: var(--ink-soft); }
.bd-price { font-family: var(--serif); font-weight: 800; font-size: 1.5rem; margin: 18px 0 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bd-price span { display: block; font-family: var(--sans); font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.bd-h { font-size: 1.15rem; margin: 0 0 10px; }
.bd-synopsis { color: var(--ink-soft); font-size: 1.02rem; }
.bd-features { margin-top: 18px; }
.bd-order { margin-top: 40px; padding: 28px; }
.bd-order-head p { color: var(--ink-soft); margin-bottom: 14px; }
.bd-order .price-rows { max-width: 640px; }
.bd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; }
.rel-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.rel-card img, .rel-plain { width: 100%; aspect-ratio: 640 / 839; height: auto; object-fit: cover; border-radius: 3px 7px 7px 3px; box-shadow: 0 10px 22px rgba(0,0,0,0.14); transition: transform .25s ease; }
.rel-plain { display: flex; align-items: flex-end; padding: 14px; background: var(--c); color: #fff; font-family: var(--serif); font-weight: 800; font-size: 0.95rem; line-height: 1.2; box-shadow: 0 10px 22px rgba(0,0,0,0.14), inset 5px 0 0 rgba(0,0,0,0.15); }
.rel-card:hover img, .rel-card:hover .rel-plain { transform: translateY(-4px); }
.rel-title { font-weight: 700; font-size: 0.9rem; margin-top: 8px; line-height: 1.3; }
.rel-sub { font-size: 0.8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .level-card, .level-covers img, .lc-plain, .rel-card img, .rel-plain { transition: none; }
}
.bd-order .price-rows.cols { max-width: none; columns: 2; column-gap: 48px; }
.bd-order .price-rows.cols li { break-inside: avoid; }
@media (max-width: 880px) { .bd-order .price-rows.cols { columns: 1; } }
.lc-plain { display: flex; align-items: flex-end; padding: 10px 8px 10px 14px; color: #fff; font-family: var(--serif); font-weight: 800; font-size: 0.66rem; line-height: 1.2; overflow: hidden; }
.related-section[hidden] { display: none; }

/* ---------- Partners ---------- */
.partners-section { border-top: 1px solid var(--line); }
.partners { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: center; }
@media (max-width: 760px) { .partners { grid-template-columns: repeat(2, 1fr); } }
.partners li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; height: 110px; display: grid; place-items: center; padding: 16px; }
.partners img { max-height: 70px; max-width: 100%; width: auto; height: auto; object-fit: contain; }

/* ---------- About ---------- */
.about-story { align-items: start; }
.office-photo { margin: 0 0 20px; }
.office-photo img { width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow); }
.office-photo figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts-grid div { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 16px; }
.facts-grid strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.facts-grid span { font-size: 0.85rem; color: var(--ink-soft); }
.value-tags { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.value-tags li { font-size: 0.8rem; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark); padding: 4px 10px; border-radius: 999px; }
.team-card p { margin-bottom: 12px; }
.team-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.team-head h3 { margin: 0; }
.team-role { margin: 2px 0 0 !important; color: var(--brand-dark) !important; font-weight: 600; font-size: 0.92rem; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--serif); font-weight: 800; font-size: 1.1rem; box-shadow: inset 0 -4px 0 var(--brand); }
.dept-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dept-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
@media (max-width: 520px) { .dept-list, .facts-grid { grid-template-columns: 1fr; } }
.service-blocks .card p { font-size: 0.95rem; }

/* ---------- Teacher's Guides ---------- */
.tg-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tg-jump a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; color: var(--ink); }
.tg-jump a:hover { border-color: var(--brand); color: var(--brand-dark); }
.tg-group { margin-bottom: 44px; scroll-margin-top: 100px; }
.tg-group h2 { font-size: 1.5rem; margin-bottom: 4px; }
.tg-group > p { color: var(--ink-soft); }
.tg-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.tg-list a {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; transition: border-color .2s ease, box-shadow .2s ease;
}
.tg-list a:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--ink); }
.tg-icon { flex: none; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: var(--brand); border-radius: 4px; padding: 6px 6px; }
.tg-name { flex: 1; font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
.tg-size { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.tg-list.compact { grid-template-columns: 1fr; gap: 8px; }
.tg-list.compact a { padding: 9px 12px; }
.bd-guides { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.item-brief { margin-top: 4px; font-size: 0.82rem; color: var(--ink-soft); }
.item-brief summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; }
.item-brief p { margin: 6px 0 2px; }

/* ---------- Hero books: real thickness, page turn, labels ---------- */
.hb-pages {
  position: absolute; top: 2.5%; bottom: 2.5%; right: -9px; width: 12px; border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(90deg, #fffdf8 0 1px, #e7e2d8 1px 2px);
  box-shadow: 3px 4px 10px rgba(0,0,0,0.18);
}
.hb-cover {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 3px 9px 9px 3px; overflow: hidden;
  box-shadow: 0 22px 40px rgba(20,20,20,0.22), 0 4px 10px rgba(0,0,0,0.12);
  transform-origin: left center; transform: perspective(1100px) rotateY(0deg);
  transition: transform .48s cubic-bezier(.45,.05,.55,.95), filter .48s ease, translate .3s ease;
}
.hb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hb-cover::after {   /* spine crease and sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.28) 0, rgba(0,0,0,0.08) 3.5%, rgba(255,255,255,0.18) 5%, rgba(255,255,255,0) 9%, rgba(0,0,0,0) 85%, rgba(0,0,0,0.06) 100%);
}
.book-3d.turning .hb-cover { transform: perspective(1100px) rotateY(-88deg); filter: brightness(.7); }
.hb-pages { transition: opacity .25s ease; }
.book-3d.turning .hb-pages { opacity: 0; }
.book-3d.has-img:hover .hb-cover, .book-3d.has-img:focus-visible .hb-cover { translate: 0 -10px; }
.book-3d.has-img:focus-visible { outline: none; }
.book-3d.has-img:focus-visible .hb-cover { outline: 3px solid var(--brand); outline-offset: 3px; }
.hb-label {
  position: absolute; left: 50%; top: calc(100% + 14px); width: max-content; max-width: 220px; translate: -50% 6px;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 0.8rem; line-height: 1.35; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, translate .2s ease; z-index: 5; box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
.hb-label strong { display: block; font-size: 0.85rem; }
.hb-label span { color: #d4d4d8; }
.hb-label::before { content: ""; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; background: var(--ink); translate: -50% 0; rotate: 45deg; }
.book-3d.has-img:hover .hb-label, .book-3d.has-img:focus-visible .hb-label { opacity: 1; translate: -50% 0; }
.book-3d.has-img:hover, .book-3d.has-img:focus-visible { z-index: 4; }
@media (hover: none) { .hb-label { display: none; } }

/* ---------- Hero headline entrance ---------- */
@keyframes word-up { from { opacity: 0; translate: 0 0.6em; } }
.hero-title .w { display: inline-block; animation: word-up .7s cubic-bezier(.2,.8,.2,1) calc(var(--i) * 90ms + .1s) both; }

/* ---------- Home: Teacher's Guides ---------- */
.tg-home { background: var(--surface); border-top: 1px solid var(--line); }
.tg-counts { list-style: none; padding: 0; margin: 4px 0 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.tg-counts li { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 110px; }
.tg-counts strong { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--brand); }
.tg-counts span { font-size: 0.85rem; color: var(--ink-soft); }
.tg-featured { margin: 0; }
.tg-featured li:nth-child(n) { transition-delay: calc(var(--i, 0) * 60ms); }

@media (prefers-reduced-motion: reduce) {
  .hero-title .w { animation: none; }
  .hb-cover, .hb-label { transition: none; }
}

/* =====================================================================
   Home page: minimal design (scoped to body.page-home)
   ===================================================================== */
.page-home { background: #fff; }
.page-home .container { max-width: 1200px; }
.page-home .site-header { background: rgba(255,255,255,0.92); }
.page-home .site-footer { margin-top: 0; }

/* Typography and section rhythm */
.page-home h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -0.03em; font-weight: 800; margin: 0; }
.h-section { padding: 112px 0; border-top: 1px solid #f0efed; }
@media (max-width: 720px) { .h-section { padding: 72px 0; } }
.h-label { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.h-label::before { content: ""; width: 22px; height: 2px; background: var(--brand); }
.h-head { margin-bottom: 48px; }
.h-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; }
.h-sub { color: var(--ink-soft); font-size: 1.08rem; max-width: 34em; margin: 16px 0 22px; }
.h-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; transition: color .2s ease, border-color .2s ease; }
.h-link:hover { color: var(--brand); border-color: var(--brand); }
.h-link span { transition: translate .2s ease; }
.h-link:hover span { translate: 3px 0; }
.h-link-btn { background: none; border-top: 0; border-left: 0; border-right: 0; font: inherit; cursor: pointer; }
.h-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 32px; }

/* Hero */
.h-hero { padding: 72px 0 96px; background: #fff; overflow-x: clip; }
.h-hero .container { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 880px) { .h-hero { padding: 48px 0 64px; } .h-hero .container { grid-template-columns: 1fr; gap: 40px; } }
.h-kicker { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 0 0 22px; letter-spacing: 0.02em; }
.page-home .hero-title { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; text-transform: none; margin: 0; }
.page-home .hero-title em { font-style: normal; color: var(--brand); }
.h-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 32em; margin: 26px 0 0; }
.page-home .hero-books { height: 460px; }
@media (max-width: 880px) { .page-home .hero-books { height: 330px; } }

/* Levels line */
.h-levels-line { border-top: 1px solid #f0efed; border-bottom: 1px solid #f0efed; padding: 28px 0; }
.h-levels-line p { margin: 0; text-align: center; font-family: var(--serif); font-weight: 700; font-size: clamp(1.05rem, 2.2vw, 1.5rem); letter-spacing: -0.01em; color: var(--ink); }

/* Shelf */
.page-home .shelf-section { padding: 56px 0 24px; }
.page-home .shelf { padding: 8px 0 24px; }
.page-home .shelf-book img { box-shadow: 0 8px 18px rgba(0,0,0,0.10); border-radius: 2px 5px 5px 2px; }

/* Level cards: flat */
.page-home .level-grid { gap: 28px; }
.page-home .level-card { background: none; border: 0; border-radius: 0; padding: 0; }
.page-home .level-card:hover { transform: none; box-shadow: none; }
.page-home .level-covers { height: 200px; background: #faf9f7; border-radius: 20px; margin-bottom: 6px; }
.page-home .level-covers img, .page-home .lc-plain { bottom: 22px; width: 84px; left: calc(24px + var(--k) * 46px); }
.page-home .level-covers.n1 img { left: calc(50% - 42px); }
.page-home .level-card h3 { margin-top: 18px; font-size: 1.2rem; }
.page-home .level-count { color: var(--ink); font-size: 0.85rem; }
.page-home .level-card:hover h3 { color: var(--brand); }

/* Order */
.h-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--ink-soft); font-weight: 500; font-size: 0.95rem; }
.h-steps li { display: inline-flex; align-items: center; gap: 10px; }
.h-steps span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--ink); }
.page-home .quick-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
@media (max-width: 1080px) { .page-home .quick-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .page-home .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
.page-home .qcard { background: none; border: 0; padding: 0; }
.page-home .qcard:hover { box-shadow: none; transform: none; }
.page-home .qcard img { border-radius: 2px 6px 6px 2px; box-shadow: 0 10px 22px rgba(0,0,0,0.10); transition: translate .25s ease; }
.page-home .qcard:hover img { translate: 0 -4px; }
.page-home .qcard.in-order { box-shadow: none; }
.page-home .qcard.in-order img { outline: 3px solid var(--brand); outline-offset: 3px; }
.page-home .qcard h3 { font-size: 0.88rem; font-weight: 600; }
.page-home .quick-more-wrap { text-align: left; margin-top: 24px; }
.h-discount { margin: 18px 0 0; font-size: 0.95rem; color: var(--muted); }
.h-discount::before { content: "%"; display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 8px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.8em; font-weight: 700; vertical-align: 1px; }
.page-home .quick-summary {
  position: sticky; bottom: 16px; top: auto; margin-top: 40px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; text-align: left;
  gap: 14px 24px; background: var(--ink); color: #fff; border-radius: 16px; padding: 16px 16px 16px 24px; box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.page-home .qs-count { margin: 0; font-size: 0.82rem; color: #c9c9ce; }
.page-home .qs-total { margin: 0; font-size: 1.5rem; }
.page-home .qs-actions { display: flex; align-items: center; gap: 22px; }
.page-home .qs-actions .h-link { color: #fff; border-color: rgba(255,255,255,0.5); }
.page-home .qs-actions .h-link:hover { color: #fff; border-color: #fff; }
.page-home .quick-summary .btn { width: auto; }
@media (max-width: 640px) { .page-home .quick-summary { flex-wrap: nowrap; } .page-home .qs-actions .h-link { display: none; } .page-home .quick-summary { padding: 12px 12px 12px 18px; } .page-home .qs-total { font-size: 1.2rem; } }

/* Stats */
.h-statement { font-family: var(--serif); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.2; letter-spacing: -0.03em; max-width: 24em; margin: 0; }
.h-statement + .h-link { margin-top: 36px; }

/* Partners */
.h-logos { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; align-items: center; }
@media (max-width: 720px) { .h-logos { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
.h-logos img { max-height: 56px; max-width: 100%; width: auto; filter: grayscale(1); opacity: .7; transition: filter .25s ease, opacity .25s ease; }
.h-logos li:hover img { filter: none; opacity: 1; }

/* Closing CTA */
.h-cta { padding: 128px 0; text-align: center; border-top: 1px solid #f0efed; }
.h-cta h2 { font-size: clamp(2.2rem, 5vw, 3.8rem) !important; }
.h-cta p { color: var(--ink-soft); font-size: 1.1rem; margin: 18px auto 0; max-width: 32em; }
.h-cta .h-actions { justify-content: center; }
@media (max-width: 720px) { .h-cta { padding: 88px 0; } }

/* Gentler reveals on the home page */
.page-home .reveal { transform: translateY(10px); transition-duration: .8s; }
@media (prefers-reduced-motion: reduce) { .h-link span, .page-home .qcard img, .h-logos img { transition: none; } }

/* ---------- Phone and ordering improvements ---------- */
/* Anything marked hidden stays hidden, whatever display a class gives it */
[hidden] { display: none !important; }

/* Top bar: one line on phones (phone number and WhatsApp) */
@media (max-width: 640px) {
  .topbar { font-size: 0.8rem; }
  .topbar .container { justify-content: center; padding-top: 6px; padding-bottom: 6px; }
  .topbar .tb-addr, .topbar .tb-email { display: none; }
}

/* Order icon in the header on phones */
.hdr-order {
  display: none; position: relative; margin-left: auto; margin-right: -8px;
  width: 44px; height: 44px; place-items: center; border-radius: 10px; color: var(--ink); text-decoration: none;
}
.hdr-order svg { width: 24px; height: 24px; }
.hdr-order .badge { position: absolute; top: 2px; right: 0; margin: 0; }
@media (max-width: 880px) { .hdr-order { display: grid; } }

/* Catalogue: filters stay in reach while scrolling */
.filter-bar {
  position: sticky; top: 77px; z-index: 20;
  background: rgba(250, 249, 247, 0.96); backdrop-filter: blur(8px);
  margin: 0 -12px 16px; padding: 12px; border-radius: 0 0 14px 14px;
}
.filter-bar .filters { margin-bottom: 10px; }
.filter-bar.stuck { box-shadow: 0 10px 20px -16px rgba(0,0,0,0.35); }
.catalogue-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 20px; }
.catalogue-meta .book-meta { font-weight: 600; }
.catalogue-meta .order-hint { margin: 0; }
@media (max-width: 640px) {
  .filter-bar { margin: 0 -16px 14px; padding: 10px 16px; border-radius: 0; }
  .filter-bar .filters { flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
  .filter-bar .filters input[type="search"] { flex: 1 1 auto; min-width: 0; }
  .filter-bar .filters select { flex: 0 0 38%; min-width: 0; }
  .filter-bar .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .filter-bar .chip-row::-webkit-scrollbar { display: none; }
  .filter-bar .chip { flex: none; }
}
.series-range { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 12px; }
.series-range strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.series-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  font: inherit; font-weight: 700; font-size: 0.92rem; color: var(--ink); cursor: pointer; text-align: left;
}
.series-toggle:hover { border-color: var(--ink); }
.series-toggle svg { width: 18px; height: 18px; margin-left: auto; flex: none; transition: transform .2s ease; }
.series-toggle[aria-expanded="true"] { margin-bottom: 12px; }
.series-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.series-toggle > span:first-child { white-space: nowrap; }
.series-inorder { white-space: nowrap; font-size: 0.75rem; font-weight: 700; color: #fff; background: var(--brand); border-radius: 999px; padding: 2px 9px; }
.series-more {
  display: grid; place-items: center; aspect-ratio: 320 / 420; align-self: start;
  border-radius: 4px; background: var(--paper); border: 1px dashed var(--line);
  font-weight: 700; color: var(--ink-soft); text-decoration: none;
}

/* Back to top */
.to-top {
  position: fixed; right: 16px; bottom: 20px; z-index: 55;
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  box-shadow: var(--shadow); cursor: pointer;
}
.to-top svg { width: 22px; height: 22px; }
body.has-order-bar .to-top { bottom: 100px; }

/* Price rows on phones: name on its own line, price and quantity underneath */
@media (max-width: 520px) {
  .price-rows li { grid-template-columns: 1fr auto; row-gap: 6px; padding: 10px 8px; }
  .price-rows .item-name { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-weight: 600; }
  .price-rows .item-name .item-thumb { margin: 0; }
  .price-rows .item-author, .price-rows .item-brief { flex-basis: 100%; font-weight: 400; }
  .price-rows .item-price { font-weight: 600; color: var(--ink-soft); }
}

/* Book page on phones: title and price first, then a smaller cover */
@media (max-width: 720px) {
  .bd-layout { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .bd-info { display: contents; }
  .bd-info > * { order: 6; }
  .bd-info > .eyebrow { order: 1; align-self: flex-start; }
  .bd-info > h1 { order: 2; }
  .bd-info > .bd-authors { order: 3; }
  .bd-info > .bd-price { order: 4; margin: 14px 0 20px; }
  .bd-media { order: 5; max-width: 260px; margin: 0 auto 28px; }
  .bd-thumbs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; justify-content: safe center; }
  .bd-thumb { flex: none; scroll-snap-align: center; }
}

/* Buttons that sit side by side are the same size, and full width on phones */
.order-actions .btn { flex: 1 1 220px; }
.bd-actions { max-width: 560px; }
.bd-actions .btn { flex: 1 1 200px; white-space: nowrap; }
.btn-icon { width: 18px; height: 18px; flex: none; }

/* "Added to your order" message and a nudge on the order bar */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; width: max-content; max-width: min(520px, calc(100% - 32px));
  transform: translate(-50%, 12px); text-align: center; opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 16px;
  font-size: 0.9rem; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-order-bar .toast { bottom: 104px; }
@keyframes bump { 0%, 100% { scale: 1; } 40% { scale: 1.06; } }
.bump { animation: bump .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .bump { animation: none; }
  .toast, .series-toggle svg { transition: none; }
}

/* ---------- Featured series (home) ---------- */
.featured { display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: auto auto; gap: 18px; }
.fs-card {
  --tint: color-mix(in srgb, var(--c) 10%, #fff);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  color: var(--ink); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.fs-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(0,0,0,0.25); border-color: transparent; color: var(--ink); }
.fs-card:focus-visible { outline-offset: 4px; }
.fs-covers {
  position: relative; display: grid; place-items: center; background: var(--tint);
  height: 170px; padding: 18px 0 0; overflow: hidden;
}
.fs-covers img {
  width: 92px; height: auto; border-radius: 2px 5px 5px 2px; translate: 0 14px;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.35), inset 4px 0 0 rgba(0,0,0,0.1); transition: translate .3s ease;
}
.fs-card:hover .fs-covers img { translate: 0 6px; }
.fs-plain {
  display: grid; place-items: end start; width: 92px; aspect-ratio: 320 / 420; translate: 0 14px; padding: 10px;
  background: var(--c); color: #fff; border-radius: 2px 5px 5px 2px; font-family: var(--serif); font-weight: 800; font-size: 0.7rem; line-height: 1.15;
}
.fs-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.fs-eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c); }
.fs-card h3 { font-size: 1.05rem; line-height: 1.3; margin: 0; }
.fs-text { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }
.fs-price { color: var(--muted); font-size: 0.88rem; margin-top: auto; padding-top: 6px; }
.fs-price strong { color: var(--ink); }
.fs-cta { font-weight: 700; font-size: 0.9rem; color: var(--brand); }
.fs-cta span { display: inline-block; transition: translate .2s ease; }
.fs-card:hover .fs-cta span { translate: 4px 0; }
/* The first series: large, with a fan of covers */
.fs-main { grid-row: 1 / span 2; }
.fs-main .fs-covers { flex: 1; height: auto; min-height: 300px; padding: 0; }
.fs-main .fs-body { flex: none; }
.fs-main .fs-covers img { width: 150px; }
.fs-main .fs-fan img { position: absolute; left: 50%; top: calc(50% - 100px); translate: 0 0; }
.fs-main .fs-fan img[style*="--k:0"] { z-index: 3; margin-left: -120px; rotate: -6deg; }
.fs-main .fs-fan img[style*="--k:1"] { z-index: 2; margin-left: -75px; rotate: 1deg; margin-top: -6px; }
.fs-main .fs-fan img[style*="--k:2"] { z-index: 1; margin-left: -30px; rotate: 8deg; margin-top: 6px; }
.fs-main:hover .fs-fan img { translate: 0 -6px; }
.fs-main h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); letter-spacing: -0.01em; }
.fs-main .fs-body { padding: 24px 28px 28px; gap: 10px; }
@media (max-width: 980px) {
  .featured { grid-template-columns: 1fr 1fr; }
  .fs-main { grid-column: 1 / -1; grid-row: auto; flex-direction: row; }
  .fs-main .fs-covers { flex: 0 0 44%; height: auto; min-height: 300px; }
}
/* Phones: one row of cards to swipe through */
@media (max-width: 640px) {
  .featured { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
  .featured::-webkit-scrollbar { display: none; }
  .featured { align-items: flex-start; }
  .fs-card { flex: 0 0 78%; scroll-snap-align: center; }
  .fs-main { flex-direction: column; }
  .fs-main .fs-covers { flex: none; min-height: 0; height: 230px; }
  .fs-main .fs-fan img { top: 34px; }
  .fs-main .fs-covers img { width: 112px; }
  .fs-main .fs-fan img[style*="--k:0"] { margin-left: -95px; }
  .fs-main .fs-fan img[style*="--k:1"] { margin-left: -58px; }
  .fs-main .fs-fan img[style*="--k:2"] { margin-left: -20px; }
  .fs-covers { height: 190px; }
  .fs-covers img, .fs-plain { width: 106px; }
  .fs-main .fs-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .fs-card, .fs-covers img, .fs-cta span { transition: none; } }

/* ---------- Footer ---------- */
.site-footer .footer-grid h2 { font-family: var(--sans); font-size: 0.85rem; font-weight: 700; line-height: 1.3; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; margin: 0 0 16px; }
.site-footer .f-label { display: block; color: #8b8b93; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1px; }
.site-footer .f-contact a { white-space: nowrap; }
.site-footer .f-contact li { line-height: 1.55; }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .footer-grid .f-about, .footer-grid .f-contact { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
}

/* ---------- Our Books: cover-led cards, class filter, level headings ---------- */
.book-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.series {
  --tint: color-mix(in srgb, var(--c) 11%, #fff);
  display: flex; flex-direction: column; border-radius: 16px;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.series:hover { box-shadow: 0 16px 36px -20px rgba(0,0,0,0.3); }
.series-media { position: relative; display: block; height: 196px; background: var(--tint); overflow: hidden; }
.series-media img {
  position: absolute; left: 50%; top: 26px; width: 116px; height: auto; margin-left: -58px;
  border-radius: 2px 6px 6px 2px; box-shadow: 0 14px 26px -10px rgba(0,0,0,0.4), inset 4px 0 0 rgba(0,0,0,0.1);
  transition: translate .3s ease;
}
.series-media.n2 img[style*="--k:0"] { margin-left: -104px; rotate: -5deg; z-index: 2; }
.series-media.n2 img[style*="--k:1"] { margin-left: -14px; rotate: 5deg; top: 32px; }
.series-media.n3 img[style*="--k:0"] { margin-left: -138px; rotate: -8deg; top: 36px; }
.series-media.n3 img[style*="--k:1"] { z-index: 2; }
.series-media.n3 img[style*="--k:2"] { margin-left: 22px; rotate: 8deg; top: 36px; }
.series:hover .series-media img { translate: 0 -5px; }
.series-plain {
  position: absolute; left: 50%; top: 26px; width: 116px; aspect-ratio: 320 / 420; margin-left: -58px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 12px 10px;
  background: var(--c); color: #fff; border-radius: 2px 6px 6px 2px; box-shadow: 0 14px 26px -10px rgba(0,0,0,0.4);
  font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.series-plain strong { font-family: var(--serif); font-size: 0.82rem; letter-spacing: 0; text-transform: none; line-height: 1.15; }
.series-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; flex: 1; }
.series .series-subject { color: var(--c); opacity: 1; font-size: 0.68rem; font-weight: 700; }
.series h3 { font-size: 1.04rem; line-height: 1.3; margin: 0; }
.series h3 a { color: var(--ink); text-decoration: none; }
.series h3 a:hover { color: var(--brand); text-decoration: underline; }
.series .series-authors { font-style: normal; color: var(--muted); font-size: 0.84rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.series .series-range { margin: 4px 0 0; }
.series-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; }
.series .series-toggle { flex: 1; width: auto; min-width: 0; }
.series .series-toggle[aria-expanded="true"] { margin-bottom: 0; }
.series-details { font-weight: 700; font-size: 0.88rem; color: var(--ink); white-space: nowrap; }
.series .price-rows { margin: 12px 0 0; }
.cat-level {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px;
  font-size: 1.45rem; margin: 26px 0 -6px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.cat-level:first-child { margin-top: 0; }
.cat-level span { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.class-row { margin-top: 10px; align-items: center; }
.class-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip-sm { padding: 6px 12px; font-size: 0.84rem; }
.catalogue-meta { margin-bottom: 8px; }
.catalogue-meta .link-button { font-size: 0.9rem; }
.catalogue-prices { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.book-grid ~ .order-hint, .order-hint { margin: 0 0 22px; font-size: 0.88rem; color: var(--muted); }
.empty .btn { margin-top: 14px; }
/* Phones: cover on the left, details on the right, quantities full width */
@media (max-width: 560px) {
  .book-grid { gap: 14px; }
  .series { display: grid; grid-template-columns: 104px 1fr; column-gap: 14px; }
  .series-body { display: contents; }
  .series-media { grid-row: 1 / span 4; height: auto; min-height: 150px; }
  .series-media img, .series-plain { width: 72px; margin-left: -36px; top: 16px; }
  .series-media.n2 img[style*="--k:1"], .series-media.n3 img[style*="--k:0"], .series-media.n3 img[style*="--k:2"] { display: none; }
  .series-media.n2 img[style*="--k:0"], .series-media.n3 img[style*="--k:1"] { margin-left: -36px; rotate: 0deg; top: 16px; }
  .series-plain { padding: 8px 6px; }
  .series .series-subject { margin-top: 14px; padding-right: 14px; }
  .series h3, .series .series-authors, .series .series-range { padding-right: 14px; }
  .series-actions { grid-column: 1 / -1; padding: 12px 14px 14px; margin: 0; }
  .series .price-rows { grid-column: 1 / -1; margin: -4px 14px 14px; }
  .cat-level { font-size: 1.2rem; margin-top: 18px; }
  .catalogue-prices { margin-left: 0; flex-basis: 100%; }
  .class-row { margin-top: 8px; }
  .class-label { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .series-media img { transition: none; } }
.catalogue-section { padding-top: 28px; }

/* ---------- Order page: discount estimate ---------- */
.discount-calc { margin: 16px 0 0; padding: 14px 16px 16px; border: 0; border-left: 4px solid var(--brand); border-radius: 10px; background: #fdecee; }
.discount-calc legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; font-weight: 700; color: var(--brand); font-size: 0.95rem; }
.dc-hint { clear: both; margin: 0 0 10px; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5; }
.dc-options { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-options label { position: relative; cursor: pointer; }
.dc-options input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dc-options span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #f3c4c8; font-weight: 700; font-size: 0.92rem; color: var(--ink);
}
.dc-options span::before {
  content: ""; width: 16px; height: 16px; border-radius: 4px; border: 2px solid #d4a3a8; background: #fff; flex: none;
}
.dc-options input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.dc-options input:checked + span::before {
  border-color: #fff; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e30615' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.dc-options input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.dc-summary { margin: 14px 0 0; padding: 12px 14px; background: #fff; border-radius: 8px; display: grid; gap: 6px; }
.dc-summary div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.dc-summary dt { color: var(--ink-soft); }
.dc-summary dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-summary .dc-total { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 800; }
.dc-summary .dc-total dt { color: var(--ink); }
.dc-summary .dc-total dd { font-family: var(--serif); font-size: 1.25rem; color: var(--brand-dark); }

/* ---------- Order page: proforma preview ---------- */
.btn-preview { width: 100%; margin-top: 10px; }
.pf-dialog {
  width: min(860px, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 0; border: 0; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35); color: var(--ink); background: var(--paper);
}
.pf-dialog[open] { display: flex; flex-direction: column; }
.pf-dialog::backdrop { background: rgba(15,15,15,0.55); }
.pf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.pf-bar h2 { font-size: 1.05rem; margin: 0; }
.pf-close { border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.pf-close:hover { color: var(--brand); }
.pf-scroll { overflow: auto; padding: 18px; flex: 1; }
.pf-sheet { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px 30px; font-size: 0.88rem; box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
.pf-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: start; padding-bottom: 18px; border-bottom: 3px solid var(--brand); }
.pf-head img { width: 72px; height: auto; }
.pf-seller { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 0.78rem; }
.pf-seller strong { color: var(--ink); font-size: 0.98rem; margin-bottom: 4px; }
.pf-title { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 0.8rem; color: var(--muted); text-align: right; }
.pf-title strong { color: var(--brand); font-family: var(--serif); font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; white-space: nowrap; }
.pf-title b { color: var(--ink); margin-left: 6px; }
.pf-parties { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0; }
.pf-parties strong { display: block; font-size: 1rem; margin: 2px 0 4px; }
.pf-parties p { margin: 0; line-height: 1.55; }
.pf-right { text-align: right; }
.pf-label { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.pf-table th { background: var(--brand); color: #fff; text-align: left; padding: 8px; font-weight: 700; }
.pf-table td { padding: 7px 8px; border-bottom: 1px solid #f0efed; vertical-align: top; }
.pf-table tbody tr:nth-child(even) td { background: #f8f8f9; }
.pf-table th:nth-child(n+3), .pf-table td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.pf-totals { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-top: 10px; border-top: 1.5px solid var(--ink); }
.pf-count { color: var(--muted); font-size: 0.8rem; padding-top: 4px; }
.pf-totals dl { margin: 0; display: grid; gap: 4px; min-width: 260px; }
.pf-totals dl div { display: flex; justify-content: space-between; gap: 16px; }
.pf-totals dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-grand { font-weight: 800; font-size: 1.05rem; padding-top: 4px; }
.pf-grand dd { color: var(--brand-dark); }
.pf-notes, .pf-terms { margin-top: 16px; }
.pf-notes p, .pf-terms p { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.55; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
.pf-actions .btn { flex: 1 1 200px; }
@media (max-width: 640px) {
  .pf-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .pf-scroll { padding: 10px; }
  .pf-sheet { padding: 16px 14px; }
  .pf-head { grid-template-columns: 48px 1fr; }
  .pf-head img { width: 48px; }
  .pf-title { grid-column: 1 / -1; align-items: flex-start; text-align: left; }
  .pf-parties { flex-direction: column; }
  .pf-right { text-align: left; }
  .pf-table { font-size: 0.78rem; }
  .pf-table th:nth-child(4), .pf-table td:nth-child(4) { display: none; }
  .pf-totals { flex-direction: column; }
  .pf-totals dl { min-width: 0; width: 100%; }
  .pf-actions { padding: 10px; gap: 8px; }
  .pf-actions .btn { flex: 1 1 100%; padding: 11px 14px; }
}
