/* Configurador "Imagina tu obra" — Opus Monroy
   Panel único: formulario izquierda · visualización derecha
   ─────────────────────────────────────────────────────────── */

/* ── Variables del configurador ─────────────────────────── */
body.cfg {
  --cfg-header-h: 64px;
  --cfg-form-w:   460px;   /* ancho fijo de la columna de opciones        */
  --cfg-form-pad: 44px;    /* padding lateral interno del formulario       */
}

/* ── Base ────────────────────────────────────────────────── */
.cfg-page {
  padding-top: var(--cfg-header-h);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   PANEL: grid de dos columnas
══════════════════════════════════════════════════════════ */
.cfg-panel {
  display: grid;
  grid-template-columns: var(--cfg-form-w) 1fr;
  align-items: start;
  min-height: calc(100vh - var(--cfg-header-h));
  max-width: 1280px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════
   COLUMNA IZQUIERDA · formulario
══════════════════════════════════════════════════════════ */
.cfg-form {
  padding: 80px var(--cfg-form-pad) 140px;
  border-right: 1px solid var(--rule);
}

/* ── Secciones ───────────────────────────────────────────── */
.cfg-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cfg-divider {
  width: 48px;
  height: 1px;
  background: rgba(184, 148, 95, 0.28);
  border: none;
  margin: 24px 0;
}

/* ── Tipografía de secciones ─────────────────────────────── */
.cfg-paso-num {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--accent);
}

.cfg-title {
  font-family: var(--f-display);
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}

.cfg-lede {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(11px, 1vw, 13px);
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════
   COLUMNA DERECHA · visualización (sticky)
══════════════════════════════════════════════════════════ */
.cfg-vis {
  position: sticky;
  top: var(--cfg-header-h);
  height: calc(100vh - var(--cfg-header-h));
  overflow-y: auto;
  padding: 48px 36px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--soft);
}

/* ── Canvas: medallón o imagen generada ──────────────────── */
.cfg-vis__canvas {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* Estado inicial: medallón centrado con texto de ayuda */
.cfg-vis__medallon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
}

.cfg-vis__medallon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: 0.28;
}

.cfg-vis__hint {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  line-height: 1.75;
  margin: 0;
}
.cfg-vis__hint em {
  font-style: normal;
  color: var(--accent);
}

/* Imagen generada */
.cfg-vis__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cfg-vis__img[hidden] { display: none; }

/* ── Cabecera del resultado (aparece tras la primera generación) */
.cfg-vis__result-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  order: -1;   /* sube al tope del flex cuando se revela */
}
.cfg-vis__result-head[hidden] { display: none; }

.cfg-vis__result-title {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}

/* ── Ficha resumen dinámica ──────────────────────────────── */
.cfg-ficha {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 16px;
  margin: 0;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.cfg-ficha[hidden] { display: none; }

.cfg-ficha dt {
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  align-self: center;
  white-space: nowrap;
}

.cfg-ficha dd {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--ink);
  margin: 0;
  align-self: center;
}

