/* Documento descargable (5 o 6 páginas A4) del portal. Derivado del CSS de la V3 (nodo «Recursos visuales»,
   generado desde prototipos/documento-cotizacion), con cada selector bajo .pdf para no chocar con el portal.
   Reglas propias del portal al final. */
.pdf{--paper:#fffaf6;--ink:#002039;--cyan:#00b0e9;--pink:#ff01bb;--yellow:#ffd600;--line:#d5dadd;--gray:#b5bcc2;--green:#2dab64}
.pdf *{box-sizing:border-box}
.pdf{margin:0;background:#e8edef;color:#252525;font-family:Arial,Helvetica,sans-serif}
.pdf .sheet{position:relative;width:794px;min-height:1123px;margin:0 auto 28px;padding:48px 62px 190px;background:var(--paper);box-shadow:0 12px 45px #1632461c;overflow:hidden}
.pdf .ribbon{position:absolute;top:0;right:0;width:310px;height:140px;pointer-events:none}
.pdf .ribbon:before{content:"";position:absolute;inset:0;background:var(--cyan);clip-path:polygon(25% 0,100% 0,100% 100%,0 65%)}
.pdf .ribbon:after{content:"";position:absolute;inset:0;background:var(--pink);clip-path:polygon(0 0,34% 0,18% 29%,100% 62%,100% 100%,0 58%)}
.pdf .logo{display:flex;gap:8px;align-items:center;color:#292929;font-size:28px;font-weight:800;letter-spacing:-1.3px;position:relative}
.pdf .logo svg{width:42px;height:37px;flex:none}
.pdf h1{font-size:63px;line-height:1.04;letter-spacing:-2.5px;color:var(--ink);margin:17px 0 8px}
.pdf .number{font-size:20px;font-weight:700;color:var(--ink);letter-spacing:1px}
.pdf .status{display:inline-block;margin-top:12px;background:#fff0d5;color:#875909;border:1px solid #e9ca8e;border-radius:4px;padding:5px 8px;font-size:10px;font-weight:bold;letter-spacing:.8px}
.pdf .parties{display:grid;grid-template-columns:1fr 1fr;gap:42px;margin:27px 0 20px}
.pdf .party:last-child{text-align:right}
.pdf .label{display:inline-block;background:var(--ink);color:white;font-size:12px;padding:7px 11px;margin-bottom:8px}
.pdf .party p{font-size:12px;line-height:1.65;margin:0}
.pdf .party strong{font-size:14px}
.pdf .muted{color:#6b7277}
.pdf .meta{display:flex;justify-content:space-between;gap:10px;border-top:1px solid #e3dfdb;border-bottom:1px solid #e3dfdb;padding:10px 0;margin-bottom:19px;font-size:10px;color:#5e6870}
.pdf .meta b{color:var(--ink)}
.pdf table{width:100%;border-collapse:collapse;font-size:11px}
.pdf thead{display:table-header-group}
.pdf th{background:var(--gray);padding:10px 8px;border:4px solid var(--paper);border-top:0;color:#20292e;text-align:center}
.pdf th:first-child{text-align:left;width:52%;padding-left:12px}
.pdf td{padding:13px 10px;border-bottom:1px solid var(--line);vertical-align:top;line-height:1.45}
.pdf td:first-child{padding-left:12px}
.pdf td:not(:first-child){text-align:right;white-space:nowrap}
.pdf td:nth-child(2){text-align:center}
.pdf tr{break-inside:avoid}
.pdf .product{color:var(--ink);font-weight:700;text-decoration:underline;text-underline-offset:3px;font-size:12px}
.pdf .desc{margin:6px 0 0;font-size:10px;color:#616b72;line-height:1.55}
.pdf .variant{font-size:9px;color:#7a8185;margin-top:5px}
.pdf .totals{width:280px;margin:15px 0 0 auto;font-size:12px}
.pdf .total-row{display:flex;justify-content:space-between;padding:8px 10px;border-bottom:1px solid #dedfe0}
.pdf .total-row.final{background:var(--ink);color:#fff;font-size:16px;font-weight:bold;padding:12px 10px;margin-top:5px}
.pdf .discount{color:#477759}
.pdf .note{margin-top:21px;padding:12px 14px;border-left:3px solid var(--cyan);background:#eef8fa;font-size:10px;line-height:1.65}
.pdf .closing{margin-top:37px;display:flex;justify-content:space-between;align-items:end;gap:20px}
.pdf .signature{width:215px;padding-top:9px;border-top:1px solid #75818a;font-size:11px;line-height:1.6}
.pdf .signature b{color:var(--ink)}
.pdf .closing .muted{max-width:225px;text-align:right;font-size:10px;line-height:1.6}
.pdf .footer{position:absolute;bottom:0;left:0;right:0;height:133px;background:var(--cyan);color:#fff;padding:28px 62px;overflow:hidden}
.pdf .footer .contact{position:relative;z-index:2;font-size:12px;line-height:2}
.pdf .footer small{font-size:9px;opacity:.9}
.pdf .footer:before{content:"";position:absolute;right:-35px;top:8px;width:225px;height:170px;background:var(--yellow);transform:skewY(-30deg)}
.pdf .footer:after{content:"";position:absolute;right:-15px;top:75px;width:170px;height:120px;background:var(--pink);transform:skewY(-30deg)}
.pdf .foot-pageno{position:absolute;right:29px;bottom:15px;z-index:3;font-size:9px;color:var(--ink)}
@page{size:A4;margin:0}
@media print{.pdf{background:white;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.pdf .sheet{width:210mm;min-height:297mm;margin:0;box-shadow:none;page-break-after:always}}
.pdf .sheet{padding-top:36px;padding-bottom:160px}
.pdf h1{font-size:56px;margin-top:12px}
.pdf .parties{margin-top:18px;margin-bottom:14px}
.pdf .meta{margin-bottom:14px}
.pdf .total-row{padding:6px 10px}
.pdf .note{margin-top:15px}
.pdf .closing{margin-top:22px}
.pdf td{padding-top:10px;padding-bottom:10px}
.pdf .sheet{padding-top:28px;padding-bottom:150px}
.pdf h1{font-size:50px}
.pdf .party p{line-height:1.45}
.pdf .parties{margin-top:14px}
.pdf .total-row{padding:4px 10px}
.pdf .closing{margin-top:16px}
.pdf .note{padding:9px 12px}
.pdf .sheet{height:1123px;min-height:1123px;break-after:page;page-break-after:always}
.pdf .sheet:last-of-type{break-after:auto;page-break-after:auto}
.pdf .brand{height:40px;position:relative;z-index:1}
.pdf .brand img{width:185px;height:auto;display:block;mix-blend-mode:multiply}
.pdf .page-tag{position:absolute;bottom:15px;left:35px;font-size:9px;color:#60717c}
.pdf .eyebrow{font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#68747b}
.pdf .demo-mark{font-size:10px;letter-spacing:1px;border:1px solid #d9bd81;color:#825a18;background:#fff2d7;padding:6px 10px;display:inline-block}
.pdf .cover{padding:64px 62px 45px}
.pdf .cover .cover-logo{width:100%;mix-blend-mode:multiply}
.pdf .cover h2{font-size:40px;letter-spacing:-2px;text-align:right;margin:13px 0 30px;color:var(--pink)}
.pdf .cover .hero{width:100%;height:445px;object-fit:cover;display:block}
.pdf .cover .cover-summary{display:grid;grid-template-columns:1fr 1fr;gap:20px;background:var(--ink);color:white;padding:22px;margin-top:0}
.pdf .cover-summary small{font-size:10px;opacity:.75;display:block;margin-bottom:8px}
.pdf .cover-summary strong{font-size:17px}
.pdf .cover .cover-bottom{display:flex;justify-content:space-between;align-items:end;margin-top:30px;gap:15px}
.pdf .cover .cover-bottom p{font-size:12px;line-height:1.8}
.pdf .product-page{padding:38px 46px 75px}
.pdf .product-page h2{font-size:29px;color:white;background:var(--green);padding:17px;margin:22px -46px 15px;letter-spacing:-.6px}
.pdf .product-photo{width:100%;height:255px;object-fit:contain;border:1px solid #e4e1dc;background:var(--paper)}
.pdf .product-body{padding:18px 14px;border:1px solid #b3b6b5;border-top:none}
.pdf .product-body h3{font-size:17px;color:var(--ink);margin:0 0 12px}
.pdf .product-body p{font-size:13px;line-height:1.7;margin:0 0 14px}
.pdf .features{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}
.pdf .feature{background:#f0f1eb;padding:12px;font-size:12px;line-height:1.7}
.pdf .feature b{display:block;color:var(--ink)}
.pdf .product-link{color:var(--ink);font-size:12px}
.pdf .pending{border-left:3px solid #c7aa62;background:#fff4de;padding:12px;font-size:11px;line-height:1.7;margin-top:18px}
.pdf .social-page{padding:46px 46px 30px}
.pdf .social-page h2{color:var(--cyan);font-size:38px;line-height:1.2;letter-spacing:-1px;margin:25px 0}
.pdf .social-page .lead{font-size:22px;line-height:1.5;margin:20px 0}
.pdf .social-page .collage{width:794px;margin:20px -46px 0;height:565px;object-fit:cover;object-position:top}
.pdf .social-page .caption{font-size:10px;line-height:1.6;color:#68747b;margin-top:14px}
.pdf .terms-page{padding:47px 48px 120px}
.pdf .terms-page h2{font-size:43px;line-height:1.1;letter-spacing:-1.5px;margin:25px 0}
.pdf .terms-meta{padding:15px 0;font-size:13px;line-height:1.8;border-bottom:1px solid #d5dadd}
.pdf .terms-page ul{padding-left:20px;margin:18px 0}
.pdf .terms-page li{font-size:13px;line-height:1.65;margin-bottom:14px}
.pdf .terms-page li b{color:var(--ink)}
.pdf .terms-page .closing-text{text-align:center;font-size:16px;font-weight:bold;line-height:1.6;color:var(--ink);margin-top:22px}
.pdf .terms-page .bottom-logo{display:block;width:260px;margin:20px auto;mix-blend-mode:multiply}
.pdf .terms-footer{position:absolute;bottom:0;left:0;right:0;padding:20px 48px;background:#eeece8;font-size:11px;color:#566773}
@media print{.pdf .sheet{height:297mm;min-height:297mm;width:210mm;overflow:hidden}
.pdf .sheet:last-of-type{break-after:auto;page-break-after:auto}
.pdf a{color:inherit}}
.pdf .sheet.economic-cont h2{font-size:22px;color:var(--ink)}

/* ---------- propio del portal */
.pdf { display: none; background: transparent; }
body.ver-pdf .pdf { display: block; margin-top: 28px; }
@media screen { body.ver-pdf .pdf { zoom: var(--escala-hoja, 1); } }   /* ajustarHojas en app.js */
body.ver-pdf .documento { display: none; }
.pdf .sheet { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.pdf .marca-texto { font-size: 30px; font-weight: 900; letter-spacing: -1.4px; color: var(--ink); }
.pdf .marca-texto.cover-logo { font-size: 92px; letter-spacing: -5px; }
.pdf .marca-texto.bottom-logo { text-align: center; font-size: 46px; margin: 20px auto; }
.pdf .hero-vacio { background: linear-gradient(90deg, var(--cyan) 0 52%, var(--pink) 52% 79%, var(--yellow) 79%); }
.pdf .cover-summary .contacto { display: block; font-size: 12px; margin-top: 4px; }
.pdf .number .revision { font-size: 11px; letter-spacing: 0; font-weight: 400; }
.pdf .total-row.fuerte { font-weight: 700; }
.pdf .nota-total, .pdf .continua { text-align: right; }
.pdf .social-page h2.lineas { white-space: pre-line; }
.pdf .terms-footer .derecha { float: right; }
.pdf .fichas { display: grid; gap: 14px; }
.pdf .ficha { display: grid; grid-template-columns: 190px 1fr; gap: 18px; min-height: 196px; padding: 12px; background: #fff; border: 1px solid #e4e1dc; break-inside: avoid; }
.pdf .ficha img, .pdf .ficha .sin-foto { width: 190px; height: 172px; object-fit: contain; background: var(--paper); }
.pdf .ficha .sin-foto { display: grid; place-items: center; padding: 12px; text-align: center; font-size: 11px; color: #68747b; border: 1px dashed #c9cfd4; }
.pdf .ficha h3 { font-size: 16px; color: var(--ink); margin: 2px 0 8px; }
.pdf .ficha p { font-size: 12px; line-height: 1.55; margin: 0 0 8px; color: #41515c; }
.pdf .ficha .datos { font-size: 11px; line-height: 1.7; color: #4b5860; margin-bottom: 6px; }
.pdf .ficha .datos b { color: var(--ink); }
.pdf .ficha a { color: var(--ink); font-size: 11px; }

/* La descarga imprime solo el documento completo, con sus colores y en hojas A4 sin márgenes. */
@media print {
  html, body { background: #fff !important; }
  #app > header, .barra-documento, .documento, .avisos, .velo { display: none !important; }
  main.contenido { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .pdf { display: block !important; margin: 0 !important; }
  .pdf .sheet { margin: 0 !important; box-shadow: none !important; }
}
.pdf .opcion-titulo { font-size: 22px; margin: 6px 0 10px; color: var(--ink); }
.pdf .sheet.economic-cont h2 { max-width: 66%; }
/* Resumen de opciones en la hoja 2 (05/11): una fila corta por opción, para que quepan hasta cinco con la firma */
.pdf .resumen-opciones table { table-layout: fixed; }
.pdf .resumen-opciones td { padding-top: 8px; padding-bottom: 8px; }
.pdf .resumen-opciones td .desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
/* Papel más bajo que A4 (US Letter, el de Safari en el iPhone, 05/11): la hoja de 297 mm se pasaba a la página
   siguiente y el PDF salía con el doble de páginas, casi en blanco. Se reduce al 94 % para que cada hoja quepa en una. */
@media print and (max-height: 290mm) {
  .pdf { zoom: .94; }
  .pdf .sheet { margin: 0 auto !important; }
}
.pdf .total-row.descuento { color: #a3006f; }
