/* =====================================================================
   NexSell — componentes de formulario (.ns-seg / .ns-switch / .ns-q …)
   Cargado AL FINAL del <body> (después de la segunda carga de
   nexsell-app.css) para que gane en empate de especificidad. Solo presentación: los <input> reales siguen
   ahí (mismos name/id/value/onchange), así que la lógica no cambia.
   Usado en: Productos (formulario + simulador de precio) y Ventas
   (registrar venta).
   ===================================================================== */

/* ---------- 1. Control segmentado (.ns-seg) ----------
   <div class="ns-seg" role="radiogroup" aria-labelledby="…">
     <label class="ns-seg__opt"><input type="radio" name="x" value="a"><span>A</span></label>
     …
   </div>
   Radios reales, invisibles pero accesibles: Tab entra al grupo, ←/→
   cambian la opción y el lector anuncia "radio 1 de 2". */
.ns-seg {
  --ns-seg-h: 40px;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  margin: 0;
  max-width: 100%;
  border-radius: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  vertical-align: middle;
}
.ns-seg--block { display: grid; width: 100%; }
.ns-seg--sm { --ns-seg-h: 32px; border-radius: 10px; }
.ns-seg__opt {
  position: relative;
  display: flex !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  min-height: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  cursor: pointer;
}
/* El punto del radio desaparece; el input cubre el segmento y sigue enfocable. */
.ns-seg__opt > input[type="radio"] {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
}
.ns-seg__opt > input[type="radio"]::after { display: none !important; }
.ns-seg__opt > span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--ns-seg-h);
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
  user-select: none;
}
.ns-seg--sm .ns-seg__opt > span { padding: 0 14px; font-size: 13px; border-radius: 7px; min-width: 44px; }
.ns-seg__opt:hover > input:not(:checked):not(:disabled) + span {
  color: var(--text-primary);
  background: var(--bg-hover, #20262F);
}
.ns-seg__opt > input:checked + span {
  background: linear-gradient(180deg, #19CC89 0%, var(--accent-primary-strong, #0FB574) 100%);
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .22);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.ns-seg__opt > input:checked + span strong,
.ns-seg__opt > input:checked + span b { color: inherit !important; }
.ns-seg__opt > input:focus-visible + span {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.ns-seg__opt > input:disabled { cursor: not-allowed; }
.ns-seg__opt > input:disabled + span { opacity: .45; }
@media (prefers-reduced-motion: reduce) {
  .ns-seg__opt > span { transition: none; }
}

/* ---------- 2. Pregunta con toggle en línea (.ns-q) ----------
   Etiqueta a la izquierda, segmentado Sí/No a la derecha. */
.ns-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0 !important;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-tertiary);
  box-sizing: border-box;
}
.ns-q > .form-label {
  display: block !important;
  margin: 0 !important;
  font-size: 13.5px !important;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary) !important;
  text-transform: none;
  letter-spacing: 0;
}
.ns-q > .form-label .ns-q__sub { color: var(--text-muted); font-weight: 400; }
.ns-q > .ns-seg { flex: none; }
/* Campos condicionales: pegados al toggle, con una guía a la izquierda. */
.ns-cond {
  margin: 10px 0 0 !important;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent-border);
}
.ns-cond.form-row { gap: 12px; }
.ns-cond .form-group { margin-bottom: 0 !important; }

/* ---------- 3. Interruptor (.ns-switch) ----------
   <label class="ns-switch"><input type="checkbox" class="switch-input" id="…"><span>Texto</span></label>
   Reusa el .switch-input que ya existe (así no le pega el estilo de casilla global). */