/* ── Botones post-generación ──────────────────────────────── */
.cfg-vis__post {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cfg-vis__post[hidden] { display: none; }

/* Botón de descarga — variante outline, se comporta como enlace */
a.cfg-btn {
  text-decoration: none;
  justify-content: center;
}

/* ── Galería desktop: imagen activa + columna de miniaturas ─────── */
.cfg-vis__gallery {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  flex-shrink: 0;
}

.cfg-vis__gallery > .cfg-vis__canvas {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Botón descarga flotante — esquina sup. derecha de la imagen ── */
.cfg-btn-dl {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 34px;
  height: 34px;
  background: rgba(250,248,244,0.88);
  border: 1px solid rgba(90,85,80,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cfg-btn-dl:hover {
  background: rgba(250,248,244,0.98);
  color: var(--accent);
  border-color: rgba(184,148,95,0.40);
}
.cfg-btn-dl[hidden] { display: none; }

/* ── Historial de ideas generadas ──────────────────────────────── */
.cfg-historial {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 90px;
  flex-shrink: 0;
}
.cfg-historial[hidden] { display: none; }

.cfg-hist-thumb {
  width: 90px;
  height: 90px;
  border: 1px solid rgba(90,85,80,0.22);
  background: var(--soft);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.cfg-hist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cfg-hist-thumb:hover         { border-color: rgba(90,85,80,0.55); }
.cfg-hist-thumb.is-active     { border: 2px solid var(--accent); }

/* ── Sub-selector de superficie (dentro de EL LUGAR) ────────────────────── */
.cfg-superficie-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(90,85,80,0.14);
}
.cfg-superficie-wrap[hidden] { display: none; }

/* D5.1: label standalone de superficie (visible en espacio "Otros") */
#cfgSupOtraLabel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(90,85,80,0.14);
  margin-bottom: 0;
}
#cfgSupOtraLabel[hidden] { display: none; }

.cfg-sup-label {
  font-family: var(--f-body);
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--c-gold, #B8945F);
  margin: 0 0 12px;
}

.cfg-sup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cfg-sup-chip {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #5a5550;
  background: transparent;
  border: 1px solid rgba(90,85,80,0.22);
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.cfg-sup-chip.is-selected,
.cfg-sup-chip[aria-pressed="true"] {
  border-color: #B8945F;
  color: #B8945F;
  background: rgba(184,148,95,0.06);
}
.cfg-sup-chip:hover:not(.is-selected) {
  border-color: rgba(90,85,80,0.6);
  color: #2A2520;
}

/* ── Zona de foto del cliente (D5) ─────────────────────────────────────── */
.cfg-foto-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(90,85,80,0.14);
}
.cfg-foto-wrap[hidden] { display: none; }

.cfg-foto-opcional {
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0.05em;
  color: rgba(90,85,80,0.50);
}

.cfg-foto-zone {
  position: relative;
  border: 1px dashed rgba(90,85,80,0.30);
  cursor: pointer;
  overflow: hidden;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.cfg-foto-zone:hover       { border-color: rgba(90,85,80,0.55); }
.cfg-foto-zone.is-dragover { border-color: #B8945F; background: rgba(184,148,95,0.04); }
.cfg-foto-zone.has-photo   { border-style: solid; border-color: rgba(90,85,80,0.22); }

.cfg-foto-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.cfg-foto-preview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: var(--soft);
}
.cfg-foto-zone.has-photo .cfg-foto-preview { display: block; }
.cfg-foto-zone.has-photo .cfg-foto-hint    { display: none; }

.cfg-foto-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px;
  text-align: center;
  pointer-events: none;
}
.cfg-foto-hint i {
  font-size: 26px;
  color: rgba(90,85,80,0.35);
}
.cfg-foto-hint span {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.10em;
  color: #5a5550;
}
.cfg-foto-sub {
  font-size: 10px !important;
  color: rgba(90,85,80,0.50) !important;
  letter-spacing: 0.07em !important;
}

.cfg-foto-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(26,26,26,0.58);
  color: #FAF8F4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
  z-index: 2;
}
.cfg-foto-clear:hover   { background: rgba(26,26,26,0.82); }
.cfg-foto-clear[hidden] { display: none; }

.cfg-aviso {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--c-gold, #B8945F);
  text-align: center;
  padding: 8px 0 2px;
  margin: 0;
}
.cfg-aviso[hidden] { display: none; }

/* ── Contador de ideas — Grupo C ────────────────────────────── */
.cfg-ideas-card {
  background: var(--soft);
  padding: 20px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.cfg-ideas-eyebrow {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #B8945F;
  display: block;
  margin: 0;
}
.cfg-ideas-eyebrow[hidden] { display: none; }

.cfg-ideas-dots {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.cfg-ideas-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(90, 85, 80, 0.28);
  flex-shrink: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.cfg-ideas-dot.is-filled {
  background: #B8945F;
  border-color: #B8945F;
}

.cfg-ideas-frase {
  font-family: var(--f-body);
  font-size: 15px;
  font-style: italic;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.5;
}

/* Variante móvil: oculta en desktop (el contenedor .cfg-cta-mobile ya lo maneja) */
.cfg-ideas-card--mobile { display: none; }

/* ══════════════════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════════════════ */
.cfg-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 26px;
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background         0.25s ease,
    color              0.25s ease,
    border-color       0.25s ease,
    text-decoration-color 0.25s ease;
  white-space: nowrap;
}

.cfg-btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.cfg-btn--primary:hover:not([disabled]) {
  background: transparent;
  color: var(--ink);
}

.cfg-btn--outline {
  justify-content: center;
  background: transparent;
  color: var(--ink-3);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(90,85,80,0.28);
}
.cfg-btn--outline:hover:not([disabled]) {
  color: var(--accent);
  text-decoration-color: rgba(184,148,95,0.5);
}

.cfg-btn--wa {
  background: #1e9e5e;
  color: #fff;
  border-color: #1e9e5e;
}
.cfg-btn--wa:hover:not([disabled]) {
  background: #178a50;
  border-color: #178a50;
}

.cfg-btn--full {
  width: 100%;
  justify-content: center;
}

.cfg-btn[disabled] {
  opacity: 0.3;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   VEREDICTO DE IDONEIDAD
══════════════════════════════════════════════════════════ */
.cfg-veredicto {
  padding: 18px 22px;
  background: var(--soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
}
.cfg-veredicto[hidden] { display: none; }

.cfg-veredicto.is-ok   { border-left-color: var(--accent); }
.cfg-veredicto.is-warn { border-left-color: #A07830; }
.cfg-veredicto.is-bad  { border-left-color: var(--ink-3); }

.cfg-veredicto__texto {
  margin: 0;
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}

.cfg-veredicto__wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 148, 95, 0.35);
  padding-bottom: 1px;
  letter-spacing: 0.02em;
}
.cfg-veredicto__wa[hidden] { display: none; }
.cfg-veredicto__wa:hover { border-bottom-color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   TARJETAS DE ESPACIO (ícono Phosphor thin + etiqueta)
══════════════════════════════════════════════════════════ */
.cfg-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.cfg-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 10px;
  background: var(--bg);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition:
    border-color 0.22s ease,
    box-shadow   0.22s ease,
    background   0.22s ease,
    opacity      0.28s ease;
  user-select: none;
}

.cfg-card:hover {
  border-color: rgba(184, 148, 95, 0.4);
}

.cfg-card.is-selected {
  border-color: #D4A857;
  box-shadow: inset 0 0 0 2px #D4A857;
  background: rgba(212, 168, 87, 0.06);
}

/* Triángulo oro en esquina — señal inequívoca de selección */
.cfg-card.is-selected::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent #D4A857 transparent transparent;
}

/* Atenuar las no-seleccionadas */
.cfg-card-grid:has(.is-selected) .cfg-card:not(.is-selected) {
  opacity: 0.42;
}

.cfg-card i {
  font-size: 26px;
  color: var(--ink-3);
  transition: color 0.2s ease;
}

.cfg-card:hover i        { color: var(--ink-2); }
.cfg-card.is-selected i  { color: var(--accent); }

.cfg-card__label {
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  transition: color 0.2s ease;
}

.cfg-card:hover .cfg-card__label       { color: var(--ink-2); }
.cfg-card.is-selected .cfg-card__label { color: var(--ink); }

/* 5ª tarjeta (Otros) — alineada a la izquierda en su fila */
.cfg-card-grid .cfg-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 5px);
}

/* ── Campo libre "Otros" ─────────────────────────────────── */
.cfg-otros-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 0.34s ease,
    opacity    0.24s ease 0.04s;
}

