/* ── COTIZADOR (cotizar.html) ────────────────────────────
   Usa los tokens de styles.css. Prefijo .cz- para no chocar con el resto del sitio. */

.cz-section { padding: 72px 0; }
.cz-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cz-head { max-width: 640px; margin-bottom: 28px; }
.cz-head .section-title { margin-bottom: 10px; }
.cz-sub { margin-bottom: 0; max-width: 620px; }

/* ── TRM ── */
.cz-trm {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.cz-trm-main { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cz-trm-label { font-size: 12px; font-weight: 600; color: var(--gray-2); letter-spacing: .02em; }
.cz-trm-val { font-size: 26px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cz-trm-src { font-size: 12px; color: var(--gray-2); display: inline-flex; align-items: center; gap: 8px; }
.cz-trm-src::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-3); flex: none; }
.cz-trm-src.oficial::before { background: #1f9d6b; }
.cz-trm-src.mercado::before, .cz-trm-src.manual::before { background: #d99a1f; }
.cz-trm-src.cache::before, .cz-trm-src.respaldo::before { background: #c43e14; }

/* ── Layout ── */
.cz-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.cz-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); }
.cz-form { position: sticky; top: calc(var(--header-h) + 16px); }
.cz-form fieldset { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
.cz-form fieldset + fieldset { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.cz-form legend { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; padding: 0; }

.cz-field { margin-bottom: 14px; }
.cz-field label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-1); margin-bottom: 6px; }
.cz-req { color: var(--accent-ink); }
.cz-opt { font-weight: 500; color: var(--gray-3); }
.cz-form input, .cz-form select {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font-family: var(--font); font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.cz-form select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2345423C' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.cz-form input::placeholder { color: var(--gray-3); font-weight: 400; }
.cz-form input:focus, .cz-form select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(233,78,27,.18); }
.cz-form input[aria-invalid="true"] { border-color: #c43e14; background: #fff6f3; }
.cz-err { min-height: 0; margin: 6px 0 0; font-size: 12px; font-weight: 600; color: #b5380f; }
.cz-err:empty { display: none; }
.cz-two { display: grid; grid-template-columns: 1fr; gap: 0; }

.cz-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.cz-chip { font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--gray-1); border: 1px solid var(--border); }
.cz-chip.usa { background: #e8f6ef; color: #17734f; border-color: #b5e2cd; }
.cz-chip.jp  { background: #fdf3dc; color: #8a5d0a; border-color: #efd391; }

/* ── Documento de cotización ── */
.cz-quote {
  background: #fff; color: #14171c; border: 1px solid var(--border-2); border-radius: 16px;
  padding: 28px 26px; box-shadow: var(--shadow-md); font-family: var(--font);
}
.cz-q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 14px; border-bottom: 2px solid #14171c; }
.cz-q-head img { width: 44px; height: auto; display: block; }
.cz-q-meta { text-align: right; font-size: 11px; color: #6b7480; line-height: 1.6; display: flex; flex-direction: column; }
.cz-q-meta b { color: #14171c; font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.cz-q-client { margin: 14px 0 4px; padding: 12px 14px; background: #f6f4f0; border-radius: 10px; }
.cz-q-sec { font-size: 10px; font-weight: 700; letter-spacing: .18em; color: #B5380F; margin-bottom: 6px; }
.cz-q-cli { display: flex; gap: 10px; font-size: 13px; line-height: 1.55; }
.cz-q-cli-k { flex: 0 0 82px; color: #6b7480; }
.cz-q-cli-v { font-weight: 600; color: #14171c; word-break: break-word; overflow-wrap: anywhere; }
.cz-q-title { font-size: 21px; font-weight: 800; letter-spacing: -.01em; margin: 16px 0 2px; line-height: 1.2; }
.cz-q-conf { font-size: 12.5px; color: #525a66; margin: 0 0 14px; line-height: 1.5; }
.cz-q-rows { border-top: 1px solid #e3e7ec; }
.cz-q-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #eef1f4; font-size: 13px; color: #525a66; }
.cz-q-v { font-weight: 700; color: #14171c; white-space: nowrap; text-align: right; }
.cz-q-total { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--accent); }
.cz-q-total-lab { font-weight: 700; font-size: 14px; }
.cz-q-total-lab small { display: block; font-size: 11px; color: #6b7480; font-weight: 500; }
.cz-q-total-amt { font-size: 26px; font-weight: 900; text-align: right; line-height: 1.1; }
.cz-q-total-amt small { display: block; font-size: 12px; color: #6b7480; font-weight: 600; letter-spacing: 0; }
.cz-q-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px dashed #e3e7ec; font-size: 10.5px; line-height: 1.55; color: #8a93a0; }

/* Copia a ancho fijo, fuera de pantalla, para generar el PDF */
.cz-print-wrap { position: fixed; left: -10000px; top: 0; width: 760px; background: #fff; padding: 0; z-index: -1; }
.cz-print-wrap .cz-quote { box-shadow: none; border: 0; border-radius: 0; }

.cz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cz-actions .btn-primary { flex: 1 1 100%; }
.cz-actions .btn-outline { flex: 1 1 180px; justify-content: center; }
.cz-actions button:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.cz-status { min-height: 20px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--gray-1); }

/* ── Grilla de modelos ── */
.cz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cz-veh {
  display: flex; flex-direction: column; text-align: left; font-family: var(--font); color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 20px; cursor: pointer;
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.cz-veh:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
.cz-veh:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cz-veh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cz-veh h3 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.cz-veh-sub { font-size: 12px; color: var(--gray-2); margin-top: 2px; }
.cz-flag { font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.cz-flag.usa { background: #e8f6ef; color: #17734f; }
.cz-flag.jp  { background: #fdf3dc; color: #8a5d0a; }
.cz-veh-engine { font-size: 12.5px; color: var(--gray-1); margin-top: 12px; line-height: 1.5; }
.cz-veh-price { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.cz-veh-engine + .cz-veh-price { margin-top: 16px; }
.cz-veh-lab { font-size: 11px; color: var(--gray-2); }
.cz-veh-cop { font-size: 24px; font-weight: 900; color: var(--accent-ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cz-veh-usd { font-size: 12px; color: var(--gray-2); }
.cz-veh-wa { justify-content: space-between; text-decoration: none; background: var(--surface); border-style: dashed; border-color: var(--border-2); }
.cz-veh-cta { font-size: 16px; margin-top: auto; padding-top: 14px; }

/* ── Pasos ── */
.cz-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.cz-steps li { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.cz-step-n { display: block; font-size: 26px; font-weight: 900; color: var(--accent); line-height: 1; }
.cz-steps h3 { font-size: 15px; font-weight: 800; margin: 10px 0 6px; }
.cz-steps p { font-size: 13px; color: var(--gray-1); line-height: 1.55; }

/* ── Por qué este precio ── */
.cz-why { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cz-why h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.cz-list { list-style: none; }
.cz-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--gray-1); }
.cz-list li:last-child { border-bottom: 0; }
.cz-list li::before { content: "✓"; color: #1f9d6b; font-weight: 800; flex: none; }
.cz-legal { margin-top: 24px; font-size: 12px; line-height: 1.7; color: var(--gray-2); max-width: 880px; }

/* ── Overlay (respaldo de descarga) ── */
.cz-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(11,11,11,.85); padding: 20px; overflow: auto; }
.cz-overlay[hidden] { display: none; }
.cz-overlay-in { max-width: 480px; margin: 0 auto; text-align: center; }
.cz-overlay-in p { color: #fff; font-size: 14px; margin: 4px 0 12px; }
.cz-overlay-in img { width: 100%; border-radius: 12px; display: block; margin-bottom: 12px; }
.cz-overlay-in .btn-primary { width: 100%; }

/* ── Responsive ── */
@media (max-width: 1100px) { .cz-steps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .cz-layout { grid-template-columns: 1fr; }
  .cz-form { position: static; }
  .cz-why { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cz-section { padding: 52px 0; }
  .cz-card { padding: 18px; }
  .cz-quote { padding: 22px 18px; }
  .cz-steps { grid-template-columns: 1fr; }
  .cz-trm-val { font-size: 22px; }
  .cz-q-total-amt { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .cz-veh, .cz-veh:hover { transition: none; transform: none; } }
