@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
    --azul: #1a3553;
    --azul-2: #234e7a;
    --azul-3: #2c5f94;
    --rojo: #ff3040;
    --fondo: #f0f4f8;
    --superficie: #ffffff;
    --superficie-suave: #f6f9fc;
    --linea: #dce5ef;
    --linea-suave: #edf2f7;
    --texto: #0d1f35;
    --texto-2: #52657d;
    --texto-3: #7b8da4;
    --radio: 18px;
    --radio-control: 12px;
    --sombra: 0 1px 2px rgba(13, 31, 53, 0.08), 0 8px 24px rgba(13, 31, 53, 0.06);
    --font-ui: 'Inter', Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--fondo);
    color: var(--texto);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.contenedor {
    width: 100%;
    margin: 0;
    padding: 0;
}

body:has(.contenedor) {
    display: block;
}

.no-print {
    min-height: 100vh;
    padding-bottom: 44px;
}

.encabezado-formulario {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding: 18px 32px;
    background: var(--azul);
    box-shadow: 0 12px 30px rgba(13, 31, 53, 0.16);
}

.accion-regresar-formulario {
    display: flex;
    justify-content: flex-start;
}

.accion-reset-formulario {
    display: flex;
    justify-content: flex-end;
}

.btn-regresar-inicio,
.btn-reset-cotizacion,
#btnAgregarProducto,
.btn-producto-nuevo,
#btnGenerarCotizacion,
#btnImprimirCotizacion,
#btnEditarDatos,
.btn-eliminar-producto,
#btnCerrarNuevoProducto,
.acciones-producto-nuevo button {
    min-height: 42px;
    border: 0;
    border-radius: var(--radio-control);
    font-weight: 700;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.btn-regresar-inicio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    text-decoration: none;
    background: transparent;
}

.btn-regresar-inicio::before {
    content: "<-";
    margin-right: 7px;
    font-weight: 700;
}

.btn-regresar-inicio:hover {
    border-color: rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.08);
}

.btn-reset-cotizacion {
    padding: 0 18px;
    background: var(--rojo);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(255, 48, 64, 0.24);
}

.btn-reset-cotizacion:hover {
    background: #e92434;
}

.identidad-formulario {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-formulario {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    min-height: 58px;
    padding: 8px 18px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(13, 31, 53, 0.06);
}

.logo-formulario img {
    display: block;
    max-width: 190px;
    max-height: 44px;
    object-fit: contain;
}

.identidad-formulario .eyebrow-formulario,
.identidad-formulario h1 {
    display: none;
}

.cotizador-card,
.datos-formulario-grid,
.acciones-formulario {
    width: min(1120px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}

.cotizador-card {
    margin-top: 26px;
    padding: 26px;
    border: 1px solid var(--linea-suave);
    border-radius: var(--radio);
    background: var(--superficie);
    box-shadow: var(--sombra);
}

.seccion-titulo,
.productos-agregados-header,
.campo-editable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.seccion-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--texto-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cotizador-card h2,
.cotizador-card h3 {
    margin: 0;
    color: var(--texto);
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.25;
}

.producto-precio-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 28px;
    margin-top: 22px;
}

.producto-busqueda-area,
.producto-precio-area {
    min-width: 0;
}

label,
.producto-precio-area > label,
.producto-busqueda-area > label {
    display: block;
    margin-bottom: 8px;
    color: var(--texto-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--linea);
    border-radius: var(--radio-control);
    outline: none;
    background: #ffffff;
    color: var(--texto);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea {
    min-height: 112px;
    resize: vertical;
    line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--azul-2);
    box-shadow: 0 0 0 3px rgba(35, 78, 122, 0.16);
}

.buscador-wrap {
    position: relative;
}

.buscador-wrap::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid #8da0b7;
    border-radius: 50%;
    transform: translateY(-56%);
    z-index: 1;
}

.buscador-wrap::after {
    content: "";
    position: absolute;
    left: 26px;
    top: 26px;
    width: 7px;
    height: 2px;
    background: #8da0b7;
    transform: rotate(45deg);
    z-index: 1;
}

#buscarProducto {
    padding-left: 44px;
}

.resultados {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--linea);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(13, 31, 53, 0.16);
}

.resultado-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--linea-suave);
    color: var(--texto);
}

.resultado-item:hover {
    background: var(--superficie-suave);
}