.cfg-otros-wrap.is-visible {
  max-height: 72px;
  opacity: 1;
  pointer-events: auto;
  margin-top: 2px;
}

.cfg-otros-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: 0.025em;
  outline: none;
  transition: border-color 0.22s ease;
}

.cfg-otros-input::placeholder {
  color: var(--ink-3);
  font-style: italic;
}

.cfg-otros-input:focus {
  border-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════
   TARJETAS DE MATERIAL (textura + nombre overlay)
   Layout flex: 3 por fila, última fila centrada (3+2)
══════════════════════════════════════════════════════════ */
.cfg-stone-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.cfg-stone-card {
  flex: 0 0 calc(33.333% - 6px);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.cfg-stone-card__face {
  position: relative;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition:
    border-color 0.22s ease,
    box-shadow   0.22s ease,
    opacity      0.28s ease,
    filter       0.28s ease;
}

/* Degradado para legibilidad del nombre */
.cfg-stone-card__face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.42) 45%,
    rgba(0, 0, 0, 0.10) 70%,
    rgba(0, 0, 0, 0)    100%
  );
  pointer-events: none;
}

.cfg-stone-card:hover .cfg-stone-card__face {
  border-color: rgba(184, 148, 95, 0.45);
}

.cfg-stone-card.is-selected .cfg-stone-card__face {
  border-color: #D4A857;
  box-shadow: inset 0 0 0 3px #D4A857;
}

