/* ============================================================
   CBC Bookshop — mobile-first styles, no framework
   ============================================================ */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Baloo 2", ui-rounded, var(--font);
  --c-yellow: #f5b700;
  --c-coral: #ef6f5a;
  --c-blue: #3a86d8;
  --c-green: #2e9e5b;
  --c-purple: #7c5cc4;
  --blob: #fff1c7;
  --doodle: #0f766e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --text: #15201c;
  --text-muted: #5b6b64;
  --border: #d9e0dc;
  --primary: #0f766e;
  --primary-strong: #0b5e58;
  --primary-soft: #d6f0ec;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --whatsapp: #25d366;
  --whatsapp-strong: #1ebe5a;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.06), 0 6px 20px -12px rgba(16, 24, 20, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513;
    --surface: #171f1c;
    --surface-2: #1f2a26;
    --text: #e8eeeb;
    --text-muted: #9fb0a9;
    --border: #2b3833;
    --primary: #2dd4bf;
    --primary-strong: #5eead4;
    --primary-soft: #113b37;
    --accent: #fbbf24;
    --accent-soft: #3a2a08;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --blob: #24332e;
    --doodle: #5eead4;
  }
}
:root[data-theme="dark"] {
  --blob: #24332e;
  --doodle: #5eead4;
  --bg: #0f1513;
  --surface: #171f1c;
  --surface-2: #1f2a26;
  --text: #e8eeeb;
  --text-muted: #9fb0a9;
  --border: #2b3833;
  --primary: #2dd4bf;
  --primary-strong: #5eead4;
  --primary-soft: #113b37;
  --accent: #fbbf24;
  --accent-soft: #3a2a08;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.12; margin: 0 0 0.4em; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75em; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 4px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -40px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 8px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 700; color: var(--primary); margin-bottom: 0.4em; }
.lead { font-size: 1.05rem; color: var(--text-muted); max-width: 60ch; }
.notice { background: var(--accent-soft); border: 1px solid var(--accent); padding: 12px 14px; border-radius: var(--radius-sm); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.05s, border-color 0.15s;
  min-height: 42px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
:root[data-theme="dark"] .btn-primary, :root:not([data-theme="light"]) .btn-primary { color: var(--text); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn-primary { color: #fff; } }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-whatsapp { background: var(--whatsapp); color: #06301a; }
.btn-whatsapp:hover { background: var(--whatsapp-strong); }
.btn-ghost-wa { background: transparent; border-color: var(--whatsapp); color: var(--text); }
.btn-ghost-wa:hover { background: rgba(37, 211, 102, 0.12); }
.btn-sm { padding: 7px 12px; font-size: 0.875rem; min-height: 36px; }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; min-height: 50px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-width: 42px; }
.btn.is-done { background: var(--accent); color: #1f1300; border-color: transparent; }
.btn-note { font-weight: 400; opacity: 0.85; }
.btn-link { background: none; border: 0; padding: 10px 2px; min-height: 40px; color: var(--text-muted); cursor: pointer; text-decoration: underline; font-size: 0.9rem; }
.btn-link:hover { color: var(--danger); }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--c-yellow) 0 20%, var(--c-coral) 20% 40%, var(--c-blue) 40% 60%, var(--c-green) 60% 80%, var(--c-purple) 80%); }
.header-inner { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.header-inner { grid-template-columns: 1fr auto auto; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.header-inner .search-form { display: none; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); background: var(--surface-2); }
.icon-link:hover { background: var(--primary-soft); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.15rem, 5vw, 1.35rem); white-space: nowrap; color: var(--text); letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand:hover { text-decoration: none; }
.search-form { grid-column: 1 / -1; display: flex; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 3px 3px 14px; }
.search-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; outline: none; }
.search-form input::placeholder { color: var(--text-muted); }
.search-form .btn { border-color: transparent; }
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); background: var(--surface-2); }
.cart-link:hover { text-decoration: none; background: var(--primary-soft); }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #1f1300; font-size: 0.75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