.resultado-precio {
    color: var(--azul-2);
    font-weight: 700;
    white-space: nowrap;
}

.producto-precio-area {
    padding-left: 28px;
    border-left: 1px solid var(--linea-suave);
}

.precio-manual-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 14px;
    border-radius: 16px;
    background: var(--superficie-suave);
}

.precio-manual-box span {
    color: var(--azul);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
}

.precio-manual-box input {
    min-height: 34px;
    padding: 6px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--azul);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
}

.precio-manual-box input:focus {
    box-shadow: none;
}

.producto-precio-area small {
    display: block;
    margin-top: 8px;
    color: var(--texto-3);
}

.cantidad-acciones-producto {
    display: grid;
    grid-template-columns: 130px minmax(180px, 1fr);
    gap: 14px;
    align-items: end;
    max-width: calc(100% - 268px);
    margin-top: 18px;
}

#cantidad {
    text-align: center;
    font-weight: 700;
}

#btnAgregarProducto {
    padding: 0 22px;
    background: var(--azul);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(26, 53, 83, 0.16);
}

#btnAgregarProducto::before {
    content: "+ ";
}

#btnAgregarProducto:hover,
#btnGenerarCotizacion:hover {
    background: var(--azul-2);
}

.btn-producto-nuevo,
#btnImprimirCotizacion {
    padding: 0 18px;
    border: 1px solid var(--linea);
    background: #ffffff;
    color: var(--texto);
}

.btn-producto-nuevo:hover,
#btnImprimirCotizacion:hover {
    border-color: #b7c5d6;
    background: var(--superficie-suave);
}

.productos-agregados-header {
    margin: -26px -26px 0;
    padding: 20px 26px;
    border-bottom: 1px solid var(--linea-suave);
}

.productos-agregados-header h3 {
    margin-bottom: 4px;
}

.productos-agregados-header p,
.total-productos-agregados span {
    margin: 0;
    color: var(--texto-3);
    font-size: 12px;
    font-weight: 500;
}

.total-productos-agregados {
    min-width: 132px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--superficie-suave);
}

.total-productos-agregados strong {
    display: block;
    margin-top: 2px;
    color: var(--azul);
    font-family: var(--font-display);
    font-size: 18px;
}

.tabla-previa {
    width: calc(100% + 52px);
    margin: 0 -26px -26px;
    border-collapse: collapse;
    table-layout: fixed;
}

.tabla-previa th:nth-child(1),
.tabla-previa td:nth-child(1) {
    width: 39%;
}

.tabla-previa th:nth-child(2),
.tabla-previa td:nth-child(2) {
    width: 10%;
}

.tabla-previa th:nth-child(3),
.tabla-previa td:nth-child(3),
.tabla-previa th:nth-child(4),
.tabla-previa td:nth-child(4) {
    width: 15%;
}

.tabla-previa th:nth-child(5),
.tabla-previa td:nth-child(5) {
    width: 12%;
}

.tabla-previa th:nth-child(6),
.tabla-previa td:nth-child(6) {
    width: 9%;
}

.tabla-previa th {
    padding: 16px 26px;
    background: #f7f9fc;
    color: var(--texto-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
}

.tabla-previa td {
    padding: 16px 26px;
    border-top: 1px solid var(--linea-suave);
    color: var(--texto);
    vertical-align: middle;
}

.tabla-previa td:nth-child(2),
.tabla-previa td:nth-child(3),
.tabla-previa td:nth-child(4),
.tabla-previa td:nth-child(5),
.tabla-previa td:nth-child(6),
.tabla-previa th:nth-child(2),
.tabla-previa th:nth-child(3),
.tabla-previa th:nth-child(4),
.tabla-previa th:nth-child(5),
.tabla-previa th:nth-child(6) {
    text-align: center;
    white-space: nowrap;
}

.tabla-previa td:nth-child(4) {
    color: var(--azul);
    font-weight: 800;
}

.columna-agregar-imagen {
    text-align: center;
    white-space: nowrap;
}

.tabla-previa td:nth-child(5),
.tabla-previa td:nth-child(6),
.tabla-previa th:nth-child(5),
.tabla-previa th:nth-child(6) {
    padding-right: 18px;
    padding-left: 18px;
}

.selector-imagen-producto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    color: var(--texto-2);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.selector-imagen-producto input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.sin-imagen-producto {
    color: var(--texto-3);
    font-weight: 700;
}

.btn-eliminar-producto {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 48, 64, 0.18);
    background: #fff5f6;
    color: #d52635;
    font-size: 12px;
}