/* Triángulo oro en esquina — visible sobre cualquier textura */
.cfg-stone-card.is-selected .cfg-stone-card__face::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 24px 24px 0;
  border-color: transparent #D4A857 transparent transparent;
}

/* Atenuar no-seleccionadas — la elegida resalta por contraste */
.cfg-stone-grid:has(.is-selected) .cfg-stone-card:not(.is-selected) .cfg-stone-card__face {
  opacity: 0.42;
  filter: saturate(0.5);
}

.cfg-stone-card__name {
  position: relative;
  z-index: 1;
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.03em;
  padding: 0 10px 9px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* ══════════════════════════════════════════════════════════
   BIENVENIDA — nombre, estado, consentimiento
══════════════════════════════════════════════════════════ */
.cfg-welcome__fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.cfg-welcome__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Select: sin apariencia nativa, mismo trazo que cfg-otros-input */
.cfg-select-wrap {
  position: relative;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.22s ease;
}

.cfg-select-wrap:focus-within {
  border-color: var(--accent);
}

/* Chevron fino — mismo tono que ink-3 */
.cfg-select-wrap::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%235a5550' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 5 5 9 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}

.cfg-select {
  width: 100%;
  padding: 13px 24px 13px 0;
  background: transparent;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: 0.025em;
  cursor: pointer;
  outline: none;
}

.cfg-select.is-placeholder {
  color: var(--ink-3);
  font-style: italic;
}

.cfg-select option {
  font-style: normal;
  color: var(--ink);
  background: var(--bg);
}

/* Línea de consentimiento */
.cfg-welcome__consent {
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 8px 0 0;
  line-height: 1.9;
}

.cfg-welcome__consent a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 148, 95, 0.32);
  transition: border-color 0.2s ease;
}