.ns-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.3;
}
.ns-switch > .switch-input { width: 36px; height: 20px; }
.ns-switch > .switch-input::after { width: 14px; height: 14px; left: 2px; }
.ns-switch > .switch-input:checked::after { transform: translate(16px, -50%); }
.ns-switch:hover > .switch-input:not(:checked) { border-color: var(--accent-border); }
.ns-switch > .switch-input:disabled,
.ns-switch > .switch-input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ---------- 4. Fila de acciones (.ns-actions) ---------- */
.ns-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.ns-actions > .btn { margin: 0 !important; min-height: 44px; }
.ns-actions > .btn-primary { min-width: 180px; justify-content: center; }
.ns-actions > button[type="reset"] {
  margin-left: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-secondary) !important;
}
.ns-actions > button[type="reset"]:hover { color: var(--text-primary) !important; background: var(--bg-tertiary) !important; }
@media (max-width: 640px) {
  .ns-actions > .btn { flex: 1 1 100%; width: 100%; justify-content: center; }
  .ns-actions > button[type="reset"] { margin-left: 0 !important; }
}

/* ---------- 5. Resultado en vivo (.ns-profit) ---------- */
.ns-profit { position: relative; margin: 18px 0 0; }
.ns-profit:has(> #prodProfitLive[style*="none"]) { display: none; }
#products .ns-profit > #prodProfitLive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 !important;
  padding: 10px 44px 10px 16px !important;
  min-height: 52px;
  box-sizing: border-box;
  border-radius: 12px !important;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), .03)) !important;
  border: 1px solid var(--accent-border) !important;
  font-size: 13.5px !important;
  font-weight: 500;
  color: var(--text-secondary);
}
#products .ns-profit > #prodProfitLive strong {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px !important;
  font-weight: 700;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.ns-profit > .help-tip {
  position: absolute !important;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 !important;
}

/* ---------- 6. Ayuda (?) siempre chica y alineada ---------- */
#productForm .help-tip,
#salesForm .help-tip { width: 16px; height: 16px; min-width: 16px; font-size: 10.5px; margin-left: 5px; vertical-align: -2px; }

/* =====================================================================
   PRODUCTOS · formulario de producto
   ===================================================================== */
#productForm .form-label,
#salesForm .form-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 4px;
  min-height: 18px;
}
#productForm .form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0;
}
#productForm .form-row { gap: 14px; margin-bottom: 16px; }
#productForm .form-row > .form-group { margin-bottom: 0; }
#productForm .form-control { min-height: 42px; }
#productForm #prodVariantsBlock { margin: 8px 0 4px !important; padding-top: 16px !important; border-top: 1px solid var(--border-soft) !important; }
#productForm #prodVariantsBlock > .ns-q + #prodVariantsPanel { margin-top: 10px !important; }
.ns-sec-title {
  margin: 22px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Envío y comisión lado a lado en escritorio; campos condicionales bajo cada toggle. */
.ns-costs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "st ct" "sf cf";
  column-gap: 16px;
  align-items: start;
}
.ns-costs > #prodShippingToggleRow { grid-area: st; }
.ns-costs > #prodShippingFields { grid-area: sf; }
.ns-costs > #prodCommissionToggleRow { grid-area: ct; }
.ns-costs > #prodCommissionFields { grid-area: cf; }
#productForm .ns-costs > .ns-cond { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 0 !important; }
#productForm #prodCommissionHint { margin-top: 4px !important; font-size: 12px; color: var(--text-muted) !important; }
@media (max-width: 760px) {
  .ns-costs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "st" "sf" "ct" "cf"; }
  .ns-costs > #prodCommissionToggleRow { margin-top: 10px !important; }
}
@media (max-width: 360px) {
  .ns-q { flex-wrap: wrap; padding: 10px; }
}

/* =====================================================================
   VENTAS · registrar venta
   ===================================================================== */
#salesForm .form-row { gap: 14px; margin-bottom: 16px; }
#salesForm .form-row > .form-group { margin-bottom: 0; }
#salesForm #saleLineasBloque { margin-bottom: 16px !important; }
#salesForm #saleLineasBloque > .form-label {
  margin: 4px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#salesForm #saleEnvioBloque,