.btn-eliminar-producto:hover {
    border-color: rgba(255, 48, 64, 0.4);
    background: #ffe9eb;
}

.datos-formulario-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 26px;
    margin-top: 26px;
}

.datos-formulario-grid > .cotizador-card {
    width: 100%;
    margin-top: 0;
}

.datos-formulario-grid > .cotizador-card:first-child {
    grid-column: 1 / -1;
}

.datos-formulario-grid > .cotizador-card:first-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.datos-formulario-grid > .cotizador-card:first-child .seccion-titulo {
    grid-column: 1 / -1;
}

.campo-vista-defecto {
    min-height: 118px;
    padding: 16px;
    border-radius: 14px;
    background: var(--superficie-suave);
    color: var(--texto-2);
    line-height: 1.55;
    white-space: pre-line;
}

#btnEditarDatos {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(35, 78, 122, 0.2);
    background: #ffffff;
    color: var(--azul-2);
    font-size: 12px;
}

.contacto-vendedor-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contacto-vendedor-lista {
    order: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.contacto-vendedor-lista strong {
    display: none;
}

.contacto-vendedor-lista label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--linea-suave);
    border-radius: 12px;
    color: var(--texto-2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.contacto-vendedor-lista label:has(input:checked) {
    border-color: rgba(35, 78, 122, 0.34);
    background: rgba(26, 53, 83, 0.04);
    color: var(--azul);
}

.contacto-vendedor-lista input {
    width: auto;
    min-height: 0;
    accent-color: var(--azul-2);
}

.contacto-vendedor-texto {
    order: 2;
}

#contactoVendedor {
    min-height: 96px;
    background: var(--superficie-suave);
}

.acciones-formulario {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}

#btnGenerarCotizacion,
#btnImprimirCotizacion {
    min-height: 56px;
    font-family: var(--font-display);
}

#btnGenerarCotizacion {
    background: var(--azul);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(26, 53, 83, 0.18);
}

#btnImprimirCotizacion {
    border-width: 2px;
}

#btnGenerarCotizacion::before {
    content: "□";
    margin-right: 8px;
}

#btnImprimirCotizacion::before {
    content: "▣";
    margin-right: 8px;
}

.modal-producto-nuevo {
    position: fixed;
    inset: 0;
    z-index: 100;
    padding: 24px;
    background: rgba(13, 31, 53, 0.48);
}

.modal-producto-nuevo-contenido {
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: 0 auto;
    padding: 24px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(13, 31, 53, 0.28);
}

.modal-producto-nuevo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.modal-producto-nuevo-header h3 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--azul);
}

#btnCerrarNuevoProducto {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--linea);
    background: #ffffff;
    color: var(--texto-2);
}

#formNuevoProducto {
    display: grid;
    gap: 12px;
}

.acciones-producto-nuevo {
    margin-top: 8px;
}

.acciones-producto-nuevo button {
    width: 100%;
    background: var(--azul);
    color: #ffffff;
}

.mensaje-producto-nuevo {
    color: var(--texto-2);
    font-size: 13px;
}

/* =========================
   LOGIN COTIZADOR
========================= */

.login-cotizador-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--fondo);
    text-align: center;
}

.login-cotizador-page img,
body > img:first-child {
    display: block;
    max-width: 330px;
    width: min(80vw, 330px);
    height: auto;
    margin: 0 auto 24px;
}

.login-cotizador-page h1,
.login-cotizador-page h2,
body > h1,
body > h2 {
    margin: 0 0 16px;
    color: var(--texto);
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.2;
}

.login-cotizador-page form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.login-cotizador-page input {
    min-width: 230px;
}

.login-cotizador-page button,
.login-cotizador-page input[type="submit"] {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radio-control);
    background: var(--azul);
    color: #ffffff;
    font-weight: 700;
}

body > form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
}

body > form input {
    min-width: min(320px, 78vw);
    background: #ffffff;
}

body > form button,
body > form input[type="submit"] {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radio-control);
    background: var(--azul);
    color: #ffffff;
    font-weight: 700;
}