.cfg-welcome__consent a:hover {
  border-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════
   PLACEHOLDER D1 (puede eliminarse cuando BIENVENIDA esté completa)
══════════════════════════════════════════════════════════ */
.cfg-placeholder {
  padding: 40px 24px;
  border: 1px dashed var(--rule);
  color: var(--ink-3);
  font-family: var(--f-body);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════
   CALCULADORA m² (PASO 3)
══════════════════════════════════════════════════════════ */
.cfg-mode-toggle {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}

.cfg-mode-btn {
  padding: 7px 14px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition:
    color        0.2s ease,
    border-color 0.2s ease;
}

.cfg-mode-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.cfg-medidas-panel { display: flex; flex-direction: column; }
.cfg-medidas-panel[hidden] { display: none; }

.cfg-medidas-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
}

.cfg-medida-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cfg-medida-label {
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cfg-medida-input-wrap {
  display: flex;
  align-items: baseline;
  min-width: 0;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.22s ease;
}

.cfg-medida-input-wrap:focus-within {
  border-color: var(--accent);
}

.cfg-medida-input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  background: transparent;
  border: none;
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  -moz-appearance: textfield;
}
.cfg-medida-input::-webkit-outer-spin-button,
.cfg-medida-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cfg-medida-unit {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  padding-bottom: 8px;
  flex-shrink: 0;
}

.cfg-medida-sep {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 300;
  color: var(--ink-3);
  padding-bottom: 8px;
  align-self: flex-end;
  text-align: center;
}

.cfg-m2-result {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 14px 0 2px;
  border-top: 1px solid var(--rule);
  margin-top: 16px;
}

.cfg-m2-num {
  font-family: var(--f-display);
  font-size: 44px;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
}

.cfg-m2-label {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ══════════════════════════════════════════════════════════
   TARJETAS DE ATMÓSFERA (imagen de fondo + etiqueta)
   2 columnas; 5ª tarjeta queda en col 1 (col 2 vacía).
══════════════════════════════════════════════════════════ */
.cfg-atm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.cfg-atm-card {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.cfg-atm-card__face {
  position: relative;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition:
    border-color 0.22s ease,
    box-shadow   0.22s ease,
    opacity      0.28s ease,
    filter       0.28s ease;
}

/* Degradado inferior para legibilidad del nombre */
.cfg-atm-card__face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.42) 45%,
    rgba(0, 0, 0, 0.10) 70%,
    rgba(0, 0, 0, 0)    100%
  );
  pointer-events: none;
}

.cfg-atm-card:hover .cfg-atm-card__face {
  border-color: rgba(184, 148, 95, 0.45);
}

.cfg-atm-card.is-selected .cfg-atm-card__face {
  border-color: #D4A857;
  box-shadow: inset 0 0 0 3px #D4A857;
}

/* Triángulo oro en esquina */
.cfg-atm-card.is-selected .cfg-atm-card__face::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 24px 24px 0;
  border-color: transparent #D4A857 transparent transparent;
}

/* Atenuar no-seleccionadas */
.cfg-atm-grid:has(.is-selected) .cfg-atm-card:not(.is-selected) .cfg-atm-card__face {
  opacity: 0.42;
  filter: saturate(0.5);
}

.cfg-atm-card__name {
  position: relative;
  z-index: 1;
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.03em;
  padding: 0 10px 9px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* ══════════════════════════════════════════════════════════
   SWATCHES DE COLOR (PASO 4)
══════════════════════════════════════════════════════════ */
.cfg-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.cfg-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.cfg-swatch__chip {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(42, 37, 32, 0.14);
  overflow: hidden;
  transition:
    box-shadow   0.22s ease,
    border-color 0.22s ease,
    opacity      0.28s ease,
    filter       0.28s ease;
}

.cfg-swatch__chip--multi {
  background: linear-gradient(
    135deg,
    #F2EFE9 0%,   #E4D9C8 16%,
    #C4A882 32%,  #9A938C 48%,
    #2A2520 64%,  #6E8C73 80%,
    #8C5C50 100%
  );
}

.cfg-swatch:hover .cfg-swatch__chip {
  border-color: rgba(184, 148, 95, 0.55);
}

.cfg-swatch.is-selected .cfg-swatch__chip {
  border-color: #D4A857;
  box-shadow: inset 0 0 0 3px #D4A857;
}

.cfg-swatch.is-selected .cfg-swatch__chip::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 18px 18px 0;
  border-color: transparent #D4A857 transparent transparent;
  z-index: 1;
}

.cfg-swatch-grid:has(.is-selected) .cfg-swatch:not(.is-selected) .cfg-swatch__chip {
  opacity: 0.38;
  filter: saturate(0.4);
}

.cfg-swatch__name {
  font-family: var(--f-body);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.2s ease;
}

.cfg-swatch.is-selected .cfg-swatch__name { color: var(--ink); }

/* ── Pregunta de vetas ─────────────────────────────────── */
.cfg-sublede {
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 8px 0 0;
}