#salesForm #saleComisionBloque { padding: 10px 14px !important; margin-bottom: 12px !important; }
#salesForm .ns-field { margin-bottom: 16px !important; min-width: 0; }
#salesForm .ns-field > .form-label { display: flex; align-items: center; margin-bottom: 8px; }
#salesForm .ns-field > .ns-seg { min-width: min(100%, 360px); }
#salesForm .ns-field > .venta-opt-wrap.abierto { margin-top: 10px; }
#salesForm .ns-conds {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 24px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
#salesForm .ns-conds > #saleEnvioBloque,
#salesForm .ns-conds > #saleComisionBloque,
#salesForm .ns-conds > #salePagoBloque { grid-column: 1 / -1; }
#salesForm #salePagoResumen:not(:empty) { display: block; margin-top: 8px; }
#salesForm #saleSubmitHint { margin: 4px 0 0 !important; font-size: 12.5px; }
#salesForm .ns-actions { margin-top: 12px; }
#salesForm #saleEnvioAjuste > .ns-seg,
#salesForm #saleComisionAjuste > .ns-seg { margin: 2px 0 8px; }
@media (max-width: 760px) {
  #salesForm .ns-conds { grid-template-columns: minmax(0, 1fr); }
  #salesForm .ns-field > .ns-seg { display: grid; width: 100%; min-width: 0; }
}
/* En pantalla chica los segmentos parten en dos líneas en vez de cortar el texto. */
@media (max-width: 760px) {
  .ns-seg:not(.ns-seg--sm) .ns-seg__opt > span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    flex-wrap: wrap;
    gap: 0 4px;
    min-height: 44px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.25;
  }
}

/* =====================================================================
   SIMULADOR DE PRECIO (modal .psim)
   ===================================================================== */
.psim-ov .psim-form { padding: 16px 20px 20px; }
.psim-ov .psim-sec {
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, .015);
}
.psim-ov .psim-sec:last-child { border-bottom: 1px solid var(--border-soft); }
.psim-ov .psim-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--text-secondary);
}
.psim-ov .psim-form .psim-cap::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--accent-primary);
}
.psim-ov .psim-f > span { font-size: 12.5px; font-weight: 500; }
.psim-ov .psim-sec .ns-switch { display: flex; margin-top: 12px; }
.psim-ov .psim-iva-row { align-items: end; }
.psim-ov .psim-iva-row > .ns-switch { margin: 0 !important; min-height: 40px; }
.psim-ov .psim-side { background: var(--bg-primary); }
.psim-ov .psim-price { font-size: 38px; letter-spacing: -.02em; }
.psim-ov .psim-kpi { border-radius: 12px; background: var(--bg-secondary); }
.psim-ov .psim-cmp tr + tr td { border-top: 1px solid var(--border-soft); }
.psim-ov .psim-cmp td { padding: 8px 0; }
@media (max-width: 760px) {
  .psim-ov .psim-form { padding: 12px; }
  .psim-ov .psim-sec { padding: 14px; }
  .psim-ov .psim-row { gap: 10px; }
  .psim-ov .psim-price { font-size: 30px; }
  .psim-ov .psim-iva-row > .ns-switch { min-height: 32px; }
}

/* ---------- 7. Resumen de envío / comisión con ícono de línea ---------- */
#salesForm .ns-sum-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
#salesForm .ns-sum-ico svg { width: 15px; height: 15px; stroke-width: 2; }
#salesForm #saleEnvioResumen,
#salesForm #saleComisionResumen { font-size: 13.5px !important; font-weight: 600; }

/* ---------- 8. Mini barra de resultado (.ns-sum) ---------- */
#salesForm .ns-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 0 12px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), .03));
  border: 1px solid var(--accent-border);
  font-size: 13px;
  color: var(--text-secondary);
}
#salesForm .ns-sum__items { display: flex; flex-wrap: wrap; gap: 4px 16px; }
#salesForm .ns-sum__items strong { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
#salesForm .ns-sum__warn { color: var(--accent-danger); }
#salesForm .ns-sum__main { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
#salesForm .ns-sum__main strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  #salesForm .ns-sum__main { margin-left: 0; width: 100%; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--accent-border); }
}

