/* Volumen Taller: usa los tokens del tema (--fr-*) con respaldo propio. */
.vt {
  --vt-bg: var(--fr-color-bg, #f1efea);
  --vt-surface: var(--fr-color-surface, #fff);
  --vt-ink: var(--fr-color-ink, #141414);
  --vt-muted: var(--fr-color-ink-muted, #5e5b55);
  --vt-line: var(--fr-color-line, #d9d5cc);
  --vt-accent: var(--fr-color-accent, #ff4f1a);
  --vt-bed: var(--fr-color-bed, #1b1c1e);
  --vt-mono: var(--fr-font-mono, ui-monospace, monospace);
  --vt-radius: var(--fr-radius-md, 10px);
  color: var(--vt-ink);
}
.vt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.vt-cotizador, .vt-logo {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: var(--fr-space-6, 24px);
  align-items: start;
}
@media (max-width: 900px) { .vt-cotizador, .vt-logo { grid-template-columns: 1fr; } }

/* Visor */
.vt-visor {
  position: sticky; top: calc(var(--fr-header-h, 72px) + 16px);
  aspect-ratio: 4 / 3.4;
  background:
    radial-gradient(120% 90% at 50% 0%, #2a2b2e 0%, var(--vt-bed) 70%);
  border-radius: var(--vt-radius);
  overflow: hidden;
  color: #f1efea;
}
@media (max-width: 900px) { .vt-visor { position: relative; top: 0; aspect-ratio: 1 / 1; } }
.vt-lienzo, .vt-lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vt-lienzo canvas { touch-action: none; cursor: grab; }

.vt-soltar {
  position: absolute; inset: 16px;
  display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center;
  border: 1.5px dashed rgb(241 239 234 / 0.35); border-radius: calc(var(--vt-radius) - 4px);
  cursor: pointer; transition: border-color .2s, background-color .2s;
  font-size: 0.95rem; padding: 24px;
}
.vt-soltar strong { font-size: 1.35rem; letter-spacing: -0.01em; }
.vt-soltar span:last-child { color: rgb(241 239 234 / 0.65); font-family: var(--vt-mono); font-size: 0.78rem; }
.vt-soltar:hover, .vt-arrastrando .vt-soltar, .vt-soltar:focus-within { border-color: var(--vt-accent); background: rgb(255 79 26 / 0.08); }
.vt-soltar-icono {
  width: 56px; height: 56px; margin-bottom: 8px;
  background: var(--vt-accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M12 2 21 7v10l-9 5-9-5V7z'/%3E%3Cpath d='M12 12 21 7M12 12 3 7M12 12v10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vt-visor:not([data-estado="vacio"]) .vt-soltar { display: none; }
.vt-visor[data-estado="cargando"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--vt-accent), transparent);
  animation: vt-barrido 1.1s linear infinite;
}
@keyframes vt-barrido { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.vt-visor[data-estado="sin-3d"] .vt-lienzo::before {
  content: "Tu navegador no muestra 3D, pero igual cotizamos con el archivo."; position: absolute; inset: auto 16px 50%; text-align: center; font-size: .9rem;
}

.vt-hud {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  display: grid; gap: 6px; pointer-events: none;
  font-family: var(--vt-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.vt-visor[data-estado="vacio"] .vt-cotizador .vt-hud { display: none; }
.vt-cotizador .vt-visor[data-estado="vacio"] .vt-hud { display: none; }
.vt-hud [data-vt-nombre] { color: var(--vt-accent); text-transform: none; font-size: 0.82rem; overflow-wrap: anywhere; }
.vt-hud dl { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; }
.vt-hud dl div { display: flex; gap: 8px; }
.vt-hud dt { color: rgb(241 239 234 / 0.55); }
.vt-hud dd { margin: 0; }
.vt-aviso {
  margin: 0; padding: 8px 10px; border-radius: 6px;
  background: rgb(215 38 61 / 0.92); color: #fff; text-transform: none; letter-spacing: 0; font-size: .82rem; font-family: inherit;
}
.vt-cambiar {
  position: absolute; top: 14px; right: 14px;
  font: 500 0.78rem var(--vt-mono); color: #f1efea; background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.2); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.vt-cambiar:hover { background: rgb(255 255 255 / 0.18); }

/* Panel */
.vt-panel { display: grid; gap: 4px; }
.vt-panel fieldset { border: 0; border-top: 1px solid var(--vt-line); margin: 0; padding: 18px 0 14px; display: grid; gap: 10px; min-width: 0; }
.vt-panel legend { display: flex; align-items: baseline; gap: 10px; font-weight: 600; font-size: 1.02rem; padding: 0 0 10px; float: left; width: 100%; }
.vt-panel legend + * { clear: both; }
.vt-paso { font-family: var(--vt-mono); font-size: 0.72rem; color: var(--vt-accent); font-weight: 500; }
.vt-sub { margin: 4px 0 -2px; font-family: var(--vt-mono); font-size: .72rem; text-transform: uppercase; color: var(--vt-muted); letter-spacing: .05em; }

.vt-opcion { position: relative; display: block; cursor: pointer; }
.vt-opcion input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vt-grilla, .vt-modos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.vt-tarjeta {
  display: grid; gap: 2px; height: 100%; padding: 12px 14px;
  background: var(--vt-surface); border: 1.5px solid var(--vt-line); border-radius: var(--vt-radius);
  transition: border-color .15s, box-shadow .15s;
}
.vt-tarjeta b { font-size: .98rem; }
.vt-tarjeta small { color: var(--vt-muted); font-size: .8rem; line-height: 1.35; }
.vt-opcion input:checked + .vt-tarjeta { border-color: var(--vt-ink); box-shadow: inset 0 0 0 1px var(--vt-ink); }
.vt-opcion input:focus-visible + .vt-tarjeta, .vt-opcion input:focus-visible + span { outline: 2px solid var(--vt-accent); outline-offset: 2px; }

.vt-segmentos { display: flex; background: var(--vt-surface); border: 1.5px solid var(--vt-line); border-radius: var(--vt-radius); padding: 3px; }
.vt-segmentos .vt-opcion { flex: 1; }
.vt-segmentos .vt-opcion > span { display: grid; text-align: center; padding: 8px 4px; border-radius: calc(var(--vt-radius) - 3px); font-weight: 500; font-size: .9rem; }
.vt-segmentos small { font: 400 .68rem var(--vt-mono); color: var(--vt-muted); }
.vt-segmentos input:checked + span { background: var(--vt-ink); color: var(--vt-bg); }
.vt-segmentos input:checked + span small { color: rgb(241 239 234 / .7); }

.vt-colores { display: flex; flex-wrap: wrap; gap: 10px; }
.vt-color { position: relative; cursor: pointer; }
.vt-color input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vt-color > span:first-of-type {
  display: block; width: 34px; height: 34px; border-radius: 50%;
  background: var(--vt-swatch); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15);
  transition: transform .15s;
}
.vt-color input:checked + span { box-shadow: 0 0 0 2px var(--vt-bg), 0 0 0 4px var(--vt-ink); }
.vt-color input:focus-visible + span { outline: 2px solid var(--vt-accent); outline-offset: 4px; }
.vt-color:hover > span:first-of-type { transform: scale(1.08); }

.vt-escala { display: flex; align-items: center; gap: 14px; }
.vt-escala input { flex: 1; accent-color: var(--vt-accent); }
.vt-escala output { font-family: var(--vt-mono); min-width: 4.5ch; text-align: right; }

.vt-cantidad { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.vt-cantidad input, .vt-empresas input, .vt-empresas textarea {
  font: inherit; padding: 10px 12px; border: 1.5px solid var(--vt-line); border-radius: var(--vt-radius); background: var(--vt-surface); color: var(--vt-ink);
}
.vt-cantidad input { width: 7.5em; font-family: var(--vt-mono); }
.vt-escalones { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; font: .75rem var(--vt-mono); color: var(--vt-muted); }
.vt-escalones li { border: 1px solid var(--vt-line); border-radius: 999px; padding: 4px 10px; }

.vt-total {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 8px; padding: 16px 18px;
  background: var(--vt-ink); color: var(--vt-bg); border-radius: var(--vt-radius);
}
.vt-total > div { display: grid; }
.vt-total-etiqueta { font: .7rem var(--vt-mono); text-transform: uppercase; letter-spacing: .06em; opacity: .65; }
.vt-total strong { font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vt-total-detalle { font-size: .8rem; opacity: .75; }
@media (max-width: 520px) {
  .vt-total { padding: 12px 14px; gap: 10px; flex-wrap: nowrap; }
  .vt-total strong { font-size: 1.3rem; }
  .vt-total .vt-boton { padding: 13px 16px; font-size: .9rem; white-space: nowrap; }
}

.vt-boton {
  appearance: none; border: 0; cursor: pointer;
  font: 600 1rem/1 var(--fr-font-sans, system-ui); padding: 15px 22px; border-radius: 999px;
  background: var(--vt-accent); color: var(--vt-ink);
  transition: transform .15s, filter .15s;
}
.vt-boton:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.vt-boton:disabled { opacity: .45; cursor: not-allowed; }
.vt-boton:focus-visible { outline: 2px solid var(--vt-bg); outline-offset: 3px; }
.vt-estado { min-height: 1.4em; margin: 6px 0 0; font-size: .9rem; color: var(--vt-ink); }
.vt-letra-chica { margin: 0; font-size: .78rem; color: var(--vt-muted); }

.vt-subir { display: block; padding: 14px; border: 1.5px dashed var(--vt-line); border-radius: var(--vt-radius); background: var(--vt-surface); cursor: pointer; }
.vt-subir input { display: block; margin-bottom: 8px; font-size: .85rem; max-width: 100%; }
.vt-subir span { font-size: .85rem; color: var(--vt-muted); }
.vt-subir b { color: var(--vt-ink); }

/* Empresas */
.vt-empresas { display: grid; gap: 18px; }
.vt-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.vt-campos label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
.vt-campos .vt-ancho { grid-column: 1 / -1; }
.vt-empresas .vt-boton { justify-self: start; }
.vt-trampa { position: absolute; left: -9999px; }
.vt-gracias { padding: 16px 18px; border-radius: var(--vt-radius); background: var(--vt-ink); color: var(--vt-bg); margin-bottom: 16px; }
.vt-nota { font-size: .85rem; color: var(--vt-muted); }

@media (prefers-reduced-motion: reduce) {
  .vt *, .vt *::after { transition: none !important; animation: none !important; }
}
