/* =========================================================
   explicado fácil · página de venta por libro
   ========================================================= */
:root {
  --c1: #0e7490;           /* color del libro elegido (lo cambia app.js) */
  --c2: #0b1e3a;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --wa: #25d366;
  --wa-d: #128c4a;
  --ff-h: "Sora", system-ui, sans-serif;
  --ff: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 17px/1.6 var(--ff); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--ff-h); margin: 0; line-height: 1.1; letter-spacing: -.03em; }
:focus-visible { outline: 3px solid var(--wa-d); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 24px; border-radius: 14px; font: 700 16px/1 var(--ff); white-space: nowrap; transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn--sm { padding: 10px 16px; font-size: 15px; border-radius: 12px; }
.btn--xl { padding: 20px 30px; font-size: 18.5px; border-radius: 16px; }
.btn--wa { background: var(--wa); color: #fff; box-shadow: 0 10px 24px -10px rgba(18,140,74,.85); }
.btn--wa:hover { background: #1fbe5b; box-shadow: 0 14px 30px -10px rgba(18,140,74,.9); }
.wa { width: 22px; height: 22px; flex: none; }

/* ---------- Cabecera ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; font: 700 20px var(--ff-h); letter-spacing: -.03em; }
.logo b { color: var(--wa-d); margin-left: 4px; }
.logo__mark { margin-right: 10px; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); position: relative; }
.logo__mark::after { content: ""; position: absolute; inset: 7px 8px 7px 9px; background: var(--wa); border-radius: 2px 4px 4px 2px; }
.top__tag { padding-left: 16px; border-left: 1px solid var(--line); color: var(--ink-3); font-size: 14.5px; font-weight: 500; }
.top .btn { margin-left: auto; }

/* ---------- 1. El libro ---------- */
.hero {
  position: relative; overflow: hidden; padding: 64px 0 72px;
  background:
    radial-gradient(600px 400px at 22% 40%, color-mix(in srgb, var(--c1) 22%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--c1) 7%, white), #fff);
  transition: background .5s;
}
.hero__in { display: grid; grid-template-columns: 400px 1fr; gap: 70px; align-items: center; }
.hero__cover { display: flex; justify-content: center; perspective: 1200px; }
.hero__cover .cover { width: 300px; transform: rotateY(-16deg) rotateX(2deg); box-shadow: inset 6px 0 0 rgba(0,0,0,.22), inset 8px 0 0 rgba(255,255,255,.1), 30px 40px 60px -30px rgba(15,23,42,.6), 0 10px 20px -10px rgba(15,23,42,.4); }
.hero__kicker { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c1); filter: saturate(1.2) brightness(.85); }
.hero h1 { font-size: clamp(34px, 4.8vw, 54px); font-weight: 800; }
.hero__sub { margin: 10px 0 22px; font-size: 20px; color: var(--ink-2); }
.checks { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 34px; font-size: 16.5px; font-weight: 500; }
.checks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--wa) 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }

.buy { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 18px 18px 24px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 40px -30px rgba(15,23,42,.45); }
.buy__price { line-height: 1; }
.buy__pen { display: flex; align-items: flex-start; gap: 4px; font-family: var(--ff-h); }
.buy__pen span { font-size: 20px; font-weight: 700; margin-top: 6px; color: var(--ink-2); }
.buy__pen b { font-size: 52px; font-weight: 800; letter-spacing: -.04em; }
.buy__usd { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.buy__usd b { color: var(--ink); }
.buy .btn { flex: 1; }

.pays { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; font-size: 14px; color: var(--ink-3); }
.pays > span { margin-right: 4px; }
.pay { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; font: 800 13px var(--ff); font-style: normal; }
.pay--yape { background: #742284; color: #fff; }
.pay--plin { background: #00c4cc; color: #fff; }
.pay--paypal { background: #ffc439; color: #003087; font-style: italic; }
.pay--bank { background: #eef2f7; color: #1f2937; font-weight: 700; }

/* entrada al cambiar de libro */
.hero.is-in .hero__cover .cover { animation: coverIn .7s var(--ease) both; }
.hero.is-in .hero__info > * { animation: up .55s var(--ease) both; }
.hero.is-in .hero__info > *:nth-child(2) { animation-delay: .05s; }
.hero.is-in .hero__info > *:nth-child(3) { animation-delay: .1s; }
.hero.is-in .hero__info > *:nth-child(4) { animation-delay: .15s; }
.hero.is-in .hero__info > *:nth-child(5) { animation-delay: .2s; }
.hero.is-in .hero__info > *:nth-child(6) { animation-delay: .25s; }
@keyframes coverIn { from { opacity: 0; transform: rotateY(-40deg) translateX(-30px); } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 2. Cómo comprar ---------- */
.how { background: var(--ink); color: #fff; }
.how__steps { list-style: none; margin: 0; padding: 26px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.how__steps li { display: flex; gap: 14px; align-items: flex-start; }
.how__steps b { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--wa); color: #fff; font: 800 15px var(--ff-h); }
.how__steps strong { display: block; font-size: 16px; }
.how__steps strong i { font-style: normal; }
.how__steps span { display: block; color: #94a3b8; font-size: 14.5px; line-height: 1.45; margin-top: 2px; }

/* ---------- 3. Temario ---------- */
.toc { padding: 80px 0; }
.toc__in { display: grid; grid-template-columns: 360px 1fr; gap: 60px; align-items: start; }
.toc h2 { font-size: clamp(28px, 3.4vw, 38px); }
.toc__head p { color: var(--ink-2); margin: 14px 0 0; }
.toc__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toc__list li { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; font-weight: 600; font-size: 15.5px; background: #fff; transition: border-color .2s, transform .2s; }
.toc__list li:hover { border-color: color-mix(in srgb, var(--c1) 50%, white); transform: translateY(-2px); }
.toc__list b { flex: none; font: 800 14px var(--ff-h); color: var(--c1); filter: brightness(.9) saturate(1.2); }

/* ---------- 4. Otros libros ---------- */
.more { padding: 70px 0 90px; background: var(--soft); border-top: 1px solid var(--line); }
.more h2 { font-size: clamp(26px, 3vw, 34px); }
.more__sub { margin: 8px 0 34px; color: var(--ink-2); }
.more__sub i { font-style: normal; font-weight: 700; color: var(--ink); }
.more__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.ob { text-align: left; display: flex; flex-direction: column; gap: 2px; }
.ob .cover { margin-bottom: 14px; transition: transform .35s var(--ease); }
.ob:hover .cover { transform: translateY(-8px) rotate(-1.5deg); }
.ob > strong { font-size: 15px; line-height: 1.3; }
.ob > span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.soon { margin: 44px 0 0; padding: 16px 20px; border-radius: 14px; background: #fff; border: 1px dashed #cbd5e1; font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.soon a { color: var(--wa-d); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pie ---------- */
.foot { padding: 28px 0; border-top: 1px solid var(--line); }
.foot__in { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.foot p { margin: 0; color: var(--ink-3); font-size: 14px; }
.foot__wa { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--wa-d); font-weight: 700; font-size: 15px; }
.foot__wa .wa { width: 19px; height: 19px; }

/* ---------- Barra fija (celular) ---------- */
.mbar { display: none; }

/* ---------- Portada automática ---------- */
.cover {
  --c1: #0e7490; --c2: #0b1e3a;
  position: relative; aspect-ratio: 2 / 3; border-radius: 3px 10px 10px 3px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 70% at 85% 0%, color-mix(in srgb, var(--c1) 80%, white 20%), transparent 55%), linear-gradient(160deg, var(--c1), var(--c2) 78%);
  color: #fff; container-type: inline-size;
  box-shadow: inset 5px 0 0 rgba(0,0,0,.22), inset 7px 0 0 rgba(255,255,255,.1), 0 18px 30px -16px rgba(15,23,42,.55), 0 4px 10px -4px rgba(15,23,42,.3);
}
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .2; background-image: radial-gradient(rgba(255,255,255,.8) 1px, transparent 1.3px); background-size: 9cqw 9cqw; mask-image: linear-gradient(#000, transparent 70%); }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 11%; background: linear-gradient(90deg, rgba(0,0,0,.3), rgba(255,255,255,.1) 60%, transparent); }
.cover__net { position: absolute; inset: 30% 0 auto; width: 100%; height: 45%; z-index: -1; }
.cover__net line { stroke: rgba(255,255,255,.35); stroke-width: .6; }
.cover__net circle { fill: var(--c2); stroke: rgba(255,255,255,.85); stroke-width: .8; }
.cover__net circle.hot { fill: #fff; stroke: none; }
.cover__series { position: absolute; top: 8cqw; left: 14cqw; font: 700 5.6cqw/1 var(--ff); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.cover__series::after { content: ""; display: block; width: 18cqw; height: 1.2cqw; margin-top: 3cqw; background: currentColor; opacity: .7; border-radius: 2px; }
.cover__title { position: absolute; left: 14cqw; right: 8cqw; bottom: 25cqw; font: 800 26cqw/.9 var(--ff-h); letter-spacing: -.05em; }
.cover__title.is-long { font-size: 19cqw; }
.cover__sub { position: absolute; left: 14cqw; right: 8cqw; bottom: 9cqw; font: 500 6.2cqw/1.25 var(--ff); opacity: .88; }
.cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__in { grid-template-columns: 1fr; gap: 36px; }
  .hero__cover .cover { width: 220px; }
  .hero__info { text-align: center; }
  .checks { display: inline-grid; text-align: left; }
  .pays { justify-content: center; }
  .how__steps { grid-template-columns: 1fr; gap: 16px; }
  .toc__in { grid-template-columns: 1fr; gap: 28px; }
  .more__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 16px; padding-bottom: 76px; }
  .top__tag { display: none; }
  .btn--sm span { display: none; }
  .btn--sm { padding: 10px; }
  .hero { padding: 34px 0 44px; }
  .hero__cover .cover { width: 180px; }
  .hero__sub { font-size: 17px; }
  .checks li { font-size: 15px; }
  .buy { flex-direction: column; align-items: stretch; text-align: center; padding: 18px; gap: 14px; }
  .buy__pen { justify-content: center; }
  .btn--xl { font-size: 17px; padding: 18px 20px; }
  .toc { padding: 56px 0; }
  .toc__list { grid-template-columns: 1fr; }
  .more { padding: 56px 0 70px; }
  .more__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
  .foot__wa { margin-left: 0; }
  .mbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -16px rgba(15,23,42,.35);
    transform: translateY(110%); transition: transform .35s var(--ease);
  }
  .mbar.is-on { transform: none; }
  .mbar b { display: block; font: 800 22px/1 var(--ff-h); }
  .mbar small { font-size: 12.5px; color: var(--ink-2); }
  .mbar .btn { flex: 1; max-width: 220px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 560px) {
  .more__row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .ob > strong { font-size: 13px; }
  .ob > span { font-size: 11.5px; }
  .ob .cover { margin-bottom: 10px; }
}

/* v2 · precio en dólares primero */
.buy { display: block; padding: 18px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.opt { position: relative; padding: 16px 16px 14px; border: 2px solid var(--line); border-radius: 16px; background: #fff; }
.opt--main { border-color: #ffc439; background: linear-gradient(180deg, #fffbeb, #fff); }
.opt__tag { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.opt--main .opt__tag { color: #b45309; }
.opt__price { display: flex; align-items: flex-start; gap: 4px; font-family: var(--ff-h); line-height: 1; margin-bottom: 12px; }
.opt__price span { font-size: 17px; font-weight: 700; margin-top: 5px; color: var(--ink-2); }
.opt__price b { font-size: 44px; font-weight: 800; letter-spacing: -.04em; }
.opt:not(.opt--main) .opt__price b { font-size: 36px; color: var(--ink-2); }
.opt__pay { display: flex; flex-wrap: wrap; gap: 5px; }
.opt__pay .pay { height: 26px; font-size: 12.5px; padding: 0 9px; }
.opt--main .opt__pay .pay { height: 30px; font-size: 14.5px; padding: 0 14px; }
.buy__note { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-3); text-align: center; }
.pays { display: none; }
@media (max-width: 960px) { .opt { text-align: left; } }
@media (max-width: 560px) {
  .buy { padding: 12px; }
  .opts { gap: 8px; }
  .opt { padding: 12px 12px 12px; }
  .opt__tag { font-size: 10.5px; }
  .opt__price b { font-size: 36px; }
  .opt:not(.opt--main) .opt__price b { font-size: 30px; }
  .opt__pay .pay { height: 22px; font-size: 11px; padding: 0 7px; }
  .opt--main .opt__pay .pay { height: 26px; font-size: 13px; }
}
.btn--block { width: 100%; display: flex; }

/* =========================================================
   v3 · portadas reales + lector tipo libro
   ========================================================= */
.hero__left { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero__cover { position: relative; cursor: zoom-in; }
.hero__cover .cover { transition: transform .5s var(--ease); }
.hero__cover:hover .cover { transform: rotateY(-6deg) rotateX(1deg) translateY(-6px) scale(1.02); }
.hero__cover::after {
  content: "Toca para hojear"; position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 8px);
  padding: 8px 14px; border-radius: 999px; background: rgba(15,23,42,.85); color: #fff; font: 600 13px var(--ff);
  opacity: 0; transition: .3s var(--ease); pointer-events: none; white-space: nowrap;
}
.hero__cover:hover::after { opacity: 1; transform: translate(-50%, 0); }
.cover:has(.cover__img)::before, .cover:has(.cover__img)::after { display: none; }
.cover:has(.cover__img) { border-radius: 2px 8px 8px 2px; }
.cover__img { z-index: 0; }
.peek {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; color: var(--ink);
  box-shadow: 0 10px 24px -18px rgba(15,23,42,.6); transition: .2s;
}
.peek:hover { border-color: var(--ink); transform: translateY(-2px); }
.peek svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

/* Lector */
.reader {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  background: radial-gradient(900px 600px at 50% 40%, #1e293b, #0b1120);
  color: #fff;
}
.reader__top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.reader__ttl b { display: block; font: 700 17px var(--ff-h); }
.reader__ttl small { color: #94a3b8; font-size: 13px; }
.reader__x { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font-size: 17px; }
.reader__x:hover { background: rgba(255,255,255,.16); }
.reader__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 10px; }
.reader__book { display: flex; justify-content: center; filter: drop-shadow(0 30px 40px rgba(0,0,0,.5)); }
.reader.is-open .reader__book { animation: bookIn .7s var(--ease) both; }
@keyframes bookIn { from { opacity: 0; transform: translateY(30px) scale(.9); } }
.reader__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 30px; line-height: 1;
  transition: background .2s, opacity .2s;
}
.reader__nav:hover { background: rgba(255,255,255,.22); }
.reader__nav:disabled { opacity: .2; pointer-events: none; }
.reader__nav--prev { left: 18px; }
.reader__nav--next { right: 18px; }
.reader__bar { display: flex; align-items: center; gap: 16px; padding: 12px 18px 16px; flex-wrap: wrap; justify-content: center; }
.reader__count { font-size: 14px; color: #cbd5e1; font-weight: 600; }
.reader__hint { font-size: 13px; color: #64748b; }
.reader__bar .btn { margin-left: auto; }
.pg { background: #fff; overflow: hidden; }
.pg img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.pg--end { background: linear-gradient(160deg, #f8fafc, #eef2f7); }
.end { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8% 9%; color: var(--ink); container-type: inline-size; }
.end__lock { width: 13cqw; height: 13cqw; border-radius: 50%; background: var(--ink); display: grid; place-items: center; margin-bottom: 5cqw; }
.end__lock svg { width: 55%; height: 55%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.end h3 { font-size: 7cqw; margin-bottom: 3cqw; }
.end p { margin: 0 0 2cqw; font-size: 3.6cqw; color: var(--ink-2); }
.end ul { list-style: none; margin: 0 0 5cqw; padding: 0; font-size: 3.4cqw; line-height: 1.7; color: var(--ink-2); }
.end li::before { content: "✓ "; color: var(--wa-d); font-weight: 700; }
.end li:last-child::before { content: ""; }
.end__price { font-size: 3.6cqw; color: var(--ink-2); margin-bottom: 4cqw; }
.end__price b { font: 800 7cqw var(--ff-h); color: var(--ink); display: block; }
.end__price span { display: block; font-size: 3.2cqw; color: var(--ink-3); }
.end .btn { font-size: 3.6cqw; padding: 3.2cqw 5cqw; border-radius: 3cqw; }
.end .btn .wa { width: 4.6cqw; height: 4.6cqw; }

.toc__list b { min-width: 54px; }

@media (max-width: 760px) {
  .reader__nav { width: 40px; height: 40px; font-size: 24px; background: rgba(15,23,42,.6); }
  .reader__nav--prev { left: 6px; }
  .reader__nav--next { right: 6px; }
  .reader__hint { display: none; }
  .reader__bar .btn { margin-left: 0; width: 100%; }
  .reader__bar { gap: 8px; }
}
.reader__bar .btn i { font-style: normal; }

/* =========================================================
   v4 · lector más grande + modo «Leer en grande»
   ========================================================= */
.reader__top { padding: 8px 14px; }
.reader__bar { padding: 8px 14px 10px; }
.reader__stage { padding: 0; }
.zbtn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; transition: transform .2s;
}
.zbtn:hover { transform: translateY(-2px); }
.zbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.reader__bar .zbtn { margin-left: auto; }
.reader__bar .zbtn + .btn, .reader__bar .zbtn[hidden] + .btn { margin-left: 0; }
.reader__bar .zbtn[hidden] + .btn { margin-left: auto; }

.zoom { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.zoom__tools {
  position: sticky; top: 10px; z-index: 3; margin: 10px auto 0; width: max-content;
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 14px;
  background: rgba(15,23,42,.9); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.zoom__tools button { min-width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font-size: 22px; font-weight: 600; }
.zoom__tools button:hover { background: rgba(255,255,255,.2); }
.zoom__tools span { min-width: 54px; text-align: center; font-size: 14px; font-weight: 700; color: #e2e8f0; }
.zoom__tools .zoom__book { font-size: 14px; padding: 0 14px; margin-left: 6px; background: #fff; color: var(--ink); }
.zoom__tools .zoom__book:hover { background: #e2e8f0; }
.zoom__pages { --z: 1; width: calc(min(860px, 100vw - 24px) * var(--z)); margin: 16px auto 40px; display: grid; gap: 16px; }
.zoom__pages img { display: block; width: 100%; height: auto; border-radius: 4px; background: #fff; box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); }
.zoom__end { background: linear-gradient(160deg, #f8fafc, #eef2f7); border-radius: 4px; aspect-ratio: 745 / 1053; max-height: 80vh; margin: 0 auto; width: 100%; }
@media (max-width: 760px) {
  .reader__bar .zbtn { margin-left: 0; flex: 1; justify-content: center; }
  .reader__bar .btn { flex: 1 1 100%; }
  .zoom__pages { width: calc((100vw - 12px) * var(--z)); gap: 10px; }
}
.zbtn { white-space: nowrap; }
@media (max-width: 760px) {
  .reader__bar .zbtn { flex: 0 0 auto; padding: 9px 14px; font-size: 14px; margin-left: auto; }
  .reader__count { font-size: 13px; }
}

/* =========================================================
   v5 · libro lo más grande posible (escritorio)
   ========================================================= */
@media (min-width: 761px) {
  .reader { display: grid; grid-template-columns: 200px 1fr 200px; grid-template-rows: 1fr; }
  .reader__top { grid-column: 1; grid-row: 1; align-self: start; flex-direction: column; align-items: flex-start; padding: 16px 0 0 18px; }
  .reader__x { position: absolute; top: 14px; right: 16px; z-index: 6; }
  .reader__stage { grid-column: 2; grid-row: 1; padding: 6px 0; overflow: visible; }
  .reader__nav--prev { left: -62px; }
  .reader__nav--next { right: -62px; }
  .reader__bar {
    grid-column: 3; grid-row: 1; align-self: end; flex-direction: column; align-items: stretch;
    gap: 10px; padding: 0 16px 18px 0; flex-wrap: nowrap;
  }
  .reader__bar .zbtn, .reader__bar .btn, .reader__bar .zbtn[hidden] + .btn { margin-left: 0; justify-content: center; }
  .reader__bar .btn { white-space: normal; text-align: center; line-height: 1.25; padding: 14px 12px; font-size: 15px; }
  .reader__count { order: -1; text-align: center; }
  .reader__hint { display: none; }
  .zoom { inset: 0 -200px; }
}

/* =========================================================
   Integración en topologia.app · cabecera y pie del sitio
   ========================================================= */
.skip{position:absolute;left:8px;top:-60px;background:#1a3c6e;color:#fff;padding:9px 14px;border-radius:8px;z-index:60}.skip:focus{top:8px}
.stop{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px clamp(14px,4vw,32px);background:#fff;border-bottom:1px solid #cdd7e3;font-family:'Segoe UI',system-ui,Arial,sans-serif}
.slogo{display:flex;align-items:center;gap:9px;font-weight:700;color:#1a3c6e;text-decoration:none;font-size:16px}
.slogo img{width:28px;height:28px;border-radius:7px}
.snav{display:flex;flex-wrap:wrap;gap:4px 18px;margin-left:auto;font-size:15px;font-weight:600}
.snav a{color:#2d3748;text-decoration:none;padding:4px 0;border-bottom:2px solid transparent}
.snav a:hover{color:#2c6fbb}
.snav a[aria-current]{color:#2c6fbb;border-bottom-color:#2c6fbb}
.scta{display:inline-block;background:#2c6fbb;color:#fff;padding:9px 18px;border-radius:999px;font-weight:700;font-size:15px;text-decoration:none;white-space:nowrap}
.scta:hover{filter:brightness(1.08)}
@media(max-width:900px){.snav{display:none}}
.sfoot{border-top:1px solid #cdd7e3;padding:22px clamp(14px,4vw,32px);color:#5d6b7c;font:14px/1.6 'Segoe UI',system-ui,Arial,sans-serif;display:flex;flex-wrap:wrap;gap:8px 22px;justify-content:space-between;max-width:1100px;margin:0 auto}
.sfoot nav{display:flex;flex-wrap:wrap;gap:6px 18px}
.sfoot a{color:#2c6fbb}
.foot{border-top:0;padding:22px 0 10px}
@media (max-width:560px){.sfoot{padding-bottom:90px}}

/* Vista: todos los libros */
.todos { padding: 46px 0 70px; border-top: 0; background: var(--bg, #fff); }
.todos .ob > span b { color: var(--ink); }
.more__all { margin-top: 34px; text-align: center; }
.btn-all { font: inherit; font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.btn-all:hover { border-color: var(--ink-3); }
.back-all { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; }
.back-all:hover { color: var(--ink); }

/* Selector de idioma ES / EN en la cabecera */
.slng{display:inline-flex;border:1px solid #cdd7e3;border-radius:999px;overflow:hidden;font:700 13px 'Segoe UI',system-ui,Arial,sans-serif;margin-left:6px}
.slng b,.slng a{padding:5px 10px;text-decoration:none}
.slng b{background:#1a3c6e;color:#fff}
.slng a{color:#1a3c6e}
.slng a:hover{background:#eef3f9}
html.embed .slng{display:none}

/* ---------- Páginas propias de cada libro (SEO) ---------- */
a.ob { color: inherit; text-decoration: none; }
a.btn-all { display: inline-block; text-decoration: none; }
.todos h1 { font-size: clamp(28px, 3.4vw, 40px); }
.crumbs { margin: 0 0 18px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span { color: var(--ink-3); font-weight: 500; }
.smp { padding: 70px 0; background: var(--soft); border-top: 1px solid var(--line); }
.smp h2, .faq h2, .rel h2 { font-size: clamp(26px, 3vw, 34px); }
.smp__sub, .rel__sub { margin: 8px 0 28px; color: var(--ink-2); }
.smp__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.smp__pg { padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; cursor: zoom-in; box-shadow: 0 18px 30px -24px rgba(15,23,42,.5); transition: transform .25s var(--ease); }
.smp__pg:hover { transform: translateY(-6px); }
.smp__pg img { display: block; width: 100%; height: auto; }
.faq { padding: 70px 0; }
.faq .wrap { max-width: 820px; }
.faq h2 { margin-bottom: 24px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; margin-bottom: 10px; background: #fff; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 20px var(--ff-h); color: var(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }
.rel { padding: 0 0 70px; }
.rel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rel li a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.rel li a:hover { border-color: var(--ink-3); }
@media (max-width: 760px) {
  .smp__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rel ul { grid-template-columns: 1fr; }
  .smp, .faq { padding: 50px 0; }
}