/* ---------- 9. Modal Editar venta ---------- */
.venta-modal .ns-q { margin-bottom: 0 !important; }
.venta-modal #editSaleComWrap.ns-cond { margin-top: 10px !important; }

/* ---------- 10. Variantes con nombre (formulario de producto) ----------
   Switch "Este producto tiene variantes" + campo "nombre + Enter/Agregar" + lista de filas.
   Cada fila: nombre editable (renombrar = escribir encima), resumen y "Más opciones". */
#productForm #prodVariantsPanel {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-tertiary);
}
#productForm #prodVariantsBlock .ns-q > .ns-switch { flex: none; padding-right: 8px; }
#productForm .ns-var-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
#productForm .ns-var-hint { color: var(--text-muted); font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
#productForm .ns-var-add { display: flex; gap: 8px; align-items: stretch; }
#productForm .ns-var-add > .form-control { flex: 1 1 auto; min-width: 0; max-width: none; }
#productForm .ns-var-add > .btn { flex: none; width: auto !important; white-space: nowrap; min-height: 42px; }
#productForm .ns-var-msg { margin: 8px 0 0; font-size: 12.5px; color: var(--accent-danger); }
#productForm .ns-var-msg--info { color: var(--text-secondary); }
#productForm .ns-var-general {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 0 0; padding: 8px 8px 8px 12px;
  border: 1px dashed var(--border-soft); border-radius: 10px;
}
#productForm .ns-var-general > label { font-size: 13px; color: var(--text-secondary); margin: 0; }
#productForm .ns-var-general > .form-control { width: 110px; flex: none; }
#products #varCombosSection { margin-top: 14px; }
#productForm .ns-var-empty { color: var(--text-muted); font-size: 13px; margin: 4px 0 2px; }
#productForm .ns-var-list { display: flex; flex-direction: column; gap: 8px; }
#productForm .ns-var-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 10px 10px 12px;
  min-width: 0;
}
#productForm .ns-var-item.is-open { border-color: var(--accent-border); }
#productForm .ns-var-item__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
#productForm .ns-var-item__id { flex: 1 1 auto; min-width: 0; }
#productForm .ns-var-item__name {
  min-height: 38px !important; font-weight: 600; max-width: none;
  background: transparent; border-color: transparent;
}
#productForm .ns-var-item__name:hover { border-color: var(--border-soft); }
#productForm .ns-var-item__name:focus { background: var(--bg-tertiary); border-color: var(--accent-border); }
#productForm .ns-var-item__meta { font-size: 12.5px; color: var(--text-secondary); padding: 2px 0 0 13px; line-height: 1.4; overflow-wrap: anywhere; }
#productForm .ns-var-item__meta strong { color: var(--text-primary); font-weight: 600; }
#productForm .ns-var-item__inh { color: var(--text-muted); }
#productForm .ns-var-item__actions { display: flex; gap: 8px; align-items: center; flex: none; }
#productForm .ns-var-item__more { margin-top: 10px; }
#productForm .ns-var-item__switches { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; flex: 1 1 100%; }
#productForm .ns-var-item__amt { width: 130px; flex: none; }
#productForm .ns-var-total { margin: 10px 0 0; font-size: 13px; color: var(--text-secondary); }
#productForm .ns-var-total strong { color: var(--accent-primary); }
@media (max-width: 760px) {
  #productForm .ns-var-add > .btn { padding-left: 14px; padding-right: 14px; }
  #productForm .ns-var-general { flex-wrap: wrap; }
  #productForm .ns-var-general > .form-control { width: 100%; }
  #productForm .ns-var-item__main { flex-wrap: wrap; }
  #productForm .ns-var-item__id { flex-basis: 100%; }
  #productForm .ns-var-item__actions { width: 100%; }
  #productForm .ns-var-item__actions > .btn { flex: 1; justify-content: center; }
  #productForm .ns-var-item__more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #productForm .ns-var-item__more .prod-var-field-foto,
  #productForm .ns-var-item__switches { grid-column: 1 / -1; }
}

