/* Cotizador CNCero — usa las variables de /assets/css/main.css */
.cot-main { max-width: var(--container-max, 1120px); margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.cot-main h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .5rem; }
.cot-main h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.cot-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.cot-angosto { max-width: 440px; margin-inline: auto; }
.cot-card { background: #fff; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-lg, 16px); padding: 1.5rem; box-shadow: var(--shadow-sm, none); }
.cot-sub { color: var(--color-text-secondary, #5A6577); }
.cot-mini { font-size: .85rem; color: var(--color-text-secondary, #5A6577); margin-top: .15rem; }
.cot-form { display: grid; gap: 1rem; margin-top: 1rem; }
.cot-form label { display: grid; gap: .35rem; font-weight: 500; font-size: .95rem; }
.cot-form input, .cot-form select { padding: .65rem .75rem; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-sm, 6px); font: inherit; background: #fff; width: 100%; box-sizing: border-box; }
.cot-form input:focus, .cot-form select:focus { outline: 2px solid var(--color-primary, #0052CC); outline-offset: 1px; }
.cot-btn { display: inline-block; padding: .75rem 1.25rem; border: 0; border-radius: var(--radius-md, 10px); background: var(--color-primary, #0052CC); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; }
.cot-btn:hover { background: var(--color-primary-dark, #003D99); }
.cot-btn[hidden] { display: none; }   /* sin esto display:inline-block pisa el atributo hidden y "Continuar al pago" se ve siempre */
.cot-btn:disabled { opacity: .6; cursor: wait; }
.cot-link { background: none; border: 0; color: var(--color-primary, #0052CC); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.cot-error { background: #FDE8E8; color: #9B1C1C; padding: .7rem .9rem; border-radius: var(--radius-sm, 6px); margin: .75rem 0; }
.cot-ok { background: #E7F6EC; color: #14532D; padding: .7rem .9rem; border-radius: var(--radius-sm, 6px); margin: .75rem 0; }
.cot-aviso { background: #FFF6DF; color: #7A5200; padding: .4rem .6rem; border-radius: var(--radius-sm, 6px); font-size: .8rem; margin-top: .35rem; }
.cot-salir { display: inline; margin: 0; }
.cot-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cot-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-secondary, #5A6577); }
.cot-table th, .cot-table td { padding: .6rem .5rem; border-bottom: 1px solid var(--color-border, #E2E8F0); vertical-align: top; }
.cot-prev { width: 72px; height: 72px; display: grid; place-items: center; background: var(--color-bg-alt, #F5F7FA); border-radius: var(--radius-sm, 6px); }
.cot-prev svg { width: 100%; height: 100%; }
.cot-lista { list-style: none; margin: 0 0 1rem; padding: 0; }
.cot-lista li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--color-border, #E2E8F0); }
.cot-totales { margin: 1rem 0; display: grid; gap: .4rem; }
.cot-totales div { display: flex; justify-content: space-between; margin: 0; }
.cot-totales dt, .cot-totales dd { margin: 0; }
.cot-total { font-size: 1.2rem; font-weight: 700; border-top: 2px solid var(--color-text, #1A1A2E); padding-top: .5rem; }
.cot-pedido { border-top: 1px solid var(--color-border, #E2E8F0); padding: 1rem 0; }
@media (max-width: 800px) {
  .cot-grid { grid-template-columns: minmax(0, 1fr); }
  .cot-main { padding: 1.25rem 1rem 3rem; }
  .cot-table { display: block; overflow-x: auto; }
  .cot-table th, .cot-table td { padding: .6rem .3rem; }
  .cot-prev { width: 48px; height: 48px; }
}

/* Entrega: modalidad de envío */
.cot-modos { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.cot-modos legend { font-weight: 600; margin-bottom: .5rem; }
.cot-form .cot-modo { display: flex; gap: .65rem; align-items: center; font-weight: 400; padding: .7rem .85rem; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-sm, 6px); cursor: pointer; }
.cot-form .cot-modo:has(input:checked) { border-color: var(--color-primary, #0052CC); background: var(--color-primary-light, #E6F0FF); }
.cot-form .cot-modo input { width: auto; margin: 0; }
#campos-envio { display: grid; gap: 1rem; }
#campos-envio[hidden] { display: none; }
.cot-btn:disabled:not([aria-busy]) { cursor: not-allowed; }
.cot-h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.cot-destino { display: grid; gap: .75rem; margin: .75rem 0; }
.cot-destino label { display: grid; gap: .35rem; font-weight: 500; font-size: .95rem; }
.cot-destino input, .cot-destino select { padding: .65rem .75rem; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-sm, 6px); font: inherit; background: #fff; width: 100%; box-sizing: border-box; }
.cot-final { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--color-border, #E2E8F0); padding: 1rem 0; margin-top: .5rem; }
.cot-final span { font-weight: 600; }
.cot-final strong { font-size: 1.6rem; color: var(--color-primary, #0052CC); font-variant-numeric: tabular-nums; }
.cot-final strong.cot-pendiente { font-size: 1rem; color: var(--color-text-secondary, #5A6577); font-weight: 500; }

/* Cotizador 3D: vista previa */
.cot-vista { position: relative; }
#vista3d { width: 100%; height: 260px; display: block; background: var(--color-bg-alt, #F5F7FA); border-radius: var(--radius-md, 10px); touch-action: none; cursor: grab; }
#vista-vacia { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--color-text-light, #8892A0); font-size: .9rem; pointer-events: none; text-align: center; padding: 1rem; }
#vista-vacia[hidden], #fila-unidades[hidden] { display: none; }
.cot-fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cot-error-txt { color: #b3261e; }

/* Cotizador DXF: tarjeta de carga ancha con vista previa a escala, el pedido debajo */
.cot-pila { display: grid; gap: 1.5rem; }
.cot-carga-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .cot-carga-grid { grid-template-columns: minmax(0, 1fr); } }
.cot-vista-dxf { min-width: 0; }
.cot-lienzo { background: #fff; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-md, 10px); min-height: 360px; display: grid; place-items: center; overflow: hidden; }
.cot-lienzo svg { width: 100%; height: auto; max-height: 520px; display: block; }
.cot-vacio { color: var(--color-text-light, #8892A0); text-align: center; padding: 2rem; max-width: 34ch; }
.cot-vista-datos { margin-top: .75rem; display: grid; gap: .35rem; font-size: .92rem; }
.cot-vista-datos strong { font-variant-numeric: tabular-nums; }
.cot-ok-medidas { border-left: 4px solid var(--color-primary, #0052CC); background: var(--color-primary-light, #E6F0FF); padding: .55rem .8rem; border-radius: 0 6px 6px 0; }

/* Seguimiento del pedido (línea de tiempo del cliente) */
.cot-seg { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0; }
.cot-seg li { display: flex; gap: .8rem; align-items: flex-start; padding-bottom: 1rem; position: relative; color: var(--color-text-light, #8892A0); }
.cot-seg li:not(:last-child)::before { content: ""; position: absolute; left: .8rem; top: 1.7rem; bottom: 0; width: 2px; background: var(--color-border, #E2E8F0); }
.cot-seg li.hecho { color: inherit; }
.cot-seg li.hecho:not(:last-child)::before { background: var(--color-success, #16A34A); }
.cot-seg-punto { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--color-border, #E2E8F0); display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: #fff; }
.cot-seg li.hecho .cot-seg-punto { background: var(--color-success, #16A34A); border-color: var(--color-success, #16A34A); color: #fff; }
.cot-seg li.actual .cot-seg-punto { box-shadow: 0 0 0 4px rgba(22,163,74,.2); }
.cot-seg small { color: var(--color-text-secondary, #5A6577); font-weight: 400; margin-left: .35rem; }
.cot-seg-guia { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--color-text, #1A1A2E); }

/* Consulta o comentario del cliente */
.cot-comentario { display: grid; gap: .35rem; margin: 1rem 0; }
.cot-comentario label { font-weight: 600; font-size: .95rem; }
.cot-comentario textarea { width: 100%; box-sizing: border-box; padding: .65rem .75rem; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-sm, 6px); font: inherit; resize: vertical; min-height: 4.5rem; background: #fff; }
.cot-comentario textarea:focus { outline: 2px solid var(--color-primary, #0052CC); outline-offset: 1px; }
.cot-comentario-pie { display: flex; justify-content: space-between; gap: 1rem; margin: 0; }

/* Conversación del pedido */
.cot-chat { display: grid; gap: .6rem; margin: .5rem 0 1rem; }
.cot-msj { max-width: 88%; padding: .6rem .8rem; border-radius: 12px; background: var(--color-bg-alt, #F5F7FA); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.cot-msj small { display: block; color: var(--color-text-secondary, #5A6577); font-size: .75rem; margin-bottom: .15rem; }
.cot-msj.cliente { justify-self: end; background: var(--color-primary-light, #E6F0FF); }
.cot-msj.admin { justify-self: start; }
.cot-chat-form { display: grid; gap: .5rem; }
.cot-chat-form textarea { width: 100%; box-sizing: border-box; padding: .65rem .75rem; border: 1px solid var(--color-border, #E2E8F0); border-radius: var(--radius-sm, 6px); font: inherit; resize: vertical; min-height: 4rem; }

/* Encabezado en pantallas chicas: con varios botones (administradores) pasan a otra línea en vez de ensanchar la página */
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; row-gap: .4rem; }
  .site-header .header-actions { flex-wrap: wrap; flex: 1 1 100%; justify-content: flex-end; gap: .35rem; }
  .site-header .header-actions .btn-login, .site-header .header-actions .btn-primary { padding: .4rem .7rem; font-size: .8rem; }
}

/* Guía de materiales (cotizador 3D) */
.cot-guia { background: var(--color-bg-alt, #F5F7FA); border-radius: var(--radius-sm, 6px); padding: .55rem .75rem; font-size: .8rem; line-height: 1.4; color: var(--color-text-secondary, #5A6577); display: grid; gap: .3rem; }
.cot-guia p { margin: 0; }
.cot-guia-t { font-weight: 700; color: var(--color-text, #1A1A2E); }
.cot-guia-m strong { color: var(--color-text, #1A1A2E); }
.cot-guia-m.actual { background: #fff; border-left: 3px solid var(--color-primary, #0052CC); padding: .15rem .45rem; margin-left: -.45rem; border-radius: 0 4px 4px 0; }
.cot-form select option:disabled { color: #98A2B3; }

/* Color de la pieza 3D: un color o varios (multicolor) */
.cot-color { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; min-width: 0; }
.cot-color legend { font-weight: 500; font-size: .95rem; padding: 0; margin-bottom: .35rem; }
.cot-color-fila { display: flex; gap: .6rem; align-items: center; }
.cot-color-fila[hidden], #color-multi[hidden] { display: none; }
.cot-color-fila select { flex: 1; min-width: 0; }
.cot-punto { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); flex: none; background: #ddd; }
.cot-punto.grande { width: 1.7rem; height: 1.7rem; }
.cot-form .cot-check { display: flex; gap: .5rem; align-items: center; font-weight: 500; cursor: pointer; }
.cot-form .cot-check input { width: auto; margin: 0; }
.cot-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.cot-form .cot-chip { position: relative; display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .65rem; border: 1px solid var(--color-border, #E2E8F0); border-radius: 99px; font-weight: 400; font-size: .85rem; cursor: pointer; background: #fff; }
.cot-form .cot-chip input { width: auto; margin: 0; position: absolute; opacity: 0; pointer-events: none; }
.cot-form .cot-chip:has(input:checked) { border-color: var(--color-primary, #0052CC); background: var(--color-primary-light, #E6F0FF); font-weight: 600; }
.cot-form .cot-chip:has(input:focus-visible) { outline: 2px solid var(--color-primary, #0052CC); outline-offset: 1px; }
.cot-form .cot-chip:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.cot-chip small { color: #7A5200; }

/* Con los botones de administración el encabezado se achica en vez de partir el menú en dos líneas */
#nav-main a { white-space: nowrap; }
@media (max-width: 1500px) and (min-width: 761px) {
  .site-header .header-actions .btn-login, .site-header .header-actions .btn-primary { padding: .45rem .75rem; font-size: .82rem; white-space: nowrap; }
  .site-header .header-actions { gap: .4rem; }
}
.cot-pagos { display: grid; gap: 1.1rem; margin-top: .6rem; }
.cot-pago { display: grid; gap: .4rem; }
.cot-pago .cot-btn { width: 100%; }
.cot-btn.cot-btn-sec { background: #fff; color: var(--color-primary, #0052CC); border: 2px solid var(--color-primary, #0052CC); }
.cot-btn.cot-btn-sec:hover { background: #E6F0FF; }
.cot-pago-precio { margin: 0; font-size: .95rem; }
.cot-pago-precio strong { color: var(--color-primary, #0052CC); }
.cot-pago-precio span { color: #047857; font-weight: 600; }
.cot-pasos-transferencia { margin: .6rem 0 1rem; padding-left: 1.2rem; display: grid; gap: .45rem; }