.site-nav { position: relative; z-index: 40; border-bottom: 1px solid var(--border); background: var(--surface); }
.nav-inner { display: flex; align-items: center; gap: 4px; }
.nav-links { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-menu { flex: 0 0 auto; }
.nav-links a, .nav-menu summary { display: inline-block; padding: 10px 12px; font-weight: 600; color: var(--text); white-space: nowrap; border-radius: var(--radius-sm); font-size: 0.95rem; }
.nav-links a:hover, .nav-menu summary:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--primary); }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; color: var(--primary); }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: " ▾"; font-size: 0.8em; }
.nav-panel { position: absolute; left: 0; top: calc(100% + 4px); z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 12px 20px; width: min(calc(100vw - 2 * var(--gutter)), 640px); }
.nav-stage-name { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 4px; font-weight: 700; }
.nav-stage ul { list-style: none; margin: 0; padding: 0; }
.nav-stage a { display: block; padding: 4px 0; color: var(--text); }
@media (min-width: 720px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
  .header-inner .search-form { display: flex; grid-column: auto; max-width: 560px; justify-self: center; width: 100%; }
  .header-inner .search-link { display: none; }
  .nav-panel { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(165deg, var(--primary-soft) 0%, var(--bg) 75%); border-bottom: 1px solid var(--border); }
.doodles { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--doodle); opacity: 0.07; pointer-events: none; }
.hero-inner { position: relative; display: grid; gap: 8px; padding-top: 28px; padding-bottom: 28px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 6.4vw, 3.4rem); max-width: 16ch; margin-bottom: 0.3em; }
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after { content: ""; position: absolute; left: -0.06em; right: -0.06em; bottom: 0.2em; height: 0.32em; border-radius: 0.2em; z-index: -1; opacity: 0.55; transform: rotate(-1.5deg); }
.hl-yellow::after { background: var(--c-yellow); }
.hl-coral::after { background: var(--c-coral); }
.hl-blue::after { background: var(--c-blue); }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: #7c3f00; font-weight: 700; font-size: 0.85rem; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--c-yellow) 50%, transparent); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.hero-search { display: flex; gap: 8px; margin: 6px 0 4px; max-width: 520px; }
.hero-search input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.hero-visual { display: flex; justify-content: center; }
@media (max-width: 719px) { .hero-ctas .btn { flex: 1 1 auto; } .hero-inner { padding-top: 20px; } }
.hero-art { width: 100%; max-width: 380px; height: auto; }
.il-blob { fill: var(--blob); }
.il-dot { fill: var(--c-yellow); opacity: 0.6; }
@media (min-width: 880px) {
  .hero-inner { grid-template-columns: 1.1fr 1fr; gap: 24px; padding-top: 44px; padding-bottom: 44px; }
  .hero-art { max-width: 540px; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-chip { color: var(--accent); } }
:root[data-theme="dark"] .hero-chip { color: var(--accent); }

/* ---------- feature strip ---------- */
.features { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: -18px; position: relative; z-index: 1; }
.feature { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.feature div { display: flex; flex-direction: column; line-height: 1.3; }
.feature span:not(.feature-icon) { color: var(--text-muted); font-size: 0.85rem; }
.feature-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.f-teal .feature-icon { background: var(--primary); }
.f-coral .feature-icon { background: var(--c-coral); }
.f-green .feature-icon { background: #1fa855; }
.f-yellow .feature-icon { background: var(--c-yellow); color: #3b2a00; }
@media (min-width: 560px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.steps li div { display: flex; flex-direction: column; }
.steps li div span { color: var(--text-muted); font-size: 0.92rem; }
.step-icon { position: relative; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.s-teal .step-icon { background: var(--primary); }
.s-green .step-icon { background: #1fa855; }
.s-yellow .step-icon { background: var(--c-yellow); color: #3b2a00; }
.step-num { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--text); border: 2px solid currentColor; font-weight: 800; font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.s-teal .step-num { color: var(--primary); } .s-green .step-num { color: #1fa855; } .s-yellow .step-num { color: #b07f00; }
.steps-wide { gap: 14px; }
@media (min-width: 720px) { .steps-wide { grid-template-columns: repeat(3, 1fr); } }

/* ---------- sections ---------- */
.section { padding-top: 32px; padding-bottom: 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0.15em; }
.section-subtitle { color: var(--text-muted); margin: 0; font-size: 0.95rem; }
.stage-blocks { display: grid; gap: 18px; }
.stage-block { margin: 0; }
@media (min-width: 880px) {
  .stage-blocks { display: flex; flex-wrap: wrap; gap: 20px 36px; }
  .stage-block .level-grid { display: flex; flex-wrap: wrap; }
  .stage-block .level-card { width: 150px; }
}
.stage-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-family: var(--font); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--stage, var(--text-muted)); margin-bottom: 8px; }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stage); align-self: center; }
.stage-blurb { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-muted); font-size: 0.85rem; }
.stage-pre-primary { --stage: #c98f00; --stage-soft: #fff4d1; }
.stage-lower-primary { --stage: #d9533d; --stage-soft: #fde6e1; }
.stage-upper-primary { --stage: #2f78c9; --stage-soft: #e1eefb; }
.stage-junior-school { --stage: #23905a; --stage-soft: #ddf3e7; }
.stage-senior-school { --stage: #6d4fc0; --stage-soft: #ece6fb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stage-pre-primary { --stage: #ffc933; --stage-soft: #3a2f10; }
  :root:not([data-theme="light"]) .stage-lower-primary { --stage: #ff8a75; --stage-soft: #3d2420; }
  :root:not([data-theme="light"]) .stage-upper-primary { --stage: #6aa9ef; --stage-soft: #1b2c40; }
  :root:not([data-theme="light"]) .stage-junior-school { --stage: #4cc58a; --stage-soft: #173528; }
  :root:not([data-theme="light"]) .stage-senior-school { --stage: #a38bf0; --stage-soft: #2a2343; }
}
.group-heading { margin-top: 28px; padding-top: 16px; border-top: 2px solid var(--border); }

.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.level-grid-inline { margin: 12px 0 24px; }
.level-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 12px; background: var(--surface); border: 1px solid var(--border); border-top: 5px solid var(--stage, var(--primary)); border-radius: var(--radius); color: var(--text); transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
.level-card:hover { text-decoration: none; border-color: var(--stage, var(--primary)); box-shadow: var(--shadow); transform: translateY(-2px); }
.level-card:hover .level-art { transform: rotate(-8deg) scale(1.08); }
.level-art { position: absolute; right: 8px; top: 10px; width: 40px; height: 40px; transition: transform 0.2s; }
.level-short { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; color: var(--stage, var(--primary)); }
.level-name { font-weight: 600; }
.level-sub { font-size: 0.8rem; color: var(--text-muted); }

.category-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .category-grid { grid-template-columns: repeat(5, 1fr); }
  .category-tile { flex-direction: column; }
}
.category-tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s; }
.category-tile:hover { text-decoration: none; border-color: var(--cat); box-shadow: var(--shadow); transform: translateY(-2px); }
.category-art-wrap { flex: 0 0 68px; width: 68px; height: 68px; border-radius: 18px; background: var(--cat-soft); display: inline-flex; align-items: center; justify-content: center; }
.category-art { width: 50px; height: 50px; }
.category-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.category-name { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1.15; }
.cat-course-books { --cat: #0f766e; --cat-soft: #d6f0ec; }
.cat-revision { --cat: #d9533d; --cat-soft: #fde6e1; }
.cat-readers { --cat: #6d4fc0; --cat-soft: #ece6fb; }
.cat-reference { --cat: #2f78c9; --cat-soft: #e1eefb; }
.cat-stationery { --cat: #c98f00; --cat-soft: #fff4d1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-course-books { --cat: #2dd4bf; --cat-soft: #113b37; }
  :root:not([data-theme="light"]) .cat-revision { --cat: #ff8a75; --cat-soft: #3d2420; }
  :root:not([data-theme="light"]) .cat-readers { --cat: #a38bf0; --cat-soft: #2a2343; }
  :root:not([data-theme="light"]) .cat-reference { --cat: #6aa9ef; --cat-soft: #1b2c40; }
  :root:not([data-theme="light"]) .cat-stationery { --cat: #ffc933; --cat-soft: #3a2f10; }
}
.category-blurb { color: var(--text-muted); font-size: 0.9rem; }
.category-count { font-size: 0.85rem; color: var(--cat, var(--primary)); font-weight: 700; margin-top: 2px; }

.publisher-list { list-style: none; margin: 0; padding: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.publisher-list li { padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 0.9rem; }

/* ---------- product cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s, border-color 0.15s; }
.card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.card-cover { display: block; background: var(--surface-2); padding: 12px 12px 0; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-meta { font-size: 0.72rem; color: var(--text-muted); margin: 0; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { font-size: 0.95rem; margin: 0; line-height: 1.3; }
.card-title a { color: var(--text); }
.card-badges { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.card-footer { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 400px) {
  .card-grid { gap: 10px; }
  .card-cover { padding: 8px 8px 0; }
  .card-body { padding: 8px 10px 10px; }
  .card-title { font-size: 0.9rem; }
  .cover-title { font-size: 0.78rem; }
}
.price { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.badge-approved { background: var(--primary-soft); color: var(--primary-strong); }
.badge-recommended { background: var(--accent-soft); color: #7c3f00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-recommended { color: var(--accent); } }

/* placeholder covers */
.cover { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 6px 10px 10px 6px; object-fit: cover; }
.cover-real, .cover-photo { position: relative; overflow: hidden; }
.cover-real img, .cover-photo img { display: block; width: 100%; height: 100%; }
.cover-real { background: var(--surface-2); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.cover-real img { object-fit: cover; }
.cover-real::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.15) 60%, transparent); }
.cover-photo { background: #fff; border-radius: 10px; isolation: isolate; }
.cover-photo::before { content: ""; position: absolute; inset: -12%; z-index: -1; background: var(--photo) center / cover no-repeat; filter: blur(18px) saturate(1.15); opacity: 0.55; }
.cover-photo img { position: relative; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25)); }
.cover-placeholder {
  position: relative; padding: 14px 12px 12px 18px; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--hue) 55% 42%), hsl(var(--hue) 60% 28%));
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 6px 0 0 hsl(var(--hue) 50% 20%), inset 8px 0 0 rgba(255, 255, 255, 0.25);
}
.cover-placeholder::after { content: ""; position: absolute; inset: auto -30% -40% auto; width: 80%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.cover-motif { position: absolute; right: -6%; bottom: 14%; width: 62%; height: auto; color: #fff; opacity: 0.2; }
.cover-placeholder::before { content: ""; position: absolute; left: 18px; right: 12px; top: 0; height: 4px; background: rgba(255, 255, 255, 0.35); }
.cover-item { display: flex; align-items: center; justify-content: center; padding: 10%; background: radial-gradient(circle at 50% 45%, hsl(var(--hue) 70% 94%), hsl(var(--hue) 45% 86%)); border-radius: 10px; }
.item-art { width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.12)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cover-item { background: radial-gradient(circle at 50% 45%, hsl(var(--hue) 25% 26%), hsl(var(--hue) 22% 18%)); } }
.cover-title { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-publisher { position: relative; z-index: 1; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.9; }
.cover-lg .cover-title { font-size: 1.45rem; -webkit-line-clamp: 7; }
.cover-lg .cover-publisher { font-size: 0.85rem; }

/* ---------- filters / toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.toolbar-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-right: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
@media (max-width: 759px) {
  .toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .filter-group { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; min-width: 0; }
  .filter-group .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scroll-padding: 0 var(--gutter); }
  .filter-group .chips::-webkit-scrollbar { display: none; }
  .booklist-btn { width: 100%; }
  .btn-sm { min-height: 40px; }
}
.chip:hover { border-color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-count { opacity: 0.7; font-size: 0.8em; }
.filter-empty { color: var(--text-muted); font-style: italic; }

/* ---------- learning-area jump links ---------- */
.area-jump { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.area-jump::-webkit-scrollbar { display: none; }
.area-jump a { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.area-jump a:hover { border-color: var(--primary); text-decoration: none; }
.area-section { scroll-margin-top: 130px; }
@media (min-width: 880px) { .area-jump { flex-wrap: wrap; overflow: visible; margin: 0; padding-left: 0; padding-right: 0; } }

/* ---------- illustrated page banner ---------- */
.page-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; margin: 6px 0 16px; padding: 20px; border-radius: calc(var(--radius) + 6px); background: var(--stage-soft, var(--cat-soft, var(--primary-soft))); border: 1px solid color-mix(in srgb, var(--stage, var(--cat, var(--primary))) 25%, transparent); }
.page-banner .doodles { color: var(--stage, var(--cat, var(--primary))); opacity: 0.1; }
.page-banner .banner-copy { position: relative; flex: 1; min-width: 0; }
.page-banner h1 { margin-bottom: 0.2em; }
.page-banner .eyebrow { color: var(--stage, var(--cat, var(--primary))); }
.page-banner .lead { margin-bottom: 0; color: var(--text); opacity: 0.8; }
.banner-art { position: relative; flex: 0 0 auto; width: 78px; height: 78px; align-self: flex-start; }
.banner-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
@media (max-width: 719px) {
  .page-banner { padding: 18px 16px; }
  .page-banner .banner-art { position: absolute; top: 12px; right: 12px; width: 52px; height: 52px; }
  .page-banner .eyebrow { padding-right: 60px; }
  .banner-stats span { padding: 3px 10px; font-size: 0.8rem; }
}
.banner-stats span { background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; color: var(--text-muted); }
.banner-stats strong { color: var(--text); font-family: var(--font-display); font-size: 1rem; }
@media (min-width: 720px) {
  .page-banner { padding: 28px 32px; }
  .banner-art { width: 140px; height: 140px; align-self: center; }
}

/* ---------- page header / breadcrumbs ---------- */
.breadcrumbs { padding-top: 14px; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li + li::before { content: "/"; margin: 0 6px 0 2px; opacity: 0.5; }
.page-header { padding: 10px 0 14px; }
.area-section { padding: 18px 0 10px; }
.area-section h2 { scroll-margin-top: 120px; }
.extras { border-top: 1px dashed var(--border); margin-top: 10px; }
.empty-state { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--text-muted); }
.help-band { margin: 28px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 18px 20px; background: linear-gradient(120deg, #dff7e8, var(--primary-soft)); border-radius: calc(var(--radius) + 4px); }
.help-band .help-copy { flex: 1 1 240px; }
.help-band strong { font-family: var(--font-display); font-size: 1.25rem; display: block; line-height: 1.2; margin-bottom: 4px; }
.help-band p { margin: 0; color: var(--text-muted); }
.phone-art { flex: 0 0 auto; width: 84px; height: auto; }
.help-band-lg { margin-top: 36px; padding: 22px 24px; }
.help-band-lg .phone-art { width: 110px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .help-band { background: linear-gradient(120deg, #143426, var(--primary-soft)); } }
.pager { display: flex; justify-content: space-between; padding: 16px 0 32px; font-weight: 600; }

/* ---------- product page ---------- */
.product-page { display: grid; gap: 22px; padding: 8px 0 20px; }
.product-cover { max-width: 200px; margin: 0 auto; width: 100%; }
@media (min-width: 480px) { .product-cover { max-width: 260px; } }
@media (max-width: 759px) { .breadcrumbs li[aria-current] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.product-price { font-size: 1.6rem; font-weight: 800; margin: 8px 0; }
.product-desc { max-width: 60ch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 18px; font-size: 0.95rem; }
.facts div { display: contents; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.qty-field { display: flex; flex-direction: column; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); gap: 4px; }
.qty-field input { width: 84px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
@media (min-width: 760px) {
  .product-cover { max-width: 300px; }
  .product-page { grid-template-columns: 300px 1fr; align-items: start; }
  .product-cover { margin: 0; }
}

/* ---------- cart ---------- */
.cart-layout { display: grid; gap: 22px; padding-bottom: 32px; }
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cart-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.cart-row-main { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; }
.cart-title { color: var(--text); font-weight: 600; }
.cart-meta { font-size: 0.85rem; color: var(--text-muted); }
.cart-line-total { font-weight: 800; text-align: right; }
.cart-row .btn-link { grid-column: 1 / -1; justify-self: start; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.qty-stepper button { width: 38px; height: 38px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; }
.qty-stepper button:hover { background: var(--primary-soft); }
.qty-stepper input { width: 46px; text-align: center; border: 0; background: transparent; padding: 8px 0; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cart-summary { display: flex; flex-direction: column; gap: 14px; }
.order-form, .summary-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.order-form h2 { font-size: 1.1rem; }
.order-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; }
.order-form input, .order-form select, .order-form textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-weight: 400; }
.order-form textarea { resize: vertical; }
.summary-row { display: flex; justify-content: space-between; margin: 0 0 6px; }
.summary-total { font-size: 1.15rem; border-top: 1px solid var(--border); padding-top: 10px; margin: 6px 0 12px; }
.summary-box .btn + .btn { margin-top: 8px; }
.after-send { margin-top: 12px; padding: 12px; background: var(--primary-soft); border-radius: var(--radius-sm); font-size: 0.95rem; }
.after-send p { margin-bottom: 8px; }
.preview summary { cursor: pointer; color: var(--text-muted); font-size: 0.9rem; }
.preview pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font-size: 0.85rem; }
.cart-empty { margin: 20px 0 40px; padding: 36px 20px; }
.cart-empty .btn { margin: 4px; }
@media (min-width: 760px) {
  .cart-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .cart-row { grid-template-columns: 1fr auto auto auto; }
  .cart-row-main { grid-column: auto; }
  .cart-row .btn-link { grid-column: auto; }
  .cart-line-total { min-width: 90px; }
  .cart-summary { position: sticky; top: 120px; }
}

/* ---------- footer ---------- */
.site-footer { position: relative; margin-top: 48px; background: var(--surface); border-top: 1px solid var(--border); padding: 34px 0 18px; font-size: 0.95rem; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: #f9e27d repeating-linear-gradient(90deg, #7a6420 0 1.5px, transparent 1.5px 10px) top / 100% 7px no-repeat; border-bottom: 1px solid #e0c050; }
.footer-brand { font-family: var(--font-display); }
.footer-grid { display: grid; gap: 22px; }
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.footer-heading { font-weight: 700; margin-bottom: 6px; }
.footer-links { list-style: none; margin: 0; padding: 0; columns: 2; }
.footer-links a { color: var(--text-muted); }
.footer-wa { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; font-size: 0.85rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* ---------- mobile action bar ---------- */
.mobile-bar { display: none; }
@media (max-width: 759px) {
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.3);
    transform: translateY(110%); transition: transform 0.2s ease;
  }
  .mobile-bar.is-visible { transform: translateY(0); }
  .mobile-bar .btn { flex: 0 0 auto; min-height: 46px; }
  .mobile-bar-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .mobile-bar-text strong { font-family: var(--font-display); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-bar-text span { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.has-mobile-bar .site-footer { padding-bottom: 90px; }
  body.has-mobile-bar .wa-float { bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.page-cart .wa-float { display: none; }
  body.has-mobile-bar .toast-region { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: 80px; }
}

/* ---------- WhatsApp float + toast ---------- */
.wa-float { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 10px 10px; border-radius: 999px; background: var(--whatsapp); color: #06301a; font-weight: 700; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.45); }
.wa-float:hover { background: var(--whatsapp-strong); text-decoration: none; }
.wa-float span { font-size: 0.9rem; }
@media (max-width: 480px) { .wa-float span { display: none; } .wa-float { padding: 12px; } .wa-float svg { width: 28px; height: 28px; } }
.toast-region { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; pointer-events: auto; font-size: 0.95rem; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast a { color: var(--accent); font-weight: 700; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .wa-float, .toast-region, .toolbar, .help-band, .pager { display: none !important; }
}

/* ---------- credits page ---------- */
.credits h2 { margin-top: 24px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.credits-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.credits-table th, .credits-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.credits-table th { background: var(--surface-2); font-weight: 700; }
.credits-table tr:last-child td { border-bottom: 0; }
@media (max-width: 759px) {
  .credits-table, .credits-table tbody, .credits-table tr, .credits-table td { display: block; width: 100%; }
  .credits-table thead { display: none; }
  .credits-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .credits-table td { padding: 2px 0; border: 0; }
}
