:root {
  --papel: #FAFBF8;
  --tinta: #1E2B5C;      /* bolígrafo azul */
  --tinta-suave: #4A5680;
  --casilla: #E2EEE7;    /* fondo verde de impreso */
  --raya: #9DB8AB;
  --sello: #B8322A;      /* sello rojo */
  --texto: #1D2230;

  --f-display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --f-texto: "Public Sans", system-ui, sans-serif;

  --medida: 68ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--texto);
  font: 400 1.0625rem/1.6 var(--f-texto);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tinta); }
:focus-visible { outline: 3px solid var(--sello); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--f-display); color: var(--tinta); line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); font-weight: 800; letter-spacing: -0.02em; font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; font-weight: 700; }

/* ---------- cabecera ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gutter);
  max-width: 1200px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 800 1.45rem/1 var(--f-display); color: var(--tinta); text-decoration: none;
}
.brand-box {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem;
  border: 2px solid var(--tinta); border-radius: 3px;
  font-size: 1rem; color: var(--sello);
}
.top nav { display: flex; gap: 1.5rem; }
.top nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.top nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- hero ---------- */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(3rem, 7vw, 6rem);
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: start;
}
.hero-copy { padding-top: clamp(0rem, 3vw, 2.5rem); }
.lead { font-size: 1.2rem; max-width: 34ch; margin: 1.5rem 0 2rem; color: var(--tinta-suave); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }

.btn {
  font: 700 1rem/1 var(--f-texto);
  border-radius: 6px; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn-primary {
  background: var(--tinta); color: #fff; border: 0;
  padding: 1rem 1.4rem;
}
.btn-primary:hover { background: #142049; }
.btn-primary:disabled { background: var(--raya); color: var(--tinta); cursor: not-allowed; }
.btn-link { color: var(--tinta); padding: 1rem 0; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* ---------- el impreso ---------- */
.impreso {
  background: #fff;
  border: 2px solid var(--tinta);
  border-radius: 4px;
  box-shadow: 8px 8px 0 var(--casilla);
}
.impreso-head { padding: 1.25rem 1.4rem 1rem; border-bottom: 2px solid var(--tinta); }
.impreso-head h2 { font-size: 1.45rem; }
.impreso-head p { margin: .35rem 0 0; font-size: .92rem; color: var(--tinta-suave); }

.campos { display: grid; grid-template-columns: 1fr 1fr; }
.campo {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: .6rem;
  padding: .7rem 1rem .8rem;
  border-bottom: 1px solid var(--raya);
  cursor: text;
}
.campo:nth-child(odd) { border-right: 1px solid var(--raya); }
.c-num {
  grid-row: span 2;
  font: 700 .72rem/1 var(--f-texto); font-variant-numeric: tabular-nums;
  color: var(--tinta); background: var(--casilla);
  border: 1px solid var(--raya);
  padding: .3rem .35rem; align-self: start; border-radius: 2px;
}
.c-label { font-size: .8rem; line-height: 1.3; color: var(--tinta-suave); }
.c-input { display: flex; align-items: baseline; gap: .3rem; margin-top: .25rem; }
.c-input input {
  width: 100%; min-width: 0;
  font: 600 1.35rem/1.2 var(--f-texto); font-variant-numeric: tabular-nums;
  color: var(--tinta);
  background: var(--casilla);
  border: 0; border-bottom: 2px solid var(--tinta);
  padding: .3rem .45rem; border-radius: 2px 2px 0 0;
}
.c-input input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--sello); }
.c-input i { font-style: normal; font-weight: 600; color: var(--tinta-suave); font-size: .9rem; }

.resultado {
  display: grid; grid-template-columns: auto 1fr; gap: .6rem;
  padding: 1.1rem 1rem 1.2rem;
  border-bottom: 2px solid var(--tinta);
  background: var(--casilla);
}
.r-label { display: block; font-size: .85rem; color: var(--tinta-suave); }
#precio {
  display: block;
  font: 800 clamp(2.4rem, 5vw, 3.2rem)/1 var(--f-display);
  font-variant-numeric: tabular-nums;
  color: var(--tinta);
  margin-top: .2rem;
}
.nota { font-size: .82rem; color: var(--tinta-suave); margin: .8rem 1rem 1rem; line-height: 1.45; }

/* ---------- herramientas ---------- */
.herramientas, .pasos, .faq { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) clamp(3.5rem, 7vw, 6rem); }
.sec-head { max-width: var(--medida); margin-bottom: 2rem; }
.sec-head p { color: var(--tinta-suave); margin: .6rem 0 0; }

