/* ==========================================================================
   OrozcoyCo CC — Cotización de desarrollo
   ========================================================================== */

.cotizacion { max-width: 1180px; }

.cot__ayuda {
  font-size: 0.8125rem;
  color: var(--text-2);
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.cot__bloque { margin-bottom: 1.25rem; }

.cot__etiqueta-card { font-size: 0.75rem; color: var(--text-muted); }

.cot__rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cot__rejilla-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cot__rejilla-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 900px) {
  .cot__rejilla-2, .cot__rejilla-3, .cot__rejilla-4 { grid-template-columns: 1fr; }
}

.cot__nota { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.75rem; line-height: 1.5; }
.cot__subtitulo { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.625rem; color: var(--text); }

/* --------------------------------------------------------------------------
   Tabla editable
   -------------------------------------------------------------------------- */
.cot__tabla th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; }
.cot__tabla td { vertical-align: top; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.cot__num { text-align: right; }

/* Campos que se ven como texto hasta que se tocan: la tabla se lee como
   documento y se edita sin cambiar de modo. */
.cot__campo {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.3125rem 0.5rem;
  background: transparent;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.cot__campo:hover { border-color: var(--border); background: var(--surface-2); }
.cot__campo:focus { outline: none; border-color: var(--primary); background: var(--surface); }

.cot__campo--detalle { color: var(--text-2); font-size: 0.8125rem; line-height: 1.5; resize: vertical; min-height: 2.25rem; }
.cot__campo--valor { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cot__campo--titulo { font-weight: 600; }

.cot__fila--excluida { opacity: 0.42; }
.cot__fila--excluida .cot__campo { text-decoration: line-through; }

.cot__quitar {
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1; padding: 0.25rem;
  border-radius: var(--radius-sm);
}
.cot__quitar:hover { color: var(--danger); background: var(--danger-bg); }

.cot__tabla tfoot td {
  border-top: 2px solid var(--border-2);
  font-weight: 700;
  padding-top: 0.75rem;
}
.cot__total-valor { font-size: 1.125rem; color: var(--primary); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Opciones de negociación
   -------------------------------------------------------------------------- */
.cot__opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .cot__opciones { grid-template-columns: 1fr; } }

.cot__opcion {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.cot__opcion--destacada { border: 2px solid var(--primary); background: var(--primary-bg); }

.cot__opcion__sello {
  display: inline-block;
  align-self: flex-start;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.cot__opcion__letra { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }
.cot__opcion__nombre { font-size: 1rem; font-weight: 700; margin: 0.125rem 0 0.5rem; }
.cot__opcion__cifra { font-size: 1.5rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.15; }
.cot__opcion__cifra small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-2); margin-top: 0.125rem; }
.cot__opcion__cuerpo { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--text-2); line-height: 1.6; }

.cot__desglose { margin-top: 0.75rem; display: grid; gap: 0.25rem; }
.cot__desglose div {
  display: flex; justify-content: space-between; gap: 0.75rem;
  font-size: 0.8125rem; padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border);
}
.cot__desglose div:last-child { border-bottom: 0; }
.cot__desglose span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

.cot__opcion__cuando {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.55;
  border-top: 1px solid var(--border);
}
.cot__opcion__cuando strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Retorno
   -------------------------------------------------------------------------- */
.cot__retorno { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cot__retorno div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-2);
}
.cot__retorno div:last-child { border-bottom: 0; }
.cot__retorno div span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.cot__retorno .cot__retorno--total { background: var(--success-bg); }
.cot__retorno .cot__retorno--total span { color: var(--success); font-weight: 700; font-size: 1rem; }

/* --------------------------------------------------------------------------
   Listas de condiciones
   -------------------------------------------------------------------------- */
.cot__lista { display: grid; gap: 0.375rem; list-style: none; padding: 0; }
.cot__lista li { display: flex; gap: 0.5rem; align-items: flex-start; }
.cot__lista li::before { content: '·'; color: var(--primary); font-weight: 700; padding-top: 0.3rem; }
.cot__lista .cot__campo { font-size: 0.8125rem; color: var(--text-2); }

.cot__pie-legal { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin: 1.5rem 0 2rem; }

/* --------------------------------------------------------------------------
   Impresión
   -------------------------------------------------------------------------- */
@media print {
  @page { size: A4 portrait; margin: 14mm 12mm; }

  .sidebar, .sidebar-overlay, .header, .no-imprimir { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }

  .cotizacion { max-width: none; padding: 0; }

  /* El encabezado del documento solo existe al imprimir. */
  .cot__encabezado-impresion { display: block !important; margin-bottom: 10mm; }

  .card {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 7mm;
  }
  .card__header { padding: 0 0 3mm; border-bottom: 1px solid #cbd5e1; }
  .card__title { font-size: 12pt; }
  .card__body { padding: 4mm 0 0; }

  .cot__campo {
    border-color: transparent !important;
    background: transparent !important;
    padding: 0.15rem 0;
    -webkit-appearance: none;
    appearance: none;
  }
  textarea.cot__campo { height: auto !important; overflow: visible; }

  .cot__tabla { font-size: 9pt; }
  .cot__opciones { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .cot__opcion { padding: 4mm; break-inside: avoid; }
  .cot__opcion--destacada { background: #f8fafc; }

  .cot__fila--excluida { display: none; }
}

.cot__encabezado-impresion { display: none; }
.cot__encabezado-impresion img { height: 16mm; }
.cot__encabezado-impresion h1 { font-size: 18pt; margin: 4mm 0 2mm; }
.cot__encabezado-impresion p { font-size: 9pt; color: #475569; line-height: 1.7; }

.cot__alerta-margen {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.55;
}

/* Copia estática de los textos largos: se muestra solo al imprimir, porque un
   textarea no crece con su contenido en el documento impreso. */
.cot__impreso { display: none; }

@media print {
  textarea.cot__campo { display: none !important; }
  .cot__impreso {
    display: block;
    font-size: 8.5pt;
    color: #475569;
    line-height: 1.5;
  }
}
