/* ============================================================
   CERADI · Versión de impresión (A4 vertical, 210 × 297 mm)
   ------------------------------------------------------------
   Cada .hoja es una página exacta. Las medidas van en mm y pt
   para que lo que se ve en la vista previa sea lo que sale
   por la impresora o en el PDF.
   ============================================================ */

@page {
  size: A4;
  margin: 0;
}

#impresion,
.previa-barra { display: none; }

/* ---------- Vista previa en pantalla ---------- */

html.vista-impresion body { background: #e8e7f0; }
html.vista-impresion #web { display: none; }
html.vista-impresion #impresion {
  display: block;
  padding: 92px 12px 48px;
}
html.vista-impresion .previa-barra {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linea);
}
.previa-barra p {
  font-size: 14px;
  font-weight: 600;
  color: var(--indigo);
  text-align: center;
}
@media (max-width: 760px) {
  .previa-barra p { display: none; }
  .previa-barra .btn { padding: 0 14px; font-size: 14px; }
}

html.vista-impresion .hoja {
  zoom: var(--escala, 1);
  margin: 0 auto 28px;
  box-shadow: 0 4px 30px rgba(35, 26, 94, 0.18);
}

/* ---------- Al imprimir ---------- */

@media print {
  html, body { background: #fff !important; }
  #web, .ficha, .previa-barra { display: none !important; }
  #impresion { display: block !important; padding: 0 !important; }
  .hoja {
    zoom: 1 !important;
    margin: 0 !important;
    box-shadow: none !important;
    break-after: page;
    break-inside: avoid;
  }
  .hoja:last-child { break-after: auto; }
  .hoja, .hoja * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================================
   Hoja base
   ============================================================ */

.hoja {
  position: relative;
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  background: #fff;
  color: var(--tinta);
  font-family: var(--f);
  font-size: 10pt;
  line-height: 1.35;
}
.hoja img { display: block; }
.hoja h2, .hoja h3, .hoja p { margin: 0; }

/* Cabecera y pie de las páginas interiores (alternan lado como en un pliego) */
.ph {
  position: absolute;
  top: 12mm; left: 15mm; right: 15mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ph img { height: 15mm; width: auto; }
.ph p {
  font-size: 9.5pt;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
}
.ph p b {
  margin-right: 2mm;
  font-weight: 900;
  font-stretch: 125%;
}
.pf {
  position: absolute;
  bottom: 10mm; left: 15mm; right: 15mm;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 9pt;
  font-weight: 500;
  color: var(--indigo);
}
.pf b {
  font-size: 11pt;
  font-weight: 900;
  font-stretch: 125%;
  font-variant-numeric: tabular-nums;
}
.hoja.impar .ph,
.hoja.par .pf { flex-direction: row-reverse; }

/* ============================================================
   Portada
   ============================================================ */

.hoja--portada { background: var(--indigo); color: #fff; }
.pp__logo {
  position: absolute;
  top: 15mm; left: 16mm;
  width: 42mm; height: auto;
}
.pp__web {
  position: absolute;
  top: 24mm; right: 16mm;
  font-size: 11pt;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pp__titulo {
  position: absolute;
  top: 58mm; left: 16mm; right: 16mm;
}
.pp__titulo span {
  display: block;
  font-size: 16pt;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pp__titulo strong {
  display: block;
  margin: 4mm 0 0 -2.5mm;
  font-size: 164pt;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--rosa);
}
.pp__base {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70mm;
  background: linear-gradient(90deg, #ffe6ec 0%, var(--rosa) 100%);
}
.pp__franja {
  position: absolute;
  left: 0; top: 150mm;
  width: 108mm; height: 8.5mm;
  background: linear-gradient(90deg, #5a5fe0 0%, var(--agua) 100%);
  transform-origin: left top;
  transform: skewY(-8.13deg);
}
.pp__foto {
  position: absolute;
  left: 0; top: 128mm;
  width: 210mm; height: 125mm;
  clip-path: polygon(0 24%, 100% 0, 100% 100%, 0 86%);
}
.pp__foto img { width: 100%; height: 100%; object-fit: cover; }
.pp__contacto {
  position: absolute;
  left: 16mm; bottom: 14mm;
  margin: 0; padding: 0;
  list-style: none;
  font-size: 12pt;
  line-height: 1;
  color: var(--indigo);
}
.pp__contacto li {
  display: flex;
  align-items: center;
  gap: 3mm;
  margin-top: 3mm;
}
.pp__contacto li b { font-weight: 700; }
.pp__contacto svg {
  width: 6mm; height: 6mm;
  padding: 1.4mm;
  border-radius: 50%;
  background: var(--indigo);
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pp__qr {
  position: absolute;
  right: 16mm; bottom: 12mm;
  display: flex;
  align-items: flex-end;
  gap: 4mm;
  text-align: right;
  color: var(--indigo);
}
.pp__qr p { font-size: 8.5pt; font-weight: 600; line-height: 1.3; }
.pp__qr p b {
  display: block;
  font-size: 10pt;
  font-weight: 800;
  font-stretch: 112%;
}
.pp__qr img {
  width: 26mm; height: 26mm;
  padding: 2mm;
  border-radius: 3mm;
  background: #fff;
}

/* ============================================================
   Índice
   ============================================================ */

.hoja--indice {
  background: linear-gradient(135deg, #fff 0%, #e9f6f7 45%, var(--agua) 100%);
}
.pi__tit {
  position: absolute;
  top: 46mm; left: 15mm;
  font-size: 58pt;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--indigo);
}
.pi__pres {
  position: absolute;
  top: 73mm; left: 15mm;
  width: 118mm;
  font-size: 11.5pt;
  line-height: 1.4;
  color: #3f3a66;
}
.pi__lista {
  position: absolute;
  top: 100mm; left: 15mm; right: 15mm;
  margin: 0; padding: 0;
  list-style: none;
}
.pi__lista li {
  display: grid;
  grid-template-columns: 13mm auto 1fr auto;
  align-items: baseline;
  column-gap: 0;
  height: 14.5mm;
  padding-top: 4.2mm;
  border-top: 0.3mm solid rgba(51, 38, 130, 0.22);
  color: var(--indigo);
}
.pi__lista li:last-child { border-bottom: 0.3mm solid rgba(51, 38, 130, 0.22); }
.pi__num {
  font-size: 9.5pt;
  font-weight: 900;
  font-stretch: 125%;
}
.pi__nombre { font-size: 15pt; font-weight: 700; }
.pi__n {
  padding-left: 4mm;
  font-size: 9pt;
  font-weight: 500;
  color: #5f5a80;
}
.pi__pag {
  font-size: 15pt;
  font-weight: 900;
  font-stretch: 125%;
  font-variant-numeric: tabular-nums;
}
.pi__digital {
  position: absolute;
  left: 15mm; right: 15mm; bottom: 24mm;
  display: flex;
  align-items: center;
  gap: 7mm;
  padding: 5mm;
  border-radius: 5mm;
  background: #fff;
}
.pi__digital img { width: 30mm; height: 30mm; flex: none; }
.pi__digital b {
  display: block;
  margin-bottom: 1.5mm;
  font-size: 14pt;
  font-weight: 800;
  font-stretch: 110%;
  color: var(--indigo);
}
.pi__digital p { max-width: 100mm; font-size: 10pt; color: #3f3a66; }

/* ============================================================
   Apertura de línea
   ============================================================ */

.hoja--apertura {
  --tono: var(--agua);
  background: linear-gradient(180deg, #fff 30%, var(--tono) 100%);
}
.hoja--apertura[data-tono="1"] { --tono: #f9c9dc; }
.hoja--apertura[data-tono="2"] { --tono: #c3e6fb; }
.pa__foto {
  position: absolute;
  top: 0; left: 0;
  width: 210mm; height: 150mm;
  clip-path: polygon(0 0, 100% 0, 100% 76%, 0 100%);
}
.pa__foto img { width: 100%; height: 100%; object-fit: cover; }
.pa__franja {
  position: absolute;
  right: 0; top: 114mm;
  width: 120mm; height: 12mm;
  background: var(--indigo);
  transform-origin: right top;
  transform: skewY(-9.73deg);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}
.pa__cuerpo {
  position: absolute;
  top: 163mm; left: 15mm; right: 15mm;
}
.pa__num {
  display: block;
  margin-left: -2.5mm;
  font-size: 170pt;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.03em;
  color: var(--indigo);
}
.pa__txt { margin-top: 9mm; }
.pa__nombre {
  font-size: 34pt;
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.05;
  color: var(--indigo);
}
.pa__desc {
  max-width: 130mm;
  margin-top: 3mm !important;
  font-size: 13pt;
  line-height: 1.35;
  color: #3f3a66;
}
.pa__cuenta {
  margin-top: 5mm !important;
  font-size: 10pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
}

/* ============================================================
   Páginas de producto · 6 por página (2 × 3)
   ============================================================ */

.pg {
  position: absolute;
  top: 36mm; left: 15mm; right: 15mm; bottom: 24mm;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 7mm 8mm;
}
.pc {
  --fondo: var(--cielo);
  display: grid;
  grid-template-columns: 43mm 1fr;
  min-height: 0;
}
.pc:nth-child(4n + 1),
.pc:nth-child(4n) { --fondo: var(--rosa-suave); }
.pc__img {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 5mm;
  background: var(--fondo);
  overflow: hidden;
}
/* Las fotos actuales traen mucho margen blanco: se amplían y el margen
   desaparece al multiplicar sobre el color del fondo. */
.pc__img img {
  position: absolute;
  top: 50%; left: 50%;
  width: 58mm; height: 58mm;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  mix-blend-mode: multiply;
}
.pc__img--sin img {
  position: static;
  transform: none;
  width: 22mm; height: auto;
  mix-blend-mode: normal;
  opacity: 0.35;
}
.pc__txt {
  align-self: center;
  padding-left: 5.5mm;
}
.pc__txt h3 {
  font-size: 13.5pt;
  font-weight: 800;
  font-stretch: 106%;
  line-height: 1.14;
  color: var(--indigo);
}
.pc__cod {
  margin-top: 4.5mm !important;
  line-height: 1;
}
.pc__cod span,
.pc__specs dt {
  display: block;
  font-size: 6.8pt;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5f5a80;
}
.pc__cod b {
  display: block;
  margin-top: 1.2mm;
  font-size: 21pt;
  font-weight: 900;
  font-stretch: 125%;
  font-variant-numeric: tabular-nums;
  color: var(--indigo);
}
.pc__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3mm;
  margin: 4.5mm 0 0;
  padding-top: 3mm;
  border-top: 0.3mm solid var(--linea);
}
.pc__specs dd {
  margin: 0.8mm 0 0;
  font-size: 11pt;
  font-weight: 700;
  color: var(--tinta);
}

/* ============================================================
   Contraportada
   ============================================================ */

.hoja--contra {
  background: var(--indigo);
  color: #fff;
  text-align: center;
}
.pb__logo {
  position: absolute;
  top: 92mm; left: 50%;
  width: 78mm; height: auto;
  transform: translateX(-50%);
}
.pb__contacto {
  position: absolute;
  top: 150mm; left: 0; right: 0;
  font-size: 13pt;
  line-height: 1.7;
}
.pb__contacto b { font-weight: 700; }
.pb__contacto small { display: block; margin-top: 2mm; font-size: 10pt; opacity: 0.75; }
.pb__qr {
  position: absolute;
  left: 0; right: 0; bottom: 26mm;
}
.pb__qr img {
  width: 32mm; height: 32mm;
  margin: 0 auto;
  padding: 2.5mm;
  border-radius: 4mm;
  background: #fff;
}
.pb__qr p {
  margin-top: 4mm !important;
  font-size: 10pt;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rosa);
}
