@font-face { font-family: "Baloo"; src: url("fonts/Baloo2-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Regular.ttf"); }

:root {
  --bg: #FFF8EE;
  --card: #FFFFFF;
  --ink: #4A3426;
  --ink-soft: #7A6152;
  --night: #1F2F5C;
  --night-2: #2E4580;
  --gold: #E9B949;
  --gold-dark: #C99520;
  --coral: #E5735E;
  --line: #EADFCF;
  --ok: #4C9A6A;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Nunito", system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.5; }
h1, h2, h3 { font-family: "Baloo", "Nunito", sans-serif; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(30px, 5vw, 50px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.btn { display: inline-flex; align-items: center; gap: .5em; border: 0; border-radius: 999px; padding: 14px 26px; font-family: "Baloo", sans-serif; font-size: 19px; background: var(--gold); color: #3A2A10; box-shadow: 0 4px 0 var(--gold-dark); transition: transform .1s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-dark); }
.btn.ghost { background: transparent; box-shadow: none; border: 2px solid currentColor; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.muted { color: var(--ink-soft); }
.hidden { display: none !important; }

/* ---------- Cabecera ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,248,238,.92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-family: "Baloo", sans-serif; font-size: 22px; text-decoration: none; }
.logo span { color: var(--gold-dark); }
.top .btn { padding: 8px 18px; font-size: 16px; }

/* ---------- Landing ---------- */
.hero { background: radial-gradient(circle at 70% 20%, #3B57A0 0%, var(--night) 55%); color: #FFF7E8; padding: 48px 0 56px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center; }
.hero p.lead { font-size: 19px; opacity: .92; max-width: 34em; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0 26px; font-size: 15px; }
.hero .badges span::before { content: "✦ "; color: var(--gold); }
.hero .price { margin-top: 14px; font-size: 15px; opacity: .85; }
.hero .book { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.35); transform: rotate(2deg); }
.hero .book img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .book .title { position: absolute; top: 6%; left: 0; right: 0; text-align: center; font-family: "Baloo", sans-serif; font-size: clamp(22px, 3.2vw, 34px); color: #FFF7E8; text-shadow: 0 2px 6px rgba(0,0,0,.5); padding: 0 8%; }
.stars-bg { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(2px 2px at 10% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 70%, #fff, transparent), radial-gradient(2px 2px at 55% 15%, #fff, transparent), radial-gradient(1.5px 1.5px at 80% 40%, #fff, transparent), radial-gradient(1px 1px at 90% 80%, #fff, transparent); opacity: .6; }
section.block { padding: 56px 0; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps3 > div { background: var(--card); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.steps3 > div::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); font-family: "Baloo"; margin-bottom: 8px; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery img { width: 100%; border-radius: 14px; display: block; box-shadow: 0 6px 16px rgba(74,52,38,.12); }
.callout { background: var(--card); border: 2px dashed var(--gold); border-radius: var(--radius); padding: 22px; display: flex; gap: 18px; align-items: center; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.cta-final { text-align: center; background: var(--night); color: #FFF7E8; border-radius: 26px; padding: 40px 20px; position: relative; overflow: hidden; }
footer { padding: 30px 0 60px; font-size: 14px; color: var(--ink-soft); text-align: center; }

/* ---------- Creador ---------- */
.builder { min-height: calc(100vh - 60px); display: grid; grid-template-columns: 1fr 1fr; }
.stage { background: linear-gradient(#FDEFD9, #FFF8EE); display: grid; place-items: center; padding: 20px; position: relative; }
.stage .doll { width: min(320px, 70%); filter: drop-shadow(0 8px 14px rgba(74,52,38,.12)); }
.stage .doll img, .stage .doll svg { width: 100%; height: auto; display: block; }
.stage .who { font-family: "Baloo", sans-serif; font-size: 28px; margin-top: 4px; text-align: center; min-height: 1.2em; }
.stage .cast { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.stage .cast .mini { width: 56px; text-align: center; font-size: 12px; opacity: .8; }
.stage .cast .mini img, .stage .cast .mini svg { width: 100%; height: auto; }
.panel { padding: 26px 24px 120px; overflow: auto; }
.panel .step-title { font-size: 26px; }
.field { margin: 18px 0; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 8px; }
input[type=text], textarea { width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
input[type=text]:focus, textarea:focus { outline: none; border-color: var(--gold); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 700; color: var(--ink); }
.choice[aria-pressed=true] { border-color: var(--gold-dark); background: #FFF3D6; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); padding: 0; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 3px var(--gold-dark); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.style-card { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px 6px 4px; font-size: 13px; text-align: center; color: var(--ink); }
.style-card svg { width: 100%; height: 82px; display: block; }
.style-card img { width: 100%; height: 92px; object-fit: cover; object-position: 50% 6%; display: block; border-radius: 8px; }
.style-card[aria-pressed=true] { border-color: var(--gold-dark); background: #FFF3D6; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.mode-card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); font-size: 15px; -webkit-appearance: none; appearance: none; }
.mode-card strong { font-family: "Baloo", sans-serif; font-size: 20px; }
.mode-card .mode-ico { font-size: 30px; line-height: 1; }
.mode-card[aria-pressed=true] { border-color: var(--gold-dark); background: #FFF3D6; }
.file-btn { cursor: pointer; }
.status-foto { background: #E5F2E9; color: #2F6B47; border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.tips { margin: 6px 0 12px; padding-left: 20px; }
.stage .doll img.foto, .stage .cast .mini img.foto { border-radius: 50%; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 4px solid #fff; box-shadow: 0 6px 16px rgba(74,52,38,.18); }
.foto-note { text-align: center; font-size: 14px; margin: 10px 0 0; }
.stepbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; }
.stepbar .wrap { display: flex; align-items: center; gap: 10px; height: 76px; max-width: 1100px; }
.stepbar ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex: 1; overflow-x: auto; }
.stepbar li { font-size: 13px; white-space: nowrap; padding: 6px 10px; border-radius: 999px; background: #F5EEE3; color: var(--ink-soft); }
.stepbar li.done { background: #E5F2E9; color: var(--ok); }
.stepbar li.done::before { content: "✓ "; }
.stepbar li.now { background: #FFF3D6; color: var(--ink); font-weight: 700; }

/* ---------- Espera ---------- */
.wait { min-height: calc(100vh - 60px); background: var(--night); color: #FFF7E8; padding: 30px 0 60px; position: relative; overflow: hidden; }
.wait .wrap { max-width: 720px; position: relative; }
.trail { position: relative; height: 90px; margin: 10px 0 26px; }
.trail .path { position: absolute; left: 0; right: 0; top: 62px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.15); }
.trail .fill { position: absolute; left: 0; top: 62px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #F7D774, var(--gold)); box-shadow: 0 0 12px rgba(233,185,73,.8); width: 0; transition: width .5s linear; }
.trail .camel { position: absolute; top: 0; width: 70px; height: 70px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); background: #fff; transform: translateX(-50%); left: 0; transition: left .5s linear; animation: bob .6s ease-in-out infinite alternate; }
.trail .camel img { width: 160%; margin: -8% 0 0 -30%; }
.trail .home { position: absolute; right: -6px; top: 38px; font-size: 32px; }
@keyframes bob { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -6px); } }
.qcard { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 22px; }
.qcard .choices .choice { background: rgba(255,255,255,.95); }
.qcard textarea { min-height: 90px; }
.status { font-size: 15px; opacity: .85; margin-top: 4px; min-height: 1.5em; }

/* ---------- Vista previa ---------- */
.preview { padding: 30px 0 80px; }
.pages { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.page { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 24px rgba(74,52,38,.18); background: #fff; }
.page img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page .txt { position: absolute; top: 4%; left: 8%; right: 8%; text-align: center; font-size: clamp(11px, 1.35vw, 15px); line-height: 1.45; text-shadow: 0 0 6px #FFF8EE, 0 0 10px #FFF8EE; }
.page .ribbon { position: absolute; bottom: 10px; right: 10px; background: rgba(31,47,92,.85); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.order { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.proto { background: #FFF0C2; border: 1px solid #E9C766; border-radius: 12px; padding: 10px 14px; font-size: 14px; }

@media (max-width: 820px) {
  .hero .wrap, .builder { grid-template-columns: 1fr; }
  .hero .book { max-width: 420px; margin: 0 auto; }
  .steps3, .gallery { grid-template-columns: 1fr 1fr; }
  /* móvil: la figura se queda fija arriba y pequeña, para ver cada cambio en vivo mientras se baja por las opciones */
  .stage { align-self: start; position: -webkit-sticky; position: sticky; top: 60px; z-index: 10; padding: 6px 12px; box-shadow: 0 6px 12px rgba(74,52,38,.08); }
  .stage > div { display: flex; align-items: center; justify-content: center; gap: 12px; }
  .stage .doll { width: auto; height: 27vh; height: 27svh; max-height: 230px; }
  .stage .doll img { width: auto; height: 100%; }
  .stage .doll img.foto { width: auto; height: 80%; margin-top: 10%; }
  .stage .foto-note { display: none; }
  .stage .who { font-size: 20px; margin: 0; }
  .stage .cast { flex-direction: column; margin: 0; gap: 4px; }
  .stage .cast .mini { width: 38px; font-size: 10px; }
  .panel { padding: 18px 16px 120px; }
  .pages { grid-template-columns: 1fr; }
  .modes { grid-template-columns: 1fr; }
  .callout { flex-direction: column; text-align: center; }
}