.cfg-vetas-toggle {
  display: flex;
  gap: 8px;
}

.cfg-veta-btn {
  flex: 1;
  padding: 12px 8px;
  background: var(--bg);
  border: 1px solid var(--rule);
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition:
    border-color 0.22s ease,
    box-shadow   0.22s ease,
    background   0.22s ease,
    color        0.22s ease,
    opacity      0.28s ease;
}

.cfg-veta-btn:hover {
  border-color: rgba(184, 148, 95, 0.4);
  color: var(--ink-2);
}

.cfg-veta-btn.is-selected {
  border-color: #D4A857;
  box-shadow: inset 0 0 0 2px #D4A857;
  background: rgba(212, 168, 87, 0.06);
  color: var(--ink);
}

.cfg-vetas-toggle:has(.is-selected) .cfg-veta-btn:not(.is-selected) {
  opacity: 0.42;
}

/* ══════════════════════════════════════════════════════════
   CTA FIJO EN MÓVIL
   Solo visible en < 900px. Sincronizado con #btnGenerar.
══════════════════════════════════════════════════════════ */
.cfg-cta-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -4px 28px rgba(26, 26, 26, 0.08);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MÓVIL (< 900px)
   Las dos columnas se apilan:
   formulario arriba · visualización abajo.
══════════════════════════════════════════════════════════ */
/* ── Medallón: respiración durante la generación ──────────── */
@keyframes medallonBreath {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 0.55; }
}

.cfg-vis__medallon.is-loading img {
  animation: medallonBreath 2.2s ease-in-out infinite;
}

@media (max-width: 899px) {

  .cfg-panel {
    grid-template-columns: 1fr;
    max-width: none;
  }

  /* ── Formulario ──────────────────────────────────────── */
  .cfg-form {
    padding: 48px var(--gutter) 64px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .cfg-divider {
    margin: 44px 0;
  }

  /* ── Visualización ───────────────────────────────────── */
  .cfg-vis {
    position: static;
    height: auto;
    overflow-y: visible;
    border-left: none;
    padding: 48px var(--gutter) 128px;  /* clearance del CTA fijo — aumentado en D4.2 por #cfgIdeasMobile */
  }

  .cfg-vis__result-title {
    font-size: clamp(22px, 5.5vw, 36px);
  }

  /* ── Desktop-only button: oculto en móvil ────────────── */
  #btnGenerar {
    display: none;
  }

  /* ── Contador desktop oculto en móvil (usa variante --mobile) ── */
  #cfgIdeas { display: none; }

  /* ── CTA fijo: visible en móvil ─────────────────────── */
  .cfg-cta-mobile {
    display: block;
  }

  /* ── Contador ideas dentro del bar fijo ─────────────── */
  .cfg-ideas-card--mobile {
    display: flex;
    padding: 10px 16px 8px;
    gap: 8px;
  }
  .cfg-ideas-card--mobile .cfg-ideas-frase {
    font-size: 12px;
  }
  .cfg-ideas-card--mobile .cfg-ideas-eyebrow {
    font-size: 11px;
  }
  .cfg-ideas-card--mobile .cfg-ideas-dot {
    width: 7px;
    height: 7px;
  }

  /* ── Galería móvil: imagen arriba, miniaturas en fila con scroll ── */
  .cfg-vis__gallery {
    flex-direction: column;
  }

  .cfg-historial {
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .cfg-historial::-webkit-scrollbar { display: none; }

  .cfg-hist-thumb {
    width: 72px;
    height: 72px;
  }
}

/* ── Lightbox ─────────────────────────────────────────────── */
.cfg-vis__img:not([hidden]) { cursor: zoom-in; }

.cfg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.cfg-lightbox[hidden] { display: none; }

.cfg-lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  cursor: default;
}

.cfg-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(250, 248, 244, 0.12);
  border: 1px solid rgba(250, 248, 244, 0.18);
  color: #FAF8F4;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.cfg-lightbox__close:hover { background: rgba(250, 248, 244, 0.22); }
