/* CRISLAN — Demo Fase 1 · Identidad: marfil / negro serif / dorado */
:root {
  --ivory: #faf9f6;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #555;
  --gold: #b8912f;
  --gold-soft: #d8bc6e;
  --gold-bg: #faf5e8;
  --line: #e8e4da;
  --ok: #2e7d32;
  --warn: #b3261e;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(26, 22, 10, 0.07);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--ivory);
  color: var(--ink);
  font-size: 17px;               /* tipografía grande, legible (§60) */
  line-height: 1.55;
}
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 17px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 13px 14px; width: 100%; background: var(--paper);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 145, 47, 0.15);
}
label { display: block; font-weight: 500; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.hint { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Encabezado fijo: la cotización acompaña todo el camino ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.topbar .logo { height: 52px; width: 52px; object-fit: cover; border-radius: 50%; border: 1.5px solid var(--gold-soft); }
.brand-name { font-family: var(--serif); font-size: 24px; letter-spacing: 3px; font-weight: 600; }
.brand-sub { font-size: 11px; letter-spacing: 2.5px; color: var(--gold); text-transform: uppercase; }
.quote-chip {
  margin-left: auto; text-align: right; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.quote-chip .cot {
  background: var(--ink); color: #f5e9c9; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; font-size: 15px; letter-spacing: 1px;
}
.quote-chip .when {
  background: var(--gold-bg); border: 1px solid var(--gold-soft);
  padding: 7px 14px; border-radius: 999px; font-size: 15px; color: #6b5518;
}

/* ---------- Pasos ---------- */
.steps {
  max-width: 1100px; margin: 18px auto 4px; padding: 0 16px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.step-dot {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--ink-soft);
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
}
.step-dot .n {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eceae3; font-weight: 600; font-size: 13px;
}
.step-dot.active { color: var(--ink); border-color: var(--gold-soft); background: var(--gold-bg); font-weight: 600; }
.step-dot.active .n { background: var(--gold); color: #fff; }
.step-dot.done .n { background: var(--ok); color: #fff; }
.step-dot.clickable { cursor: pointer; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1100px; margin: 10px auto 120px; padding: 0 16px;
  display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start;
}
.layout.no-side { grid-template-columns: 1fr; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px;
}
h1.title { font-family: var(--serif); font-size: 34px; font-weight: 600; margin-bottom: 4px; }
p.subtitle { color: var(--ink-soft); margin-bottom: 22px; }
h2.section { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 26px 0 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ---------- Botones grandes (§60) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 16px 30px;
  font-size: 18px; font-weight: 600; transition: all .15s ease;
}
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a37f24; }
.btn-dark { background: var(--ink); color: #f5e9c9; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn-row .spacer { flex: 1; }

/* ---------- Tablita de categorías (feedback del cliente) ---------- */
.cat-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--paper); cursor: pointer; user-select: none;
  transition: background .12s;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { background: var(--gold-bg); }
.cat-row .icon { font-size: 22px; width: 30px; text-align: center; }
.cat-row .name { font-size: 18px; font-weight: 500; flex: 1; }
.cat-row .count { font-size: 14px; color: var(--ink-soft); }
.cat-row input[type="checkbox"] {
  width: 24px; height: 24px; accent-color: var(--gold); flex: none;
}
.cat-row.selected { background: var(--gold-bg); }
.cat-row.selected .name { color: #6b5518; font-weight: 600; }

/* ---------- Filas de producto compactas (pocas imágenes) ---------- */
.prod-group { margin-top: 24px; }
.prod-group h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  padding-bottom: 8px; border-bottom: 2px solid var(--gold-soft); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.prod-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 6px; border-bottom: 1px solid var(--line);
}
.prod-thumb {
  width: 54px; height: 54px; flex: none; border-radius: 10px;
  background: var(--gold-bg); border: 1px solid var(--gold-soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.prod-info { flex: 1; min-width: 140px; }
.prod-name { font-weight: 600; font-size: 17px; }
.prod-price { color: var(--ink-soft); font-size: 15px; }
.prod-price .promo { color: var(--warn); font-weight: 600; }
.prod-price .strike { text-decoration: line-through; margin-right: 6px; }
.promo-tag {
  display: inline-block; background: #fdecea; color: var(--warn);
  font-size: 12px; font-weight: 600; border-radius: 6px; padding: 1px 8px; margin-left: 6px;
}
.prod-avail { font-size: 14px; color: var(--ok); font-weight: 500; }
.prod-avail.none { color: var(--warn); }
.qty-ctrl { display: flex; align-items: center; gap: 4px; flex: none; }
.qty-ctrl button {
  width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 20px; font-weight: 600; color: var(--ink);
}
.qty-ctrl button:hover { border-color: var(--gold); background: var(--gold-bg); }
.qty-ctrl input {
  width: 64px; text-align: center; padding: 9px 4px; font-size: 17px; font-weight: 600;
}
.prod-sub { width: 96px; text-align: right; font-weight: 600; flex: none; font-size: 16px; }
.avail-warn {
  background: #fdecea; border: 1px solid #f5c6c0; color: var(--warn);
  border-radius: 10px; padding: 10px 14px; font-size: 15px; margin: 8px 0;
}

/* ---------- Tarjetas de servicio / entrega ---------- */
.opt-card {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; cursor: pointer; background: var(--paper);
  transition: all .12s;
}
.opt-card:hover { border-color: var(--gold-soft); }
.opt-card.selected { border-color: var(--gold); background: var(--gold-bg); }
.opt-card input { width: 24px; height: 24px; margin-top: 3px; accent-color: var(--gold); flex: none; }
.opt-card .body { flex: 1; }
.opt-card .name { font-weight: 600; font-size: 18px; }
.opt-card .desc { color: var(--ink-soft); font-size: 15px; }
.opt-card .price { font-weight: 700; font-size: 18px; white-space: nowrap; }

/* ---------- Resumen lateral fijo (§61) ---------- */
.side {
  position: sticky; top: 92px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.side h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 12px; }
.side-lines { font-size: 15px; }
.side-line { display: flex; justify-content: space-between; padding: 5px 0; gap: 8px; }
.side-line .l { color: var(--ink-soft); }
.side-line.total {
  border-top: 2px solid var(--gold-soft); margin-top: 10px; padding-top: 12px;
  font-size: 19px; font-weight: 700;
}
.side-line.anticipo { color: var(--gold); font-weight: 700; font-size: 16px; }
.side-empty { color: var(--ink-soft); font-size: 15px; }

/* ---------- Barra inferior móvil ---------- */
.mobile-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 18px;
  align-items: center; gap: 12px;
}
.mobile-bar .tot { font-size: 18px; font-weight: 700; }
.mobile-bar .ant { font-size: 13px; color: var(--gold-soft); }
.mobile-bar button {
  margin-left: auto; background: var(--gold); border: none; color: #fff;
  padding: 12px 22px; border-radius: 10px; font-size: 16px; font-weight: 600;
}

/* ---------- Resumen / totales grandes ---------- */
.totals { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 10px; }
.totals .row { display: flex; justify-content: space-between; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.totals .row:last-child { border-bottom: none; }
.totals .row.big { background: var(--ink); color: #fff; font-size: 20px; font-weight: 700; }
.totals .row.gold { background: var(--gold-bg); color: #6b5518; font-weight: 700; font-size: 18px; }
.note-box {
  background: var(--gold-bg); border: 1px solid var(--gold-soft); border-radius: var(--radius);
  padding: 16px 18px; margin: 16px 0; font-size: 15.5px; color: #5c4a15;
}
.bank-box {
  border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 22px; margin: 18px 0; background: var(--paper);
}
.bank-box .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); gap: 10px; }
.bank-box .row:last-child { border-bottom: none; }
.bank-box .k { color: var(--ink-soft); }
.bank-box .v { font-weight: 600; text-align: right; }

/* ---------- Carga de comprobante ---------- */
.upload {
  border: 2px dashed var(--gold-soft); border-radius: var(--radius);
  padding: 30px; text-align: center; cursor: pointer; background: var(--gold-bg);
  transition: all .15s;
}
.upload:hover { border-color: var(--gold); }
.upload .big-ico { font-size: 34px; }
.upload input { display: none; }
.upload-ok {
  background: #e8f5e9; border: 1px solid #a5d6a7; color: var(--ok);
  border-radius: 10px; padding: 12px 16px; margin-top: 12px; font-weight: 500;
}

/* ---------- Confirmación ---------- */
.confirm-hero { text-align: center; padding: 30px 10px; }
.confirm-hero .ico { font-size: 60px; }
.confirm-hero h1 { font-family: var(--serif); font-size: 34px; margin: 12px 0 6px; }
.status-flow { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 22px 0; }
.status-chip {
  padding: 8px 16px; border-radius: 999px; font-size: 14px;
  background: #eceae3; color: var(--ink-soft);
}
.status-chip.on { background: var(--gold); color: #fff; font-weight: 600; }

/* ---------- Vista de cotización / imprimible ---------- */
.quote-doc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.quote-doc .head { display: flex; align-items: center; gap: 18px; border-bottom: 2px solid var(--gold); padding-bottom: 18px; margin-bottom: 18px; }
.quote-doc .head img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }
.quote-doc table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.quote-doc th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); border-bottom: 2px solid var(--gold-soft); padding: 8px 6px; }
.quote-doc td { padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.quote-doc td.r, .quote-doc th.r { text-align: right; }
.quote-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; font-size: 15px; margin-bottom: 8px; }
.quote-meta .k { color: var(--ink-soft); }
.terms { font-size: 13.5px; color: var(--ink-soft); margin-top: 18px; }
.terms li { margin-left: 18px; margin-bottom: 4px; }

.demo-badge {
  position: fixed; bottom: 14px; left: 14px; z-index: 40;
  background: rgba(26,26,26,.85); color: #f5e9c9; font-size: 12px;
  padding: 5px 12px; border-radius: 999px; letter-spacing: 1px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; margin-bottom: 150px; }
  .side { display: none; }
  .mobile-bar { display: flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
  h1.title { font-size: 28px; }
  .prod-row { flex-wrap: wrap; }
  .prod-sub { width: auto; margin-left: auto; }
  .quote-chip { margin-left: 0; }
  .steps { display: none; }
}

@media print {
  .topbar, .steps, .btn-row, .mobile-bar, .side, .demo-badge, .no-print { display: none !important; }
  body { background: #fff; font-size: 13px; }
  .layout { margin: 0; display: block; max-width: none; }
  .card, .quote-doc { border: none; box-shadow: none; padding: 0; }
  body.doc-open #app { display: none !important; }
  #doc-overlay { position: static !important; background: #fff !important; padding: 0 !important; overflow: visible !important; }
}