/* ---------- 11. Píldoras que envuelven (.ns-seg--wrap) ----------
   Mismo look que .ns-seg, pero con muchas opciones de largo libre (ej. variantes):
   bajan de línea en vez de achicarse. */
.ns-seg--wrap { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; }
.ns-seg--wrap > .ns-seg__opt { flex: 0 1 auto; max-width: 100%; }
.ns-seg--wrap .ns-seg__opt > span { min-height: 36px; padding: 0 14px; white-space: nowrap; }
.ns-seg--wrap .ns-seg__opt > span small { font-size: 11.5px; font-weight: 500; opacity: .75; }
/* El <select> sigue existiendo (fuente del valor) pero no se ve: lo reemplazan las píldoras. */
.ns-sel-oculto {
  position: absolute !important; width: 1px !important; height: 1px !important;
  min-height: 0 !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important;
  opacity: 0 !important; pointer-events: none !important;
}
.ns-var-pills-vacio { margin: 4px 0 0; font-size: 13px; color: var(--accent-danger); }
/* Venta: la variante ocupa su propia fila completa bajo producto + cantidad. */
#salesForm #saleVariantWrap { max-width: none; position: relative; }
#salesForm #saleLineasBloque > .form-row.ns-con-variantes { grid-template-columns: minmax(0, 1fr) minmax(120px, 180px); }
#salesForm #saleLineasBloque > .form-row.ns-con-variantes > #saleVariantWrap { grid-column: 1 / -1; order: 3; }
@media (max-width: 768px) {
  #salesForm #saleLineasBloque > .form-row.ns-con-variantes { grid-template-columns: minmax(0, 1fr); }
}
#sales .venta-linea-extra { grid-template-columns: minmax(0, 1.5fr) 88px minmax(110px, .7fr) auto; }
#sales .venta-linea-extra .vl-var-wrap { grid-column: 1 / -1; order: 1; min-width: 0 !important; position: relative; }
#sales .venta-linea-extra .vl-resumen { order: 2; }
@media (max-width: 720px) {
  #sales .venta-linea-extra { grid-template-columns: 1fr 1fr; }
  .ns-seg--wrap > .ns-seg__opt { flex: 1 1 auto; }
  .ns-seg--wrap .ns-seg__opt > span { min-height: 44px; white-space: normal; }
}

/* ---------- 12. Qué cambia entre variantes (Nombre / Color / Talla / Color y talla) ---------- */
#productForm .ns-var-modo { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 8px 0 10px; }
#productForm .ns-var-modo__lbl { font-size: 13px; font-weight: 600; color: var(--text-primary); }
#productForm .ns-var-modo__seg { flex: none; }
/* Fila de variante de color/talla: campos en línea como el editor de siempre. */
#productForm .ns-var-item__main--clasico { align-items: flex-end; }
#productForm .ns-var-item__fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; min-width: 0; }
#productForm .ns-var-item__fields > .prod-var-field { flex: 1 1 140px; }
#productForm .ns-var-item__fields > .ns-var-f-color { flex: 2 1 200px; }
#productForm .ns-var-item__main--clasico .ns-var-item__meta { padding-left: 2px; padding-top: 6px; }
.ns-pill-swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}
@media (max-width: 760px) {
  #productForm .ns-var-modo__seg { display: grid; grid-auto-flow: row; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  #productForm .ns-var-item__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  #productForm .ns-var-item__fields > .ns-var-f-color { grid-column: 1 / -1; }
}

/* ---------- Venta única (2026-09-30) ----------
   Interruptor del formulario de producto, insignia en tarjetas, pills del panel de
   archivados, interruptor de la burbuja de ML y ajuste en Configuración → Canales. */