.lista { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--tinta); }
.producto {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 1.5rem 2.5rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--raya);
  align-items: start;
}
.producto h3 { margin-bottom: .5rem; }
.producto .desc { margin: 0; max-width: 46ch; }
.producto .formato { font-size: .85rem; color: var(--tinta-suave); margin: .7rem 0 0; }
.producto ul { margin: 0; padding-left: 1.1rem; font-size: .95rem; }
.producto ul li { margin-bottom: .3rem; }
.producto ul li::marker { content: "✓  "; color: var(--sello); font-weight: 700; }
.compra { display: flex; flex-direction: column; align-items: flex-end; gap: 1rem; }

/* el sello: el precio estampado */
.sello {
  display: inline-block;
  font: 800 1.5rem/1 var(--f-display); font-variant-numeric: tabular-nums;
  color: var(--sello);
  border: 3px solid var(--sello);
  border-radius: 6px;
  padding: .45rem .7rem .4rem;
  transform: rotate(-6deg);
  opacity: .92;
  mix-blend-mode: multiply;
}
.sello-grande { font-size: 2rem; }

.pack {
  margin-top: 2.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap;
  padding: 1.6rem 1.8rem;
  border: 2px dashed var(--tinta); border-radius: 4px;
  background: #fff;
}
.pack p { margin: .4rem 0 0; color: var(--tinta-suave); }
.pack-buy { display: flex; align-items: center; gap: 1.5rem; }

/* ---------- pasos ---------- */
.pasos ol { margin: 1.8rem 0 0; padding: 0; list-style: none; counter-reset: paso; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.pasos li { counter-increment: paso; max-width: 34ch; }
.pasos li::before {
  content: counter(paso);
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; margin-bottom: .8rem;
  border: 2px solid var(--tinta); border-radius: 3px;
  font: 800 1rem/1 var(--f-display); color: var(--tinta); background: var(--casilla);
}
.pasos strong { display: block; color: var(--tinta); }

/* ---------- faq ---------- */
.faq h2 { margin-bottom: 1.2rem; }
.faq details { border-bottom: 1px solid var(--raya); max-width: var(--medida); }
.faq summary {
  cursor: pointer; padding: 1.1rem 0; font-weight: 700; color: var(--tinta); list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.3rem/1 var(--f-display); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 1.2rem; }

/* ---------- pie ---------- */
.pie {
  border-top: 2px solid var(--tinta);
  max-width: 1200px; margin: 0 auto; padding: 1.5rem var(--gutter) 2.5rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .9rem; color: var(--tinta-suave);
}
.pie p { margin: 0; }
.pie nav { display: flex; gap: 1.3rem; flex-wrap: wrap; }

/* ---------- diálogo de compra ---------- */
dialog {
  width: min(30rem, calc(100vw - 2rem));
  border: 2px solid var(--tinta); border-radius: 4px;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--papel); color: var(--texto);
  box-shadow: 8px 8px 0 var(--casilla);
}
dialog::backdrop { background: rgb(30 43 92 / .45); }
dialog h2 { font-size: 1.6rem; padding-right: 2rem; }
.cerrar { position: absolute; top: .6rem; right: .7rem; margin: 0; }
.cerrar button { border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--tinta); padding: .2rem .5rem; }
.compra-item {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .9rem 0; margin: 1rem 0;
  border-top: 1px solid var(--raya); border-bottom: 1px solid var(--raya);
}
.compra-item strong { color: var(--tinta); font-variant-numeric: tabular-nums; }
.check { display: grid; grid-template-columns: auto 1fr; gap: .7rem; font-size: .88rem; line-height: 1.45; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--tinta); }
.paypal-zona { margin-top: 1.2rem; min-height: 3rem; transition: opacity .2s; }
.paypal-zona[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.compra-aviso { font-size: .9rem; color: var(--sello); min-height: 1.2em; margin: .6rem 0 0; }
.descargas { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
.descarga {
  display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center;
  padding: .6rem 0; border-bottom: 1px solid var(--raya);
}
.d-nombre { font-weight: 600; color: var(--tinta); font-size: .92rem; line-height: 1.3; }
.descarga .btn { padding: .65rem .8rem; font-size: .88rem; text-align: center; }
.btn-sec { background: #fff; color: var(--tinta); border: 2px solid var(--tinta); }
.btn-sec:hover { background: var(--casilla); }
.descarga-todos { padding-top: .4rem; }
dialog .nota { margin: .9rem 0 0; }
.descarga-todos .btn { width: 100%; padding: .65rem .8rem; font-size: .88rem; }
@media (max-width: 480px) {
  .descarga { grid-template-columns: 1fr 1fr; }
  .d-nombre { grid-column: 1 / -1; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .producto { grid-template-columns: 1fr; gap: 1rem; }
  .compra { flex-direction: row; align-items: center; justify-content: space-between; }
  .pasos ol { grid-template-columns: 1fr; gap: 1.4rem; }
}
@media (max-width: 480px) {
  .campos { grid-template-columns: 1fr; }
  .campo:nth-child(odd) { border-right: 0; }
  .top nav { gap: 1rem; }
  .top nav a:first-child { display: none; }
}
