/* =========================================================
   KETO BIEN HECHA · Keto Fácil con Ana
   Paleta oficial: magenta #8b095e · ciruela #65104c · coral #db9886
   ========================================================= */

@font-face { font-family: "Fraunces"; src: url("recursos/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("recursos/fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("recursos/fonts/poppins-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("recursos/fonts/poppins-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("recursos/fonts/poppins-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --magenta: #8b095e;
  --magenta-hover: #74054e;
  --ciruela: #65104c;
  --ciruela-deep: #4e0b3a;
  --coral: #db9886;
  --coral-soft: #f3ddd4;
  --blush: #faeee8;
  --paper: #fdf8f5;
  --white: #ffffff;
  --ink: #2a1523;
  --ink-soft: #5c4654;
  --line: #ead7cf;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
  --shadow-book: 0 1px 2px rgba(60, 20, 40, .08), 0 12px 28px -8px rgba(60, 20, 40, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--magenta); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
h2 em, h1 em { font-style: italic; font-weight: 400; color: var(--magenta); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em; min-height: 48px; padding: .85em 1.6em;
  background: var(--magenta); color: #fff; text-decoration: none;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  border-radius: 999px; border: 0; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: var(--magenta-hover); }
.btn:active { transform: translateY(1px); }
.btn--lg { font-size: 1.06rem; padding: 1em 2.1em; min-height: 56px; }
.btn--sm { min-height: 40px; padding: .55em 1.15em; font-size: .9rem; }
.btn--light { background: #fff; color: var(--ciruela); }
.btn--light:hover { background: var(--blush); }

.micro { font-size: .85rem; color: var(--ink-soft); margin: .9em 0 0; }
.eyebrow, .num {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--magenta);
  margin: 0 0 1.1rem;
}
.num--light { color: var(--coral); }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 58ch; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.topbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--magenta); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .95rem; }
.topbar__brand img { width: 36px; height: 36px; }
.topbar__brand em { font-family: var(--serif); text-transform: none; font-weight: 400; color: var(--ciruela); letter-spacing: 0; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { background: var(--paper); padding: clamp(36px, 5.5vw, 80px) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: .95fr 1.05fr; column-gap: clamp(32px, 5vw, 72px);
  grid-template-areas: "head media" "body media"; align-items: center;
}
.hero__head { grid-area: head; align-self: end; }
.hero__media { grid-area: media; margin: 0; }
.hero__body { grid-area: body; align-self: start; }
.hero__media img { width: 100%; height: auto; }
.hero__title {
  font-size: clamp(3.2rem, 7.2vw, 6.2rem); font-weight: 600; line-height: .92;
  text-transform: uppercase; letter-spacing: -.025em; color: var(--ciruela); max-width: 8ch;
}
.hero__sub { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.25; margin: 1rem 0 0; color: var(--ink); }
.hero__sub span { display: block; font-style: italic; color: var(--magenta); }
.hero__lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 48ch; margin: 1.4rem 0 0; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 1.6rem 0 1.8rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { padding: .85rem .6rem .85rem 0; }
.facts div + div { padding-left: .8rem; border-left: 1px solid var(--line); }
.facts dt { font-family: var(--serif); font-size: 1.9rem; line-height: 1; color: var(--magenta); font-weight: 500; }
.facts dd { margin: .3rem 0 0; font-size: .8rem; line-height: 1.3; color: var(--ink-soft); }

.byline { display: flex; align-items: center; gap: 14px; margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.byline img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.byline p { margin: 0; font-size: .95rem; line-height: 1.35; }
.byline span { display: block; font-size: .82rem; color: var(--ink-soft); }

/* ---------- Portadas ---------- */
.cover-img { width: 100%; height: auto; border-radius: 2px 5px 5px 2px; box-shadow: var(--shadow-book); }

/* ---------- Secciones ---------- */
.sec { padding: clamp(72px, 10vw, 128px) 0; }
.sec--paper { background: var(--paper); }
.sec--blush { background: var(--blush); }
.sec--plum { background: var(--ciruela); color: #fff; }
.sec__head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.sec__head .lead { margin-top: 1.1rem; }
.sec__head--center { text-align: center; margin-inline: auto; }
.sec__head--center .lead { margin-inline: auto; }

/* Problema */
.problems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.problems article { padding: 2rem 2rem 2rem 0; }
.problems article + article { padding-left: 2rem; border-left: 1px solid var(--line); }
.problems h3 { margin-bottom: .7rem; color: var(--ciruela); }
.problems p { color: var(--ink-soft); margin: 0; }

.fit { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; margin-top: clamp(40px, 6vw, 72px); }
.fit__col { background: #fff; border-radius: var(--radius); padding: clamp(24px, 3.5vw, 40px); border: 1px solid var(--line); }
.fit__col--no { background: transparent; }
.fit h3 { margin-bottom: 1.1rem; font-size: 1.5rem; }
.checks, .crosses { list-style: none; padding: 0; margin: 0; }
.checks li, .crosses li { position: relative; padding: .55rem 0 .55rem 2rem; border-bottom: 1px solid var(--line); }
.checks li:last-child, .crosses li:last-child { border-bottom: 0; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 1.05rem; width: 12px; height: 7px; border-left: 2px solid var(--magenta); border-bottom: 2px solid var(--magenta); transform: rotate(-45deg); }
.crosses li { color: var(--ink-soft); }
.crosses li::before, .crosses li::after { content: ""; position: absolute; left: 2px; top: 1.15rem; width: 13px; height: 1.5px; background: var(--coral); transform: rotate(45deg); }
.crosses li::after { transform: rotate(-45deg); }

/* Ebook */
.ebook { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 7vw, 100px); align-items: center; }
.ebook__visual { background: var(--blush); border-radius: var(--radius); padding: clamp(32px, 5vw, 64px) clamp(36px, 5.5vw, 72px); }
.ebook h2 { margin-bottom: 1.2rem; }
.parts { list-style: none; padding: 0; margin: 1.6rem 0 2.2rem; border-top: 1px solid var(--line); }
.parts li { padding: .95rem 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }
.parts span { display: block; font-family: var(--serif); font-size: 1.12rem; color: var(--ciruela); margin-bottom: .2rem; }

/* Bonos */
.bonos { list-style: none; padding: 0; margin: 0 0 clamp(40px, 6vw, 64px); display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(32px, 4vw, 48px) clamp(16px, 2vw, 28px); }
.bono__cover { aspect-ratio: 1 / 1.3; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 1.1rem; }
.bono__cover img { max-height: 100%; width: auto; max-width: 100%; border-radius: 2px 4px 4px 2px; box-shadow: var(--shadow-book); transition: transform .25s ease; }
.bono:hover .bono__cover img { transform: translateY(-4px); }
.bono__n { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); margin: 0 0 .35rem; }
.bono h3 { font-size: 1.1rem; line-height: 1.2; margin-bottom: .5rem; }
.bono p:last-child { font-size: .86rem; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.bono p:last-child strong { color: var(--ink); font-weight: 600; display: block; margin-bottom: .1rem; }

/* Páginas interiores: libros abiertos en pantalla */
.spreads { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 36px); }
.spread { margin: 0; background: var(--paper); border-radius: var(--radius); padding: clamp(28px, 4vw, 52px) clamp(20px, 3.5vw, 48px) clamp(20px, 2.5vw, 28px); }
.book { display: grid; grid-template-columns: 1fr 1fr; position: relative; box-shadow: var(--shadow-book); border-radius: 3px; overflow: hidden; background: #fff; }
.book img { width: 100%; aspect-ratio: 1 / 1.414; object-fit: cover; object-position: top; }
.book--square img { aspect-ratio: 1 / 1.414; object-fit: contain; background: #fbf6f2; }
.book::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 10%; transform: translateX(-50%); background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(60,20,40,.10) 48%, rgba(60,20,40,.16) 50%, rgba(60,20,40,.10) 52%, rgba(0,0,0,0) 100%); pointer-events: none; }
.spread figcaption { text-align: center; font-size: .85rem; color: var(--ink-soft); margin-top: 1.2rem; line-height: 1.45; }
.spread figcaption strong { display: block; color: var(--ciruela); font-weight: 600; }

/* Autora */
.author { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 7vw, 100px); align-items: center; }
.author__photo { margin: 0; }
.author__photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.author h2 { margin-bottom: 1.3rem; }
.author .lead { color: var(--ink); }
.author__copy > p:not(.lead):not(.num) { color: var(--ink-soft); }
.creds { list-style: none; padding: 0; margin: 1.8rem 0; border-top: 1px solid var(--line); }
.creds li { display: grid; grid-template-columns: 8rem 1fr; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.creds span { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); padding-top: .2rem; }
.quote { margin: 2rem 0 0; padding: 0 0 0 1.4rem; border-left: 3px solid var(--coral); }
.quote p { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 1.8rem); line-height: 1.25; color: var(--ciruela); margin: 0 0 .4rem; }
.quote footer { font-size: .95rem; color: var(--ink-soft); }

/* Oferta y precio */
.offer { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(40px, 6vw, 88px); align-items: center; }
.price { position: sticky; top: 96px; }
.offer h2 { color: #fff; margin-bottom: 2rem; }
.includes { list-style: none; padding: 0; margin: 0 0 2rem; border-top: 1px solid rgba(255,255,255,.22); }
.includes li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .62rem 0; border-bottom: 1px solid rgba(255,255,255,.16); font-size: .95rem; }
.includes__main { font-weight: 600; }
.includes__total { padding-top: 1rem !important; border-bottom: 0 !important; }
.includes li span:last-child { font-family: var(--serif); color: var(--coral); white-space: nowrap; font-size: 1.02rem; }
.includes__total span:first-child { font-weight: 600; }
.includes__total span:last-child { color: #fff !important; font-size: 1.35rem !important; }
.note { font-size: .92rem; color: rgba(255,255,255,.85); background: rgba(255,255,255,.07); border-left: 3px solid var(--coral); padding: 1rem 1.2rem; border-radius: 0 4px 4px 0; margin: 0; }
.note strong { color: #fff; }

.price { background: var(--ciruela-deep); border: 1px solid rgba(219,152,134,.4); border-radius: 10px; padding: clamp(32px, 4vw, 48px) clamp(24px, 3.5vw, 44px); text-align: center; }
.price__logo { margin: 0 auto 1.2rem; width: 92px; }
.price__name { font-size: .8rem; font-weight: 600; letter-spacing: .18em; color: var(--coral); margin-bottom: .4rem; }
.price__amount { font-family: var(--serif); font-size: clamp(3.6rem, 7vw, 4.8rem); line-height: 1; margin: 0 0 .4rem; font-weight: 500; }
.price__amount small { font-family: var(--sans); font-size: 1rem; font-weight: 500; vertical-align: super; letter-spacing: .08em; }
.price__terms { color: rgba(255,255,255,.8); margin-bottom: 1rem; }
.guarantee { font-size: .88rem; line-height: 1.5; color: rgba(255,255,255,.88); border: 1px solid rgba(219,152,134,.45); border-radius: 6px; padding: .8rem 1rem; margin: 0 0 1.5rem; text-align: left; }
.guarantee strong { color: var(--coral); }
.price .btn { width: 100%; }
.price__micro { font-size: .8rem; color: rgba(255,255,255,.7); margin: 1.1rem 0 0; line-height: 1.5; }

/* FAQ */
.faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.faq__list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 1.25rem 2.6rem 1.25rem 0; position: relative; font-weight: 500; font-size: 1.05rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--magenta); border-bottom: 2px solid var(--magenta); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
summary:hover { color: var(--magenta); }
details p { color: var(--ink-soft); padding: 0 2.6rem 1.3rem 0; margin: 0; }

/* Cierre */
.closing { background: var(--blush); padding: clamp(72px, 10vw, 120px) 0; text-align: center; }
.closing__covers { display: flex; justify-content: center; align-items: flex-end; margin: 0 auto 2.4rem; height: clamp(170px, 22vw, 250px); }
.closing__covers img { height: 82%; width: auto; border-radius: 2px 4px 4px 2px; box-shadow: var(--shadow-book); }
.closing__covers img:nth-child(1) { transform: rotate(-6deg) translateX(18px); }
.closing__covers img:nth-child(2) { height: 100%; position: relative; z-index: 1; }
.closing__covers img:nth-child(3) { transform: rotate(6deg) translateX(-18px); }
.closing h2 { max-width: 16ch; margin: 0 auto 2rem; }

/* Footer */
.footer { background: var(--white); border-top: 1px solid var(--line); padding: 48px 0 110px; }
.footer__in { text-align: center; max-width: 680px; }
.footer img { width: 72px; margin: 0 auto 1.2rem; }
.footer p { font-size: .82rem; color: var(--ink-soft); }

/* Barra fija móvil */
.sticky { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .bonos { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .sec { padding: 64px 0; }
  .hero { padding: 20px 0 48px; }
  .hero__grid { grid-template-columns: 1fr; grid-template-areas: "head" "media" "body"; }
  .hero__head { text-align: center; }
  .eyebrow { margin-bottom: .6rem; }
  .hero__title { font-size: clamp(2.5rem, 11.5vw, 3.6rem); max-width: none; line-height: .95; }
  .hero__sub { font-size: 1.12rem; margin-top: .6rem; }
  .hero__sub span { display: inline; }
  .hero__media { margin: 18px -8px 0; }
  .hero__lead { font-size: 1rem; margin-top: 1rem; text-align: center; margin-inline: auto; }
  .facts { margin: 1.2rem 0 1.4rem; }
  .facts div { padding: .7rem .2rem; text-align: center; }
  .facts div + div { padding-left: .2rem; }
  .facts dt { font-size: 1.6rem; }
  .facts dd { font-size: .75rem; }
  .hero__cta { text-align: center; }
  .hero__cta .btn { width: 100%; }
  .byline { justify-content: center; }

  .ebook, .author, .offer, .faq, .fit { grid-template-columns: 1fr; }
  .ebook__visual { max-width: 380px; margin: 0 auto; width: 100%; }
  .problems { grid-template-columns: 1fr; }
  .problems article, .problems article + article { padding: 1.4rem 0; border-left: 0; }
  .problems article + article { border-top: 1px solid var(--line); }
  .author__photo { max-width: 400px; }
  .creds li { grid-template-columns: 6.6rem 1fr; }
  .price { position: static; }
  .topbar .btn { display: none; }

  /* Páginas interiores: carrusel horizontal */
  .spreads { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: none; }
  .spreads::-webkit-scrollbar { display: none; }
  .spread { flex: 0 0 86%; scroll-snap-align: center; padding: 24px 16px 16px; }

  .sticky {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(60,20,40,.08);
    transform: translateY(110%); transition: transform .25s ease;
  }
  .sticky.is-visible { transform: translateY(0); }
  .sticky div { display: flex; flex-direction: column; line-height: 1.25; }
  .sticky strong { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; color: var(--ciruela); }
  .sticky span { font-size: .78rem; color: var(--ink-soft); }
}

@media (max-width: 560px) {
  .bonos { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .bono h3 { font-size: 1rem; }
  .bono p:last-child { font-size: .84rem; }
  .closing .btn { width: 100%; }
  .includes li { font-size: .9rem; }
}

/* Celular: el botón de compra entra en la primera pantalla */
@media (max-width: 820px) {
  .hero__body { display: flex; flex-direction: column; }
  .hero__body .facts { order: 1; margin-top: .6rem; }
  .hero__body .hero__cta { order: 2; }
  .hero__body .hero__lead { order: 3; margin-top: 1.4rem; }
  .hero__body .byline { order: 4; margin-top: 1.2rem; }
}