#productForm .vu-q { margin: 12px 0 4px !important; }
#productForm .vu-q > .ns-switch { flex: none; padding-right: 8px; }
#products .prod-badge.vu-badge,
.prod-badge.vu-badge {
  color: var(--accent-primary);
  background: var(--accent-soft);
  border-color: var(--accent-border);
  margin-left: 4px;
  vertical-align: middle;
}
.prod-arch-name .prod-badge.vu-badge { margin-top: 0; font-size: 10.5px; }
#products .vu-arch-seg { margin: 4px 0 10px; }
#products .vu-arch-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
#products .vu-chip i, #products .vu-chip svg { width: 14px; height: 14px; vertical-align: -2px; }
/* Burbuja de venta nueva de ML (2026-09-30): Nova pregunta con 3 opciones (pills). */
.vu-elige { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vu-elige__opt {
  flex: 1 1 auto; min-height: 36px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary);
  font-weight: 600; font-size: 12.5px; line-height: 1.25; font-family: inherit; cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.vu-elige__opt:hover { border-color: var(--accent-primary); }
.vu-elige__opt:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.vu-elige__opt.is-sugerida { border-color: var(--accent-primary); }
.vu-elige__opt.is-activa { background: var(--accent-primary); border-color: var(--accent-primary); color: #04130C; }
.vu-elige__tag {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: color-mix(in srgb, var(--accent-primary) 18%, transparent); color: var(--accent-primary); vertical-align: 1px;
}
.vu-elige__opt.is-activa .vu-elige__tag { background: rgba(4, 19, 12, .16); color: #04130C; }
.vu-elige__sub { margin-top: 6px; font-size: 11.5px; line-height: 1.45; color: var(--text-muted); min-height: 1em; }
.vu-elige__foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.vu-elige__skip {
  background: none; border: 0; padding: 4px 2px; font-weight: 500; font-size: 12px; line-height: 1.2; font-family: inherit;
  color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.vu-elige__skip:hover { color: var(--text-secondary); }
.vu-pick { margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--bg-primary); border: 1px solid var(--border-color); }
.vu-pick[hidden] { display: none; }
.vu-pick__q {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border-color);
  background: var(--bg-secondary); color: var(--text-primary); font-weight: 400; font-size: 13px; line-height: 1.3; font-family: inherit;
}
.vu-pick__q:focus { outline: none; border-color: var(--accent-primary); }
.vu-pick__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 176px; overflow-y: auto; }
.vu-pick__pill {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-secondary);
  color: var(--text-primary); font-weight: 500; font-size: 12.5px; line-height: 1.25; font-family: inherit; cursor: pointer; text-align: left;
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}
.vu-pick__pill:hover { border-color: var(--accent-primary); }
.vu-pick__pill.is-on { background: var(--accent-primary); border-color: var(--accent-primary); color: #04130C; font-weight: 700; }
.vu-pick__vars { margin-top: 10px; }
.vu-pick__vars[hidden] { display: none; }
.vu-pick__ttl { font-size: 12.5px; color: var(--text-secondary); }
.vu-pick__hint { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }
.vu-pick__vacio { font-size: 12.5px; color: var(--text-muted); padding: 4px 2px; }
.vu-pick__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.vu-pick__ok[disabled] { opacity: .55; cursor: not-allowed; }
.vu-pick__nota { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; flex: 1 1 180px; }
.vu-desde-venta {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-secondary)); border: 1px solid var(--accent-primary);
  color: var(--text-primary);
}
.vu-desde-venta__x {
  margin-left: 6px; background: none; border: 0; padding: 0; color: var(--text-secondary); cursor: pointer;
  font-weight: 600; font-size: 12px; line-height: 1.2; font-family: inherit; text-decoration: underline;
}
.mia-chip.mia-chip--sugerida { border-color: var(--accent-primary); color: var(--text-primary); }
.vu-ml-set {
  margin: 4px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-tertiary);
}
.vu-ml-set__ttl { font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.vu-ml-set .ns-seg { width: 100%; }
.vu-ml-set .ns-seg__opt > span { font-size: 12.5px; }
.vu-ml-set__hint { margin: 8px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--text-muted); }
