:root {
  --yeso: #f3efe7;
  --papel: #fbf9f4;
  --blanco: #ffffff;
  --tinta: #1e1c19;
  --tinta-2: #3a3631;
  --gris: #6b655c;
  --linea: #ddd5c6;
  --linea-2: #e9e3d7;
  --acento: #d9541e;
  --acento-osc: #b4410f;
  --acento-suave: #fbe6db;
  --wa: #1f7a45;
  --wa-osc: #176037;
  --ok: #2f7d4f;
  --aviso: #b7791f;
  --radio: 14px;
  --radio-s: 9px;
  --sombra: 0 1px 2px rgba(30, 28, 25, .06), 0 8px 24px -12px rgba(30, 28, 25, .18);
  --f-titulo: "Archivo", system-ui, sans-serif;
  --f-texto: "Archivo", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--yeso);
  color: var(--tinta);
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--acento); outline-offset: 2px; border-radius: 6px; }

.contenedor { width: min(1180px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--f-mono); font-feature-settings: "tnum"; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--tinta); --fg: var(--papel);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 1.25em;
  background: var(--bg); color: var(--fg);
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 15.5px; text-decoration: none; cursor: pointer;
  transition: transform .16s var(--ease), background-color .2s, box-shadow .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { box-shadow: 0 6px 18px -8px rgba(30, 28, 25, .45); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn--acento { --bg: var(--acento); --fg: #fff; }
.btn--acento:hover { --bg: var(--acento-osc); }
.btn--wa { --bg: var(--wa); --fg: #fff; }
.btn--wa:hover { --bg: var(--wa-osc); }
.btn--borde { --bg: transparent; --fg: var(--tinta); border-color: var(--linea); }
.btn--borde:hover { border-color: var(--tinta); box-shadow: none; }
.btn--fantasma { --bg: transparent; --fg: var(--tinta-2); padding-inline: .7em; }
.btn--fantasma:hover { --bg: var(--linea-2); box-shadow: none; }
.btn--peq { min-height: 38px; font-size: 14px; padding: 0 .95em; }
.btn--bloque { width: 100%; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--yeso) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.cabecera.con-borde { border-color: var(--linea); }
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 12px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.01em; font-size: 18px; }
.marca__logo { width: 34px; height: 34px; flex: none; }
.marca small { display: block; font-weight: 500; font-size: 12px; color: var(--gris); letter-spacing: 0; margin-top: -3px; }
.cabecera__acciones { display: flex; gap: 8px; align-items: center; }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(20px, 4vw, 40px); }
.hero__eti {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--acento-osc);
  background: var(--acento-suave); padding: 5px 12px; border-radius: 999px;
}
.hero__eti i { width: 7px; height: 7px; border-radius: 50%; background: var(--acento); display: block; }
.hero h1 {
  font-family: var(--f-titulo); font-stretch: 112%;
  font-size: clamp(36px, 6.4vw, 76px); line-height: .98; letter-spacing: -.035em;
  font-weight: 800; margin: 18px 0 16px; max-width: 13ch; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--acento); }
.hero p { font-size: clamp(16px, 2vw, 19px); color: var(--tinta-2); max-width: 50ch; margin: 0; }