.producto-preview {
    display: none;
    width: min(920px, calc(100% - 48px));
    margin: 30px auto 60px;
    padding: 34px;
    border: 1px solid var(--linea);
    background: #ffffff;
    box-shadow: var(--sombra);
}

.encabezado-cotizacion {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.logo-cotizacion {
    max-width: 250px;
    max-height: 95px;
    object-fit: contain;
}

.datos-empresa {
    text-align: right;
    font-size: 13px;
    line-height: 1.35;
}

.fecha-cotizacion {
    margin-bottom: 22px;
    text-align: right;
}

.producto-preview h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.producto-preview p {
    margin: 8px 0;
}

.tabla-cotizacion {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.tabla-cotizacion th {
    padding: 8px 9px;
    background: var(--azul);
    color: #ffffff;
    text-align: left;
}

.tabla-cotizacion td {
    padding: 7px 9px;
    border-bottom: 1px solid #e4e8ee;
    vertical-align: top;
    overflow-wrap: break-word;
}

.columna-cantidad,
.columna-precio {
    text-align: right;
    white-space: nowrap;
}

.producto-fila-principal td {
    border-bottom: 0 !important;
}

.producto-nombre-tabla {
    display: block;
    font-weight: 800;
    line-height: 1.25;
}

.producto-detalle-layout {
    display: grid;
    grid-template-columns: 48% 52%;
    align-items: center;
    gap: 14px;
    padding: 4px 0 10px;
}

.producto-descripcion {
    font-size: 10px;
    line-height: 1.32;
    white-space: normal;
}

.producto-descripcion p,
.producto-descripcion div:not([class]) {
    margin: 0 0 6px;
}

.producto-descripcion p:last-child,
.producto-descripcion div:not([class]):last-child {
    margin-bottom: 0;
}

.producto-descripcion ul,
.producto-descripcion ol {
    margin: 5px 0 6px;
    padding-left: 18px;
}

.producto-descripcion li {
    margin: 2px 0;
    padding-left: 2px;
}

.producto-descripcion h3,
.producto-descripcion h4 {
    margin: 7px 0 4px;
    font-size: 1.08em;
    line-height: 1.22;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.producto-descripcion strong,
.producto-descripcion b {
    font-weight: 800;
}

.producto-descripcion u {
    text-underline-offset: 2px;
}

.producto-imagen {
    text-align: center;
}

.producto-detalle-layout-con-imagen {
    grid-template-columns: minmax(0, 48%) minmax(0, 52%);
    grid-template-rows: auto auto;
    align-items: start;
    gap: 10px 14px;
}

.producto-detalle-layout-con-imagen .producto-descripcion {
    grid-column: 1;
    grid-row: 1;
}

.producto-detalle-layout-con-imagen .producto-incluye {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.producto-detalle-layout-con-imagen .producto-imagen {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: start;
    width: 100%;
    padding-top: 2px;
    text-align: left;
}

.producto-detalle-layout-con-imagen .img-producto-cotizacion {
    margin: 0;
}

.producto-detalle-layout-multiple {
    grid-template-columns: minmax(0, 58%) minmax(0, 42%);
    gap: 6px 12px;
    padding: 3px 0 8px;
}

.producto-detalle-layout-multiple .producto-descripcion,
.producto-detalle-layout-multiple .producto-incluye {
    font-size: 9.8px;
    line-height: 1.25;
}

.producto-detalle-layout-multiple .producto-incluye-titulo {
    margin-bottom: 3px;
    font-size: 10px;
}

.producto-detalle-layout-multiple .producto-incluye-lista {
    gap: 2px;
}

.producto-detalle-layout-multiple .producto-incluye-item {
    padding-left: 12px;
    line-height: 1.22;
}

.producto-detalle-layout-multiple .img-producto-cotizacion {
    max-width: 180px;
    max-height: 105px;
}

.img-producto-cotizacion {
    display: block;
    max-width: 240px;
    max-height: 145px;
    margin: 0 auto;
    object-fit: contain;
}

.img-producto-miniatura {
    display: inline-block;
    width: 58px;
    height: 48px;
    margin-right: 10px;
    object-fit: contain;
    vertical-align: middle;
}

.producto-celda-con-miniatura .producto-nombre-tabla {
    display: inline-block;
    width: calc(100% - 72px);
    vertical-align: middle;
}

.resumen-cotizacion {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 18px;
    padding: 8px 0;
    border-top: 2px solid #111111;
    border-bottom: 2px solid #111111;
}

.regimen-final,
.totales-cotizacion {
    width: 48%;
    font-size: 12px;
    line-height: 1.38;
}

#regimenFinal,
.datos-cotizacion-final,
.contacto-vendedor-final {
    white-space: pre-line;
}

.totales-cotizacion div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
}

.totales-cotizacion div:last-child {
    margin-top: 3px;
    padding-top: 5px;
    border-top: 1px solid #bbbbbb;
    font-weight: 800;
}

.bloque-final-cotizacion {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 26px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.datos-cotizacion-final,
.contacto-vendedor-final {
    width: 48%;
    text-align: center;
    font-size: 12px;
    line-height: 1.42;
}

.datos-cotizacion-final h3,
.contacto-vendedor-final h3 {
    margin: 0 0 8px;
    text-decoration: underline;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 7mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    html,
    body {
        width: auto;
        margin: 0;
        padding: 0;
        background: #ffffff;
        display: block;
        font-size: 12px;
    }

    .no-print {
        display: none !important;
    }

    .contenedor,
    .producto-preview {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: #ffffff;
    }

    .producto-preview {
        display: flex !important;
        flex-direction: column;
        min-height: calc(297mm - 14mm);
    }

    .producto-preview > br {
        display: none !important;
    }

    .encabezado-cotizacion {
        margin-bottom: 18px;
    }

    .logo-cotizacion {
        max-width: 230px;
        max-height: 82px;
    }

    .datos-empresa {
        font-size: 11px;
        line-height: 1.25;
    }

    .fecha-cotizacion {
        margin-bottom: 14px;
        font-size: 11.5px;
    }

    .producto-preview h2 {
        margin-bottom: 9px;
        font-size: 14px;
    }

    .producto-preview p {
        margin: 5px 0;
    }

    .tabla-cotizacion {
        margin-top: 13px;
        font-size: 11.5px;
        page-break-inside: auto;
    }

    .tabla-cotizacion th {
        padding: 6px 7px;
        font-size: 10.8px;
    }

    .tabla-cotizacion td {
        padding: 6px 7px;
    }

    .tabla-cotizacion tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .tabla-cotizacion th:nth-child(1),
    .tabla-cotizacion td:nth-child(1) {
        width: 48%;
    }

    .tabla-cotizacion th:nth-child(2),
    .tabla-cotizacion td:nth-child(2) {
        width: 8%;
    }

    .tabla-cotizacion th:nth-child(3),
    .tabla-cotizacion td:nth-child(3),
    .tabla-cotizacion th:nth-child(4),
    .tabla-cotizacion td:nth-child(4),
    .tabla-cotizacion th:nth-child(5),
    .tabla-cotizacion td:nth-child(5) {
        width: 14.66%;
    }

    .producto-detalle-layout {
        grid-template-columns: 50% 50%;
        gap: 14px;
        padding: 8px 0 14px;
        page-break-inside: avoid;
    }

    .producto-descripcion {
        font-size: 9.8px;
        line-height: 1.28;
    }

    .producto-descripcion p,
    .producto-descripcion div:not([class]) {
        margin-bottom: 4px;
    }

    .producto-descripcion ul,
    .producto-descripcion ol {
        margin: 3px 0 4px;
        padding-left: 15px;
    }

    .producto-descripcion li {
        margin: 1px 0;
    }

    .producto-descripcion h3,
    .producto-descripcion h4 {
        margin: 5px 0 3px;
        font-size: 1.04em;
        font-weight: 800;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .img-producto-cotizacion {
        max-width: 245px;
        max-height: 150px;
    }

    .producto-preview.cotizacion-larga .producto-descripcion {
        font-size: 9.2px;
        line-height: 1.22;
    }

    .producto-preview.cotizacion-larga .img-producto-cotizacion {
        max-width: 230px;
        max-height: 138px;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion {
        font-size: 12.5px;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion th {
        padding: 7px 8px;
        font-size: 11.4px;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion td {
        padding: 7px 8px;
    }

    .producto-preview.cotizacion-un-producto .producto-nombre-tabla {
        font-size: 12.6px;
        line-height: 1.3;
    }

    .producto-preview.cotizacion-un-producto .producto-detalle-layout {
        display: grid;
        grid-template-columns: 50% 50%;
        grid-template-rows: auto 1fr;
        column-gap: 18px;
        min-height: 115mm;
        padding: 18px 0 0;
    }

    .producto-preview.cotizacion-un-producto .producto-descripcion {
        font-size: 11px;
        line-height: 1.36;
    }

    .producto-preview.cotizacion-un-producto .img-producto-cotizacion {
        max-width: 330px;
        max-height: 210px;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion {
        font-size: 13.5px;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion th {
        padding: 8px 9px;
        font-size: 12px;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion td {
        padding: 8px 9px;
    }

    .producto-preview.cotizacion-un-producto .producto-nombre-tabla,
    .producto-fila-unica .producto-nombre-tabla {
        font-size: 14px;
        line-height: 1.35;
    }

    .producto-preview.cotizacion-un-producto .producto-detalle-layout-unico,
    .producto-detalle-layout-unico {
        display: grid;
        grid-template-columns: 50% 50%;
        grid-template-rows: auto 1fr;
        column-gap: 18px;
        min-height: 115mm;
        padding: 18px 0 0;
    }

    .producto-preview.cotizacion-un-producto .producto-descripcion,
    .producto-detalle-layout-unico .producto-descripcion {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        width: 100%;
        font-size: 13px;
        line-height: 1.45;
        text-align: left;
    }

    .producto-preview.cotizacion-un-producto .img-producto-cotizacion,
    .producto-detalle-layout-unico .img-producto-cotizacion {
        width: 430px;
        max-width: 430px;
        max-height: 280px;
    }

    .producto-preview.cotizacion-un-producto .producto-detalle-fila,
    .producto-detalle-row-unico .producto-detalle-fila {
        border-bottom: 0 !important;
    }

    .producto-preview.cotizacion-un-producto .producto-detalle-fila,
    .producto-preview.cotizacion-un-producto .producto-detalle-fila td,
    .producto-detalle-row-unico .producto-detalle-fila,
    .producto-detalle-row-unico .producto-detalle-fila td {
        border-bottom: 0 !important;
    }

    .producto-preview.cotizacion-un-producto .producto-imagen,
    .producto-preview.cotizacion-un-producto .producto-detalle-layout-unico .producto-imagen,
    .producto-detalle-layout-unico .producto-imagen {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        justify-self: center;
        width: 100%;
        padding-top: 0;
        text-align: center;
    }

    .producto-preview.cotizacion-multiple .tabla-cotizacion td {
        border-bottom: 0 !important;
        padding-top: 3px;
        padding-bottom: 3px;
    }

    .producto-preview.cotizacion-multiple .tabla-cotizacion tbody tr {
        border-bottom: 1px solid #e4e8ee;
        box-shadow: inset 0 -1px 0 #e4e8ee;
    }

    .producto-preview.cotizacion-multiple .producto-fila-principal {
        border-bottom: 0 !important;
        box-shadow: none !important;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-row-multiple {
        border-bottom: 1px solid #e4e8ee !important;
        box-shadow: inset 0 -1px 0 #e4e8ee !important;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-row-multiple .producto-detalle-fila {
        padding-top: 1px;
        padding-bottom: 5px;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-layout-multiple {
        grid-template-columns: minmax(0, 58%) minmax(0, 42%);
        gap: 5px 10px;
        padding: 0 0 4px;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-layout-multiple .producto-descripcion,
    .producto-preview.cotizacion-multiple .producto-detalle-layout-multiple .producto-incluye {
        font-size: 9px;
        line-height: 1.2;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-layout-multiple .producto-incluye-titulo {
        margin-bottom: 2px;
        font-size: 9.2px;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-layout-multiple .producto-incluye-item {
        padding-left: 11px;
        font-size: 8.9px;
        line-height: 1.18;
    }

    .producto-preview.cotizacion-multiple .producto-detalle-layout-multiple .img-producto-cotizacion {
        max-width: 155px;
        max-height: 88px;
    }

    .producto-preview.cotizacion-multiple .producto-celda-con-miniatura {
        white-space: normal;
    }

    .producto-preview.cotizacion-multiple .img-producto-miniatura {
        width: 52px;
        height: 42px;
        margin-right: 7px;
    }

    .producto-preview.cotizacion-multiple .producto-nombre-tabla {
        font-size: 10px;
        line-height: 1.18;
    }

    .producto-preview.cotizacion-multiple .producto-celda-con-miniatura .producto-nombre-tabla {
        width: calc(100% - 63px);
    }

    .resumen-cotizacion {
        margin-top: auto;
        padding: 5px 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .producto-preview.cotizacion-larga .resumen-cotizacion,
    .producto-preview.cotizacion-multiple .resumen-cotizacion {
        margin-top: auto;
    }

    .regimen-final,
    .totales-cotizacion {
        font-size: 10.5px;
        line-height: 1.25;
    }

    .totales-cotizacion div {
        padding: 2px 0;
    }

    .bloque-final-cotizacion {
        margin-top: 12px;
        gap: 22px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .datos-cotizacion-final,
    .contacto-vendedor-final {
        font-size: 10.2px;
        line-height: 1.22;
    }

    .datos-cotizacion-final h3,
    .contacto-vendedor-final h3 {
        margin-bottom: 5px;
        font-size: 11px;
    }
}

@media (max-width: 820px) {
    .encabezado-formulario,
    .producto-precio-wrap,
    .datos-formulario-grid,
    .datos-formulario-grid > .cotizador-card:first-child,
    .acciones-formulario {
        grid-template-columns: 1fr;
    }

    .encabezado-formulario {
        justify-items: center;
    }

    .accion-regresar-formulario,
    .accion-reset-formulario {
        justify-content: center;
    }

    .producto-precio-area {
        padding-left: 0;
        border-left: 0;
    }

    .cantidad-acciones-producto {
        max-width: none;
        grid-template-columns: 1fr;
    }

    .productos-agregados-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tabla-previa {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* =========================
   AJUSTE INCLUYE PRODUCTO
========================= */
.producto-incluye {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #d8e1ec;
    white-space: normal;
}

.producto-incluye-titulo {
    margin-bottom: 5px;
    font-weight: 800;
    color: #1f4f86;
}

.producto-incluye-lista {
    display: grid;
    gap: 3px;
}

.producto-incluye-item {
    position: relative;
    padding-left: 14px;
    line-height: 1.32;
}

.producto-incluye-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #12a150;
    font-weight: 800;
}

@media print {
    .producto-incluye {
        margin-top: 7px;
        padding-top: 6px;
        border-top: 1px solid #d4dce7;
    }

    .producto-incluye-titulo {
        margin-bottom: 3px;
        font-size: 10.8px;
    }

    .producto-incluye-item {
        padding-left: 12px;
        font-size: 10.4px;
        line-height: 1.22;
    }

    .producto-preview.cotizacion-un-producto .producto-incluye-titulo {
        font-size: 11.3px;
    }

    .producto-preview.cotizacion-un-producto .producto-incluye-item {
        font-size: 11px;
        line-height: 1.28;
    }

    .producto-nombre-tabla {
        max-width: none;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: none;
    }
}
/* =========================
   AJUSTE FINAL INCLUYE + FOTO
========================= */
.producto-incluye {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #b8c7d9;
    white-space: normal;
    font-size: 12px;
    line-height: 1.38;
}

.producto-incluye-titulo {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #1f4f86;
}

.producto-incluye-lista {
    display: grid;
    gap: 4px;
}

.producto-incluye-item {
    position: relative;
    padding-left: 16px;
    line-height: 1.34;
}

.producto-incluye-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #12a150;
    font-weight: 800;
}

.producto-detalle-layout-con-imagen .producto-descripcion {
    grid-column: 1;
    grid-row: 1;
}

.producto-detalle-layout-con-imagen .producto-incluye {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
}

.producto-detalle-layout-con-imagen .producto-imagen {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: start;
}

@media print {
    .producto-detalle-layout {
        align-items: start;
    }

    .producto-detalle-layout-unico {
        grid-template-columns: 46% 54% !important;
        grid-template-rows: auto auto !important;
        column-gap: 16px !important;
    }

    .producto-detalle-layout-unico .producto-descripcion {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .producto-detalle-layout-unico .producto-incluye {
        grid-column: 2 !important;
        grid-row: 1 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
        font-size: 11.5px !important;
        line-height: 1.32 !important;
    }

    .producto-detalle-layout-unico .producto-incluye-titulo {
        font-size: 11.8px !important;
        margin-bottom: 5px !important;
    }

    .producto-detalle-layout-unico .producto-incluye-item {
        font-size: 11.2px !important;
        line-height: 1.28 !important;
        padding-left: 14px !important;
    }

    .producto-detalle-layout-unico .producto-imagen {
        grid-column: 1 !important;
        grid-row: 2 !important;
        align-self: start !important;
        justify-self: start !important;
    }

    .producto-preview.cotizacion-un-producto .img-producto-cotizacion,
    .producto-detalle-layout-unico .img-producto-cotizacion {
        width: 100% !important;
        max-width: 390px !important;
        max-height: 255px !important;
    }
}

/* Ajuste final: evita que el nombre del producto se parta cuando aun hay espacio. */
@media print {
    .producto-preview.cotizacion-un-producto .tabla-cotizacion {
        table-layout: fixed !important;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion th:nth-child(1),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion td:nth-child(1) {
        width: 46% !important;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion th:nth-child(2),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion td:nth-child(2) {
        width: 9% !important;
    }

    .producto-preview.cotizacion-un-producto .tabla-cotizacion th:nth-child(3),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion td:nth-child(3),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion th:nth-child(4),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion td:nth-child(4),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion th:nth-child(5),
    .producto-preview.cotizacion-un-producto .tabla-cotizacion td:nth-child(5) {
        width: 15% !important;
    }

    .producto-preview.cotizacion-un-producto .producto-nombre-tabla,
    .producto-fila-unica .producto-nombre-tabla {
        display: inline-block !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
        font-size: 12.7px !important;
        line-height: 1.18 !important;
    }
}

/* Ajuste final: mantiene descripcion e incluye arriba, con la imagen debajo a la izquierda. */
@media print {
    .producto-preview.cotizacion-un-producto .producto-detalle-layout-unico,
    .producto-detalle-layout-unico {
        grid-template-columns: 48% 52% !important;
        grid-template-rows: auto auto !important;
        column-gap: 14px !important;
    }

    .producto-preview.cotizacion-un-producto .producto-detalle-layout-unico .producto-descripcion,
    .producto-detalle-layout-unico .producto-descripcion {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .producto-preview.cotizacion-un-producto .producto-detalle-layout-unico .producto-incluye,
    .producto-detalle-layout-unico .producto-incluye {
        grid-column: 2 !important;
        grid-row: 1 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }

    .producto-preview.cotizacion-un-producto .producto-imagen,
    .producto-preview.cotizacion-un-producto .producto-detalle-layout-unico .producto-imagen,
    .producto-detalle-layout-unico .producto-imagen {
        grid-column: 1 !important;
        grid-row: 2 !important;
        align-self: start !important;
        justify-self: start !important;
        width: 100% !important;
        text-align: left !important;
    }

    .producto-preview.cotizacion-un-producto .img-producto-cotizacion,
    .producto-detalle-layout-unico .img-producto-cotizacion {
        width: 100% !important;
        max-width: 330px !important;
        max-height: 215px !important;
        object-fit: contain !important;
        margin: 0 !important;
    }
}

@media print {
    .producto-detalle-layout-multiple {
        grid-template-columns: minmax(0, 58%) minmax(0, 42%) !important;
        grid-template-rows: auto auto !important;
        gap: 5px 10px !important;
        min-height: 0 !important;
        padding: 0 0 4px !important;
    }

    .producto-detalle-layout-multiple .producto-descripcion {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .producto-detalle-layout-multiple .producto-incluye {
        grid-column: 2 !important;
        grid-row: 1 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }

    .producto-detalle-layout-multiple .producto-imagen {
        grid-column: 1 !important;
        grid-row: 2 !important;
        align-self: start !important;
        justify-self: start !important;
        width: 100% !important;
        text-align: left !important;
    }

    .producto-detalle-layout-multiple .producto-descripcion,
    .producto-detalle-layout-multiple .producto-incluye {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    .producto-detalle-layout-multiple .producto-incluye-titulo {
        margin-bottom: 2px !important;
        font-size: 9.2px !important;
    }

    .producto-detalle-layout-multiple .producto-incluye-item {
        padding-left: 11px !important;
        font-size: 8.9px !important;
        line-height: 1.18 !important;
    }

    .producto-detalle-layout-multiple .img-producto-cotizacion {
        max-width: 155px !important;
        max-height: 88px !important;
        margin: 0 !important;
    }
}
