/* configurador-mueble.css — Configurador de muebles de baño (fase 5).
   Funciona en el sitio público (tokens de variables.css) y dentro de los
   paneles del personal (tokens propios: --accent, --border, --text…), por eso
   cada variable local tiene los dos orígenes. Tema claro/oscuro por herencia. */
.wcfg {
  --w-ac: var(--color-primary, var(--accent, #8b7355));
  --w-gold: var(--color-accent, var(--accent2, #c9a96e));
  --w-bd: var(--color-border, var(--border, #3d3d3d));
  --w-tx: var(--color-text-main, var(--text, #e0e0e0));
  --w-mu: var(--color-text-muted, var(--muted, #a0a0a0));
  --w-in: var(--color-bg-input, var(--chip, #3d3d3d));
  --w-sel: var(--color-primary-light, rgba(139, 115, 85, .16));
  --w-r: 10px;
  color: var(--w-tx);
  font-family: var(--font-body, 'Inter', 'Segoe UI', sans-serif);
  display: flex;
  flex-direction: column;
}
.wcfg-sec { padding: 22px 0 24px; border-top: 1px solid var(--w-bd); }
.wcfg-sec:first-child { border-top: 0; padding-top: 4px; }
.wcfg-sec-h { margin-bottom: 14px; }
.wcfg-sec-h h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; color: var(--w-tx); letter-spacing: -.01em; }
.wcfg-sec-h p { margin: 0; font-size: .875rem; color: var(--w-mu); line-height: 1.5; max-width: 62ch; }
.wcfg-sub { margin-top: 18px; }
.wcfg-sub h4 { font-size: .875rem; font-weight: 600; margin: 0 0 8px; color: var(--w-tx); }
.wcfg-h5 { font-size: .8125rem; font-weight: 600; color: var(--w-mu); margin: 14px 0 8px; }
.wcfg-nota { margin: 12px 0 0; font-size: .8125rem; color: var(--w-mu); background: var(--w-sel); padding: 10px 12px; border-radius: 8px; line-height: 1.5; }
/* Aviso de monomando bajo (piezas3d.js): recomendación discreta, fondo dorado tintado + borde fino completo. */
.wcfg-nota--aviso { display: flex; gap: 8px; align-items: flex-start; color: var(--w-tx);
  background: color-mix(in srgb, var(--w-gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--w-gold) 35%, transparent); }
.wcfg-nota--aviso[hidden] { display: none; }
.wcfg-nota--aviso .wh-cod { white-space: nowrap; }   /* códigos (YM-BLACK-G29) sin partirse en el guion */
.wcfg-nota--aviso svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--w-gold); }
.wcfg-incluido { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--w-r); background: var(--w-sel); font-size: .9rem; line-height: 1.5; }
.wcfg-incluido svg { width: 18px; height: 18px; flex: none; color: var(--w-gold); margin-top: 2px; }
.wcfg-error { color: var(--color-error, #e07a7a); }

/* Medida */
.wcfg-medida { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: center; }
.wcfg-lectura { font-variant-numeric: tabular-nums; font-size: 2.25rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--w-tx); min-width: 4.2ch; }
.wcfg-lectura span { color: var(--w-gold); }
.wcfg-rango { width: 100%; height: 32px; accent-color: var(--w-ac); cursor: pointer; background: transparent; }
.wcfg-num { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--w-mu); }
.wcfg-num input { width: 92px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--w-bd); background: var(--w-in); color: var(--w-tx); font: inherit; font-size: .95rem; font-variant-numeric: tabular-nums; }
.wcfg-num input:focus-visible { outline: 2px solid var(--w-ac); outline-offset: 1px; }

/* Chips, opciones segmentadas */
.wcfg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wcfg-chip {
  border: 1px solid var(--w-bd); background: transparent; color: var(--w-tx); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: .8125rem; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background-color .15s ease, border-color .15s ease;
}
.wcfg-chip:hover { border-color: var(--w-ac); }
.wcfg-chip.is-on { background: var(--w-ac); border-color: var(--w-ac); color: #fff; }
.wcfg-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.wcfg-seg--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wcfg-opt {
  text-align: left; border: 1px solid var(--w-bd); background: transparent; color: var(--w-tx);
  border-radius: var(--w-r); padding: 11px 13px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wcfg-opt strong { font-size: .9rem; font-weight: 600; }
.wcfg-opt span { font-size: .78rem; color: var(--w-mu); line-height: 1.35; }
.wcfg-opt:hover:not(:disabled) { border-color: var(--w-ac); }
.wcfg-opt.is-on { border-color: var(--w-ac); background: var(--w-sel); box-shadow: inset 0 0 0 1px var(--w-ac); }
.wcfg-opt:disabled { opacity: .45; cursor: not-allowed; }
.wcfg-partes { margin-bottom: 14px; }
.wcfg button:focus-visible, .wcfg input:focus-visible { outline: 2px solid var(--w-gold); outline-offset: 2px; }

/* Colores */
.wcfg-color-actual { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.wcfg-color-actual i { width: 56px; height: 40px; border-radius: 8px; background-size: cover; background-position: center; border: 1px solid var(--w-bd); flex: none; }
.wcfg-color-actual small { display: block; font-size: .75rem; color: var(--w-mu); }
.wcfg-color-actual strong { font-size: 1rem; font-weight: 600; }
.wcfg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 12px; max-height: 340px; overflow-y: auto; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--w-bd) transparent; }
.wcfg-swatches--piedra { max-height: none; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.wcfg-sw { min-width: 0; border: 1px solid transparent; background: transparent; color: var(--w-tx); padding: 4px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; font: inherit; }
.wcfg-sw i { width: 100%; aspect-ratio: 4 / 3; border-radius: 7px; background-size: cover; background-position: center; border: 1px solid var(--w-bd); }
.wcfg-swatches--piedra .wcfg-sw i { aspect-ratio: 1; border-radius: 50%; width: 64%; }
.wcfg-sw span { font-size: .72rem; line-height: 1.2; text-align: center; color: var(--w-mu); overflow-wrap: anywhere; hyphens: auto; max-width: 100%; }
.wcfg-sw:hover i { border-color: var(--w-ac); }
.wcfg-sw.is-on { border-color: var(--w-ac); background: var(--w-sel); }
.wcfg-sw.is-on span { color: var(--w-tx); font-weight: 600; }

/* Ovalines / monomandos con foto */
.wcfg-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.wcfg-item { border: 1px solid var(--w-bd); background: transparent; color: var(--w-tx); border-radius: var(--w-r); padding: 6px 6px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; }
.wcfg-item img, .wcfg-item-ph { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: #fff; }
.wcfg-item strong { font-size: .78rem; font-weight: 600; }
.wcfg-item small { font-size: .7rem; color: var(--w-mu); text-align: center; line-height: 1.2; }
.wcfg-item:hover { border-color: var(--w-ac); }
.wcfg-item.is-on { border-color: var(--w-ac); background: var(--w-sel); box-shadow: inset 0 0 0 1px var(--w-ac); }

/* Filas con interruptor / cantidad */
.wcfg-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--w-bd); cursor: pointer; }
.wcfg-sub > .wcfg-row:first-of-type, .wcfg-sec-h + .wcfg-row { border-top: 0; }
div.wcfg-row { cursor: default; }
.wcfg-row-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wcfg-row-t strong { font-size: .9rem; font-weight: 600; }
.wcfg-row-t span { font-size: .78rem; color: var(--w-mu); }
.wcfg-precio { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--w-gold); white-space: nowrap; }
.wcfg-switch { position: relative; width: 42px; height: 24px; flex: none; }
.wcfg-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.wcfg-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--w-in); border: 1px solid var(--w-bd); transition: background-color .2s ease; pointer-events: none; }
.wcfg-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.22, 1, .36, 1); }
.wcfg-switch input:checked + i { background: var(--w-ac); border-color: var(--w-ac); }
.wcfg-switch input:checked + i::after { transform: translateX(18px); }
.wcfg-switch input:focus-visible + i { outline: 2px solid var(--w-gold); outline-offset: 2px; }
.wcfg-qty { display: inline-flex; align-items: center; border: 1px solid var(--w-bd); border-radius: 999px; flex: none; }
.wcfg-qty button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--w-tx); cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.wcfg-qty button:disabled { opacity: .35; cursor: not-allowed; }
.wcfg-qty svg { width: 15px; height: 15px; }
.wcfg-qty output { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; }

@media (max-width: 560px) {
  .wcfg-lectura { font-size: 1.9rem; }
  .wcfg-seg { grid-template-columns: 1fr 1fr; }
  .wcfg-seg--piedras { grid-template-columns: 1fr 1fr; }
  .wcfg-swatches { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); max-height: 300px; }
  .wcfg-items { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .wcfg-row { flex-wrap: wrap; }
  .wcfg-row-t { flex-basis: calc(100% - 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .wcfg * { transition: none !important; }
}
/* F4: frentes del modelo (dibujo de frentes-svg.js con las variables --wf-*) */
.wcfg-frentes { margin-top: 16px; border: 1px solid var(--w-bd); border-radius: var(--w-r); overflow: hidden; }
.wcfg-frentes-dib { padding: 12px 14px 4px; --wf-madera: var(--w-ac); --wf-oro: var(--w-gold); --wf-texto: var(--w-tx); --wf-fondo: var(--color-bg-card, var(--panel, #242120)); --wf-hueco: var(--color-bg-main, var(--bg, #141312)); --wf-suave: var(--w-mu); }
.wcfg-frentes-dib .wf-svg { display: block; width: 100%; height: auto; max-height: 160px; }
.wcfg-frentes p { margin: 0; padding: 10px 12px; font-size: .8125rem; line-height: 1.5; color: var(--w-mu); border-top: 1px solid var(--w-bd); }
.wcfg-frentes strong { color: var(--w-tx); font-weight: 600; }
.wcfg-estimado { display: inline-block; margin-left: 4px; font-size: .72rem; font-weight: 600; color: var(--w-tx); border: 1px solid color-mix(in srgb, var(--w-gold) 40%, transparent); background: color-mix(in srgb, var(--w-gold) 12%, transparent); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
/* Ronda 9: tirador obligatorio (radiogroup). Falta = borde completo tintado del dorado (sin border-left de acento). */
.wcfg-tiradores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wcfg-tiradores.is-falta { padding: 8px; border: 1px solid color-mix(in srgb, var(--w-gold) 55%, transparent); background: color-mix(in srgb, var(--w-gold) 8%, transparent); border-radius: calc(var(--w-r) + 4px); }
.wcfg-tir:focus-visible { outline: 2px solid var(--w-gold); outline-offset: 2px; }
.wcfg-tir-modelo { font-style: normal; font-size: .7rem; font-weight: 600; color: var(--w-mu); border: 1px solid var(--w-bd); border-radius: 999px; padding: 0 6px; margin-left: 4px; white-space: nowrap; vertical-align: 1px; }
.wcfg-falta { display: inline-flex; align-items: center; gap: 6px; color: var(--w-tx); font-weight: 600; }
.wcfg-falta svg { width: 16px; height: 16px; color: var(--w-gold); flex: none; }
@media (max-width: 560px) { .wcfg-tiradores { grid-template-columns: 1fr 1fr; } }
