/**
 * print-informe.css — Informe PDF de los simuladores
 * Se encola con media="print" SOLO en las plantillas de simuladores:
 * cero impacto en pantalla y en Core Web Vitals.
 *
 * El flujo: el botón "Descargar informe (PDF)" (print-informe.js) lanza
 * window.print(); esta hoja oculta el sitio y deja un informe con la
 * cabecera de marca, los resultados tal y como se ven en pantalla
 * (colores forzados) y el pie con el disclaimer.
 */

@page {
    margin: 12mm;
}

/* ─── Ocultar el sitio ─────────────────────────────────────── */
#wpadminbar,
#masthead,
.site-header,
.kadence-sticky-header,
.sim-hero,
.sim-seo,
.sim-faq,
.crr-footer,
.ic-table-toggle,
.sim-tabla-toggle,
.crr-print-bar {
    display: none !important;
}

html, body {
    background: #ffffff !important;
}

.site-main {
    padding-top: 0 !important;
}

.crr-container {
    width: 100% !important;
}

/* ─── Cabecera de marca (oculta en pantalla vía [hidden]) ──── */
.crr-print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8mm;
    background: #0d1f3c !important;
    border-radius: 8px;
    padding: 6mm 8mm;
    margin-bottom: 8mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.crr-print-header img {
    max-height: 22mm;
    width: auto;
}

.crr-print-header__meta {
    text-align: right;
    color: rgba(255, 255, 255, 0.85);
    font-size: 10pt;
    line-height: 1.5;
}

.crr-print-header__meta strong {
    display: block;
    color: #ffffff;
    font-size: 11pt;
}

.crr-print-header__meta .crr-print-url {
    color: #00C896;
    font-weight: 600;
}

/* ─── Resultados: se imprimen tal y como se ven ────────────── */
.sim-results-section {
    display: block !important;
    background: #ffffff !important;
    border-top: none !important;
    padding: 0 !important;
    animation: none !important;
}

.sim-results-section,
.sim-results-section * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Las tablas se incluyen SIEMPRE desplegadas en el informe.
   Dos familias de markup: .ic-table-body (mayoría) y
   .sim-tabla-body (hipoteca y coste de vida) */
.ic-table-body[hidden],
.sim-tabla-body[hidden] {
    display: block !important;
}

/* Evitar cortes feos entre páginas */
.sim-veredicto,
.sim-kpi,
.ic-escenario,
.sim-chart-wrap,
.crr-print-header,
tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

canvas {
    max-width: 100% !important;
}

/* ─── Pie con disclaimer (oculto en pantalla vía [hidden]) ─── */
.crr-print-footer {
    display: block !important;
    margin-top: 8mm;
    padding-top: 4mm;
    border-top: 1px solid #cbd5e1;
    font-size: 8.5pt;
    line-height: 1.55;
    color: #64748b;
}