/* ---------- Calculadora ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; padding-bottom: 80px; }
.panel-pasos {
  background: var(--papel); border: 1px solid var(--linea); border-radius: 22px;
  box-shadow: var(--sombra); overflow: hidden;
}
.progreso { display: flex; gap: 6px; padding: 18px 22px 0; }
.progreso span { flex: 1; height: 4px; border-radius: 4px; background: var(--linea-2); overflow: hidden; position: relative; }
.progreso span::after { content: ""; position: absolute; inset: 0; background: var(--acento); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.progreso span.hecho::after { transform: scaleX(1); }

.paso { padding: 22px 22px 26px; animation: entrar .4s var(--ease); }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
.paso__num { font-family: var(--f-mono); font-size: 12.5px; color: var(--gris); letter-spacing: .04em; }
.paso h2 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 4px; font-weight: 750; }
.paso__sub { color: var(--gris); margin: 0 0 20px; font-size: 15px; }

.tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tipo {
  position: relative; text-align: left; cursor: pointer;
  background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio);
  padding: 16px 14px 14px; min-height: 118px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  transition: border-color .18s, transform .16s var(--ease), box-shadow .2s;
}
.tipo:hover { border-color: var(--tinta-2); }
.tipo:active { transform: scale(.98); }
.tipo svg { width: 34px; height: 34px; color: var(--tinta-2); }
.tipo strong { font-size: 15.5px; line-height: 1.2; }
.tipo small { display: block; color: var(--gris); font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.tipo[aria-pressed="true"] { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.tipo[aria-pressed="true"] svg { color: var(--acento); }

.medida { display: grid; gap: 12px; margin-bottom: 26px; }
.medida__fila { display: flex; align-items: center; gap: 14px; }
.medida__num {
  display: flex; align-items: baseline; gap: 6px;
  background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio-s);
  padding: 6px 12px; min-width: 128px;
}
.medida__num input { width: 64px; border: 0; background: none; font-family: var(--f-mono); font-size: 24px; font-weight: 600; padding: 0; outline: none; -moz-appearance: textfield; }
.medida__num input::-webkit-inner-spin-button { -webkit-appearance: none; }
.medida__num span { color: var(--gris); font-size: 14px; }
.medida__num:focus-within { border-color: var(--tinta); }
input[type="range"] { flex: 1; accent-color: var(--acento); height: 28px; cursor: pointer; }
.ayuda { font-size: 13.5px; color: var(--gris); margin: 0; }

.etiqueta { font-weight: 650; font-size: 14.5px; margin: 0 0 10px; display: block; }
.calidades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 26px; }
.calidad {
  text-align: left; cursor: pointer; background: var(--blanco);
  border: 1.5px solid var(--linea); border-radius: var(--radio-s); padding: 12px 13px;
  transition: border-color .18s, box-shadow .2s, transform .16s var(--ease);
}
.calidad:active { transform: scale(.98); }
.calidad strong { display: block; font-size: 15px; }
.calidad span { font-size: 12.5px; color: var(--gris); line-height: 1.35; display: block; margin-top: 2px; }
.calidad[aria-pressed="true"] { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }

.extras { display: grid; gap: 8px; }
.extra {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio-s);
  padding: 11px 14px; transition: border-color .18s;
}
.extra:hover { border-color: var(--tinta-2); }
.extra input { width: 20px; height: 20px; accent-color: var(--acento); margin: 0; flex: none; }
.extra span { flex: 1; font-size: 15px; }
.extra b { font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--gris); white-space: nowrap; }
.extra:has(input:checked) { border-color: var(--acento); background: #fffaf6; }

.fotos-zona {
  display: grid; place-items: center; text-align: center; gap: 6px;
  border: 1.5px dashed var(--linea); border-radius: var(--radio); background: var(--blanco);
  padding: 28px 16px; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.fotos-zona:hover, .fotos-zona.encima { border-color: var(--acento); background: #fffaf6; }
.fotos-zona svg { width: 36px; height: 36px; color: var(--acento); }
.fotos-zona strong { font-size: 15.5px; }
.fotos-zona span { font-size: 13.5px; color: var(--gris); }
.fotos-lista { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.foto { position: relative; aspect-ratio: 1; border-radius: var(--radio-s); overflow: hidden; background: var(--linea-2); animation: entrar .3s var(--ease); }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto button {
  position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(30, 28, 25, .75); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.foto button svg { width: 14px; height: 14px; }

.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.campo { display: grid; gap: 6px; }
.campo--ancho { grid-column: 1 / -1; }
.campo label { font-weight: 600; font-size: 14px; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: 11px 13px;
  background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio-s);
  font-size: 16px; transition: border-color .18s, box-shadow .18s;
}
.campo textarea { min-height: 88px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--tinta); box-shadow: 0 0 0 3px var(--linea-2); }
.campo.error input { border-color: #c2410c; background: #fff7f3; }
.campo .msg-error { font-size: 13px; color: #b42318; display: none; }
.campo.error .msg-error { display: block; }
.plazos { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--linea); background: var(--blanco); font-size: 14.5px; font-weight: 500;
  transition: border-color .18s, background-color .18s, transform .16s var(--ease);
}
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { border-color: var(--tinta); background: var(--tinta); color: var(--papel); }
.privacidad { font-size: 13px; color: var(--gris); margin: 14px 0 0; }

.navegacion {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--linea-2); background: var(--papel);
}

/* ---------- Ticket (precio en vivo) ---------- */
.ticket {
  position: sticky; top: 88px;
  background: var(--tinta); color: var(--papel); border-radius: 22px; padding: 24px 24px 20px;
  box-shadow: 0 24px 48px -24px rgba(30, 28, 25, .6);
  overflow: hidden;
}
.ticket::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background-image: linear-gradient(var(--papel) 1px, transparent 1px), linear-gradient(90deg, var(--papel) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}
.ticket > * { position: relative; }
.ticket__eti { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #b9b0a2; display: flex; justify-content: space-between; }
.ticket__precio { font-family: var(--f-mono); font-weight: 600; font-size: clamp(30px, 3.2vw, 38px); letter-spacing: -.03em; line-height: 1.05; margin: 14px 0 4px; white-space: nowrap; }
.ticket__precio .guion { color: #8a8174; margin: 0 .1em; }
.ticket__nota { font-size: 13px; color: #b9b0a2; margin: 0 0 18px; }
.ticket__plano { height: 112px; margin: 0 0 16px; border: 1px dashed #4d4740; border-radius: 12px; display: grid; place-items: center; }
.ticket__plano svg { width: 100%; height: 100%; }
.ticket__lineas { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px dashed #4d4740; display: grid; gap: 8px; font-size: 14px; }
.ticket__lineas li { display: flex; justify-content: space-between; gap: 12px; }
.ticket__lineas li span:first-child { color: #d8d0c3; }
.ticket__lineas li span:last-child { font-family: var(--f-mono); white-space: nowrap; }
.ticket__vacio { color: #8a8174; font-size: 14px; }
.ticket__garantia { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding-top: 14px; border-top: 1px dashed #4d4740; font-size: 13px; color: #d8d0c3; }
.ticket__garantia svg { width: 18px; height: 18px; flex: none; color: var(--acento); margin-top: 1px; }

/* barra móvil */
.barra-movil { display: none; }

/* ---------- Resultado ---------- */
.resultado { padding: 28px 22px 26px; text-align: left; animation: entrar .45s var(--ease); }
.resultado__ok { width: 52px; height: 52px; border-radius: 50%; background: #e6f2ea; color: var(--ok); display: grid; place-items: center; margin-bottom: 14px; }
.resultado__ok svg { width: 26px; height: 26px; }
.resultado h2 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.025em; margin: 0 0 6px; line-height: 1.1; }
.resultado p { color: var(--tinta-2); margin: 0 0 18px; }
.resultado__ref { display: inline-block; font-family: var(--f-mono); font-size: 13px; background: var(--linea-2); padding: 3px 9px; border-radius: 6px; margin-bottom: 16px; }
.resultado__acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.siguientes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; border-top: 1px solid var(--linea-2); padding-top: 18px; }
.siguientes li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 15px; }
.siguientes b { font-family: var(--f-mono); font-size: 13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tinta); color: var(--papel); }

/* ---------- Secciones informativas ---------- */
.franja { background: var(--papel); border-block: 1px solid var(--linea); padding: clamp(48px, 7vw, 88px) 0; }
.franja h2 { font-size: clamp(26px, 4vw, 42px); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 32px; max-width: 18ch; font-stretch: 108%; }
.como { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: c; border-top: 1.5px solid var(--tinta); }
.como li { list-style: none; padding: 22px 24px 8px 0; border-right: 1px solid var(--linea); }
.como li + li { padding-left: 24px; }
.como li:last-child { border-right: 0; }
.como b { font-family: var(--f-mono); font-weight: 500; font-size: 13px; color: var(--acento); }
.como h3 { font-size: 20px; margin: 6px 0 6px; letter-spacing: -.01em; }
.como p { margin: 0; color: var(--gris); font-size: 15px; }
.como { padding: 0; margin: 0; }

.datos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: clamp(40px, 6vw, 72px) 0; }
.datos div { border-left: 2px solid var(--acento); padding-left: 14px; }
.datos strong { display: block; font-family: var(--f-mono); font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; font-weight: 600; }
.datos span { color: var(--gris); font-size: 14.5px; }

.pie { border-top: 1px solid var(--linea); padding: 28px 0 100px; font-size: 14px; color: var(--gris); }
.pie .contenedor { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pie a { text-decoration: none; }
.pie a:hover { color: var(--tinta); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; translate: -50% 20px; opacity: 0;
  background: var(--tinta); color: var(--papel); padding: 12px 18px; border-radius: 12px; font-size: 14.5px;
  box-shadow: var(--sombra); transition: opacity .25s, translate .35s var(--ease); pointer-events: none; max-width: calc(100% - 32px);
}
.toast.ver { opacity: 1; translate: -50% 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .calc { grid-template-columns: 1fr; padding-bottom: 40px; }
  .ticket { display: none; }
  .barra-movil {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--tinta); color: var(--papel); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    align-items: center; justify-content: space-between; gap: 12px;
    transform: translateY(110%); transition: transform .4s var(--ease);
  }
  .barra-movil.ver { transform: none; }
  .barra-movil small { display: block; font-size: 12px; color: #b9b0a2; }
  .barra-movil strong { font-family: var(--f-mono); font-size: 19px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
  .barra-movil .btn { min-height: 42px; font-size: 14px; --bg: var(--papel); --fg: var(--tinta); }
  .datos { grid-template-columns: 1fr 1fr; row-gap: 26px; }
}
@media (max-width: 640px) {
  .tipos { grid-template-columns: 1fr 1fr; }
  .calidades { grid-template-columns: 1fr; }
  .calidad { display: flex; align-items: baseline; gap: 10px; }
  .calidad span { margin: 0; }
  .campos { grid-template-columns: 1fr; }
  .fotos-lista { grid-template-columns: repeat(3, 1fr); }
  .resultado__acciones { grid-template-columns: 1fr; }
  .como { grid-template-columns: 1fr; border-top: 0; }
  .como li, .como li + li { padding: 18px 0; border-right: 0; border-top: 1px solid var(--linea); }
  .como li:first-child { border-top: 1.5px solid var(--tinta); }
  .cabecera__acciones .btn--borde { display: none; }
  .paso, .resultado { padding-inline: 16px; }
  .progreso { padding-inline: 16px; }
  .navegacion { padding-inline: 16px; }
  .pie { padding-bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
