/* =====================================================================
   PLANTILLAS A4 - Balanzas Center
   Todas las medidas estan en milimetros sobre una hoja A4 (210 x 297).
   Cada zona tiene posicion y tamano FIJOS: el texto nunca empuja ni
   pisa a otra zona. Si no entra, el motor reduce la letra o lo pasa a
   la pagina siguiente.
   ===================================================================== */

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

.hoja {
  --azul: #17375E;
  --azul-titulo: #004489;
  --verde: #70AD47;
  --texto: #111;
  width: 210mm;
  height: 297mm;
  position: relative;
  overflow: hidden;
  background: #fff;
  color: var(--texto);
  font-family: "Dubai", "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  font-size: 11pt;
  line-height: 1.32;
  box-sizing: border-box;
  break-after: page;
  page-break-after: always;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.hoja:last-child { break-after: auto; page-break-after: auto; }
.hoja *, .hoja *::before, .hoja *::after { box-sizing: border-box; }
.hoja img.fondo { position: absolute; left: 0; top: 0; width: 210mm; height: 297mm; z-index: 0; }

/* Caja fija: tamano fijo, nada se sale. El "interior" mide el contenido. */
.hoja .caja { position: absolute; overflow: hidden; z-index: 1; }
.hoja .caja > .interior { display: flow-root; width: 100%; overflow-wrap: anywhere; }
.hoja .recortado { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* Area de contenido de las paginas de continuacion / condiciones / ficha */
.hoja .area { left: 15mm; top: 40mm; width: 180mm; height: 231mm; }
.hoja .area > .interior > :last-child { margin-bottom: 0; }

/* ---------- Elementos comunes ---------- */
.hoja .fecha { text-align: right; }
.hoja .barra {
  background: var(--azul);
  color: #fff;
  border-radius: 2mm;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .02em;
}
.hoja .barra .mitad { flex: 1 1 50%; height: 100%; position: relative; }
.hoja .barra .mitad .caja { left: 2mm; right: 2mm; top: 0; bottom: 0; display: flex; align-items: center; }
.hoja .barra .mitad .caja > .interior { text-align: center; line-height: 1.1; }
.hoja .barra-flujo { min-height: 8mm; padding: 1.4mm 4mm; justify-content: center; text-align: center; margin: 0 0 3mm; line-height: 1.15; }

.hoja ul.vinetas { margin: 0; padding: 0 0 0 5mm; list-style: disc; }
.hoja ul.vinetas li { margin: 0 0 .9mm; padding-left: .8mm; white-space: pre-line; }

.hoja .datos { display: grid; grid-template-columns: 31mm 3mm 1fr; row-gap: .6mm; text-transform: uppercase; }
.hoja .datos .et { overflow-wrap: anywhere; }
.hoja .datos .va { white-space: pre-line; }

.hoja .titulo-azul { color: var(--azul-titulo); font-weight: 700; font-size: 1.12em; text-transform: uppercase; margin: 0 0 1.5mm; }

/* ---------- Cotizacion: pagina 1 ---------- */
.cot .c-fecha    { left: 80mm;  top: 36mm; width: 116mm; height: 7mm; }
.cot .c-encabezado { left: 14mm; top: 43.5mm; width: 182mm; height: 24.5mm; }
.cot .c-encabezado .cli { margin-bottom: 1.6mm; }
.cot .c-encabezado .sal { font-size: 11pt; }
.cot .c-barra    { position: absolute; left: 12mm; top: 69mm; width: 186mm; height: 9.5mm; z-index: 1; }
.cot .c-foto     { position: absolute; left: 13mm; top: 82mm; width: 86mm; height: 84mm; z-index: 1; display: flex; align-items: center; justify-content: center; }
.cot .c-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cot .c-datos    { left: 13mm;  top: 168mm; width: 88mm; height: 54mm; }
.cot .c-propuesta{ left: 13mm;  top: 224mm; width: 88mm; height: 46mm; }
.cot .c-vinetas  { left: 104mm; top: 82mm; width: 93mm; height: 188mm; }
.cot .c-vinetas ul.vinetas li { margin-bottom: .7mm; }

.hoja .precios { display: grid; grid-template-columns: 1fr 10mm 27mm; column-gap: 2mm; row-gap: .8mm; align-items: baseline; padding: 0 1.5mm; }
.hoja .precios .mon { text-align: left; }
.hoja .precios .monto { text-align: right; white-space: nowrap; }
.hoja .precios .total { display: contents; }
.hoja .precio-total {
  display: grid; grid-template-columns: 1fr 10mm 27mm; column-gap: 2mm; align-items: baseline;
  border: .35mm solid var(--verde); padding: .6mm 1.5mm; margin: 1.2mm 0 0;
}
.hoja .precio-total .monto { text-align: right; white-space: nowrap; }
.hoja .nota-precio { font-size: .8em; color: #444; margin-top: 1mm; }

/* ---------- Condiciones / bancos / asesora ---------- */
.hoja .bloque { margin: 0 0 4mm; }
.hoja .banco-nombre { font-size: 1.15em; text-transform: uppercase; margin: 0 0 1mm; }
.hoja table.tabla { width: 100%; border-collapse: collapse; }
.hoja table.tabla td { border: .25mm solid #222; padding: .5mm 1.6mm; vertical-align: top; font-size: .92em; }
.hoja table.bancos td:first-child { width: 62%; text-transform: uppercase; }
.hoja table.bancos td:last-child { text-align: center; }
.hoja .asesora { text-transform: uppercase; line-height: 1.5; }

/* ---------- Ficha tecnica ---------- */
.hoja .f-cabecera { display: flex; justify-content: flex-end; gap: 6mm; margin: 0 0 2mm; text-transform: uppercase; font-size: .95em; }
.hoja .f-cabecera .f-cliente { margin-right: auto; }
.hoja .f-cabecera .f-fecha { white-space: nowrap; flex: 0 0 auto; }
.hoja .f-titulo { height: 15mm; position: relative; margin: 0 0 3mm; }
.hoja .f-titulo .caja { left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; }
.hoja .f-titulo .caja > .interior { text-align: center; font-weight: 700; color: var(--azul); text-transform: uppercase; line-height: 1.15; }
.hoja table.ficha td { padding: 1.1mm 2mm; font-size: 1em; }
.hoja table.ficha td.et { width: 42%; font-weight: 700; }
.hoja table.ficha td.va { white-space: pre-line; }
.hoja table.ficha tr { break-inside: avoid; }
.hoja .f-precio { margin: 4mm 0 0; display: flex; justify-content: flex-end; }
.hoja .f-precio .precio-total { min-width: 100mm; margin: 0; grid-template-columns: 1fr 10mm 27mm; }
.hoja .figura { margin: 4mm 0 0; text-align: center; }
.hoja .figura img { max-width: 100%; object-fit: contain; display: block; margin: 0 auto; }
.hoja .figura .pie { font-size: .9em; margin-top: 1mm; text-transform: uppercase; }
.hoja .continuacion { font-size: .9em; color: #333; text-transform: uppercase; margin: 0 0 2mm; }
.hoja .cont-sep { margin-top: 4mm; }

/* Pagina en blanco de aviso (no deberia verse nunca) */
.hoja .vacio { color: #999; }
