/* Parallax Lab: imagen y profundidad | vista previa | ajustes y atributos para Webflow (estilo del Shader Lab) */
:root {
  color-scheme: dark;
  --negro: #0b0b0c;
  --panel: #131314;
  --panel-alto: #1c1c1e;
  --linea: #2b2b2e;
  --texto: #f4f4f4;
  --tenue: #a3a3a6;
  --apagado: #737377;
  --rojo: #e43330;
  --rojo-suave: rgb(228 51 48 / 0.15);
  --foco: #8088ff;
  --sobre-rojo: #ffffff;
  --f-titulo: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-texto: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--negro);
  color: var(--texto);
  font: 14px/1.45 var(--f-texto);
  padding: 12px 16px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
.mono, code { font-family: var(--f-mono); }

.app { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.barra-app { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.marca { font: 800 16px/1 var(--f-titulo); font-stretch: 125%; letter-spacing: 0.03em; }
.producto { font: 500 16px/1 var(--f-titulo); color: var(--tenue); }
.meta { margin-left: auto; font: 11px/1.2 var(--f-mono); color: var(--apagado); }
.meta a { color: var(--tenue); text-underline-offset: 2px; }
.meta a:hover { color: var(--texto); }

.consola {
  min-height: 0;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 356px;
  border: 1px solid var(--linea);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.lado { overflow-y: auto; padding: 14px 14px 22px; display: grid; align-content: start; gap: 14px; }
.lado-izq { border-right: 1px solid var(--linea); }
.lado-der { border-left: 1px solid var(--linea); }
.rotulo {
  margin: 6px 0 0;
  font: 650 11px/1.2 var(--f-titulo);
  font-stretch: 78%;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tenue);
}
.rotulo:first-child { margin-top: 0; }

.campo { display: grid; gap: 6px; }
.campo > label, .etiqueta { font-size: 13px; color: var(--tenue); }
.fila { display: flex; gap: 6px; }
input[type="url"], select {
  width: 100%; min-width: 0; padding: 6px 8px;
  background: var(--panel-alto); border: 1px solid var(--linea); border-radius: 8px;
}
input[type="url"] { font: 12px/1.4 var(--f-mono); }
input[type="range"] { width: 100%; margin: 0; accent-color: var(--rojo); }

.soltar {
  display: grid; gap: 4px; place-items: center; text-align: center;
  padding: 22px 12px; border: 1px dashed var(--apagado); border-radius: 10px;
  color: var(--tenue); font-size: 12px; cursor: pointer;
}
.soltar strong { color: var(--texto); font-size: 14px; font-weight: 600; }
.soltar:hover, .soltar.es-encima { border-color: var(--rojo); background: var(--rojo-suave); }
.soltar:focus-within { outline: 2px solid var(--foco); outline-offset: 2px; }

.muestras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.muestra { padding: 0; border: 1px solid var(--linea); border-radius: 8px; overflow: hidden; background: var(--panel-alto); aspect-ratio: 4 / 3; }
.muestra img { display: block; width: 100%; height: 100%; object-fit: cover; }
.muestra[aria-pressed="true"] { border-color: var(--rojo); box-shadow: 0 0 0 1px var(--rojo); }

.estado { margin: 0; font-size: 13px; color: var(--tenue); }
.estado.es-error { color: #ff8a87; }
.estado.es-listo { color: var(--texto); }
.progreso { height: 4px; border-radius: 2px; background: var(--linea); overflow: hidden; }
.progreso span { display: block; height: 100%; width: var(--p, 0%); background: var(--rojo); transition: width 0.2s; }

/* Vista previa */
.centro { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.escenario {
  position: relative; min-height: 0; display: grid; place-items: center; padding: 24px;
  background-color: var(--negro);
  background-image: radial-gradient(var(--linea) 1px, transparent 1px);
  background-size: 18px 18px;
  border-bottom: 1px solid var(--linea);
}
#vista {
  display: block; width: 100%; height: 100%; object-fit: contain;
  border-radius: 12px;
}
#vista:not([src]) { visibility: hidden; }
.vacio { position: absolute; margin: 0; color: var(--apagado); }
.barra-vista { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.segmentos { display: flex; gap: 3px; padding: 3px; background: var(--panel-alto); border-radius: 8px; }
.segmentos button { border: 0; background: transparent; color: var(--tenue); padding: 5px 10px; border-radius: 6px; font-size: 13px; }
.segmentos button:hover { color: var(--texto); }
.segmentos button[aria-pressed="true"] { background: var(--texto); color: var(--negro); }
.pista { font-size: 12px; color: var(--apagado); }
.hud { margin-left: auto; font-size: 11px; color: var(--apagado); }

/* Ajustes */
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { border: 1px solid var(--linea); background: var(--panel-alto); padding: 5px 11px; border-radius: 999px; font-size: 13px; }
.preset:hover { border-color: var(--apagado); }
.preset[aria-pressed="true"] { border-color: var(--rojo); background: var(--rojo-suave); }
.controles { display: grid; gap: 14px; }
.control { display: grid; gap: 6px; }
.control-cab { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.control-cab .nombre { color: var(--texto); min-width: 0; }
.control.es-modificado .nombre::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--rojo); vertical-align: middle;
}
.valor {
  margin-left: auto; flex: none; width: 76px; padding: 3px 6px; text-align: right;
  background: var(--panel-alto); border: 1px solid var(--linea); border-radius: 6px;
  font: 12px/1.4 var(--f-mono); font-variant-numeric: tabular-nums;
}
.ayuda { margin: 0; font-size: 12px; line-height: 1.35; color: var(--apagado); }
.interruptor {
  appearance: none; margin: 0 0 0 auto; width: 34px; height: 20px; border-radius: 10px;
  background: var(--linea); position: relative; cursor: pointer; flex: none;
}
.interruptor::before { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--texto); }
.interruptor:checked { background: var(--rojo); }
.interruptor:checked::before { left: 17px; }

/* Salida para Webflow */
.boton { border: 0; background: var(--rojo); color: var(--sobre-rojo); font-weight: 600; padding: 8px 14px; border-radius: 8px; width: 100%; }
.boton-sec { border: 1px solid var(--linea); background: var(--panel-alto); padding: 6px 12px; border-radius: 8px; }
.boton-sec:hover { border-color: var(--apagado); }
.pasos { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.pasos li::marker { color: var(--apagado); font: 12px var(--f-mono); }
.pasos li > * + * { margin-top: 6px; }
.nota { margin: 0; font-size: 12px; color: var(--tenue); }
.nota em { font-style: normal; color: var(--texto); }
.atributos { display: grid; gap: 6px; }
.atributo, .codigo {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: start;
  padding: 8px; background: var(--negro); border: 1px solid var(--linea); border-radius: 8px;
}
.atributo .nombre-atr { font: 12px/1.4 var(--f-mono); color: var(--tenue); }
.atributo .valor-atr, .codigo code { grid-column: 1; font: 12px/1.45 var(--f-mono); color: var(--texto); word-break: break-all; }
.atributo .valor-atr.es-vacio { color: var(--apagado); font-style: italic; font-family: var(--f-texto); }
.copiar { grid-row: 1 / span 2; grid-column: 2; border: 1px solid var(--linea); background: var(--panel-alto); padding: 3px 9px; border-radius: 6px; font-size: 12px; }
.copiar:hover { border-color: var(--apagado); }
.copiar.es-copiado { border-color: var(--rojo); }

@media (max-width: 1100px) {
  body { padding: 10px; }
  .app { height: auto; }
  .consola { grid-template-columns: minmax(0, 1fr); }
  .lado-izq { border-right: 0; border-bottom: 1px solid var(--linea); }
  .lado-der { border-left: 0; border-top: 1px solid var(--linea); }
  .escenario { height: 62vh; }
}
