/* ==========================================================================
   NECS theme — Cotizador "Arma tu PC"  ·  pc-builder.css
   Dirección: CONFIGURADOR TECH MODERNO — denso, confiado, compacto. Tema claro,
   acento azul NECS, precios/specs en monoespaciada, reveal escalonado, glow azul
   en "elegido". TODO scopeado bajo .theme-necs. Usa tokens --necs-*.

   Mapa:
     0. Tokens locales (mono, ritmo)        1. Header compacto sticky
     2. Tira IA "Déjate guiar"              3. Tira de presets scrolleable
     4. Lista de slots (cards táctiles)     5. Botones / chips / stepper
     6. Picker drawer + grid de productos   7. Modal de datos del cliente
     8. Barra inferior (dock móvil)         9. Toast    10. Skeleton
     11. Reveal escalonado                  12. Reduced motion
   ========================================================================== */

/* ── 0 · Tokens locales ─────────────────────────────────────────────────── */
.theme-necs .pcb {
  --pcb-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --pcb-gap: 12px;          /* ritmo vertical APRETADO */
  --pcb-glow: 0 0 0 3px color-mix(in srgb, var(--necs-brand) 22%, transparent);
  --pcb-tap: 48px;          /* alto mínimo táctil */
}

.theme-necs .pcb { color: var(--necs-ink); }
.theme-necs .pcb .container { max-width: 980px; }

.theme-necs .pcb-stage {
  display: flex; flex-direction: column;
  gap: var(--pcb-gap);
  padding-top: 16px;
  padding-bottom: 84px; /* deja aire para el dock móvil */
}
@media (min-width: 781px) {
  .theme-necs .pcb-stage { padding-bottom: 40px; }
}

/* mono helper */
.theme-necs .pcb-price,
.theme-necs .pcb-bar-total,
.theme-necs .pcb-dock-total,
.theme-necs .pcb-prod-price,
.theme-necs .pcb-chosen-line,
.theme-necs .pcb-modal-summary strong,
.theme-necs .pcb-qty-val {
  font-family: var(--pcb-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ── 1 · Header compacto sticky ─────────────────────────────────────────── */
.theme-necs .pcb-bar {
  position: sticky !important; top: 0 !important; z-index: 60;
  background: color-mix(in srgb, var(--necs-surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--necs-line);
}
.theme-necs .pcb-bar-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding-top: 12px; padding-bottom: 12px;
}
.theme-necs .pcb-bar-lead { min-width: 0; }
.theme-necs .pcb-kicker {
  display: inline-block;
  font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--necs-brand);
}
.theme-necs .pcb-bar-title {
  font-family: var(--necs-font-display, inherit);
  font-weight: 800; line-height: 1.05;
  font-size: clamp(1.25rem, .9rem + 1.6vw, 1.75rem);
  margin: 1px 0 0; color: var(--necs-ink);
}
.theme-necs .pcb-bar-sub {
  margin: 4px 0 0; color: var(--necs-ink-2);
  font-size: .88rem; line-height: 1.4;
  max-width: 56ch;
}
@media (max-width: 620px) { .theme-necs .pcb-bar-sub { display: none; } }

.theme-necs .pcb-bar-meta { display: flex; align-items: center; gap: 14px; flex: none; }
.theme-necs .pcb-bar-totals { text-align: right; line-height: 1.1; }
.theme-necs .pcb-bar-count { display: block; font-size: .72rem; color: var(--necs-ink-2); font-weight: 600; }
.theme-necs .pcb-bar-count b { color: var(--necs-ink); font-weight: 800; }
.theme-necs .pcb-bar-total {
  display: block; font-size: 1.35rem; font-weight: 800; color: var(--necs-brand);
}
@media (max-width: 520px) {
  .theme-necs .pcb-bar-totals { display: none; }      /* el total vive en el dock */
}

/* CTA principal (también es el submit del modal y el dock) */
.theme-necs .pcb-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--pcb-tap);
  padding: 0 20px;
  border: none; border-radius: 999px;
  background: var(--necs-brand); color: #fff;
  font-family: var(--necs-font-body, inherit);
  font-weight: 800; font-size: .95rem; letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--necs-brand) 60%, transparent);
  transition: transform .14s ease, box-shadow .18s ease, background-color .15s ease, opacity .15s ease;
}
.theme-necs .pcb-cta svg { width: 18px; height: 18px; }
.theme-necs .pcb-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--necs-brand) 66%, transparent); }
.theme-necs .pcb-cta:active { transform: translateY(0); }
.theme-necs .pcb-cta:disabled { cursor: progress; opacity: .85; }
@media (max-width: 520px) {
  .theme-necs .pcb-bar .pcb-cta span:not(.pcb-ai-go-load) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .theme-necs .pcb-bar .pcb-cta { padding: 0; width: var(--pcb-tap); }
  .theme-necs .pcb-bar .pcb-cta::after { content: "→"; font-size: 1.2rem; }
}

/* ── 2 · Tira IA "Déjate guiar" ─────────────────────────────────────────── */
/* Arriba en 2 columnas: IA (izquierda, resumida) · presets (derecha). */
.theme-necs .pcb-top2 {
  display: grid;
  grid-template-columns: minmax(290px, 380px) 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
@media (max-width: 900px) { .theme-necs .pcb-top2 { grid-template-columns: 1fr; } }
/* Desktop ancho: card IA y columna de presets a la MISMA altura (fondos al ras).
   La card IA es la más alta; estiramos la columna de presets y dejamos que el rail
   crezca — sus filas (grid-auto-rows:1fr) reparten el alto y terminan al ras con la IA.
   Solo ≥1081px: entre 901–1080px los presets pasan a 1 columna (6 apilados) y serían
   más altos que la IA, así que ahí NO estiramos (la IA quedaría con hueco). */
@media (min-width: 1081px) {
  .theme-necs .pcb-top2 { align-items: stretch; }
  .theme-necs .pcb-presets-rail { flex-grow: 1; }
}

.theme-necs .pcb-ai {
  position: relative; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--necs-brand) 24%, var(--necs-line));
  border-radius: var(--necs-r-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--necs-brand) 9%, transparent) 0%, transparent 55%),
    var(--necs-surface);
  box-shadow: var(--necs-sh-1);
  padding: clamp(14px, 2.4vw, 20px);
}
.theme-necs .pcb-ai-head { display: flex; align-items: center; gap: 12px; }
.theme-necs .pcb-ai-spark {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; background: var(--necs-brand);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--necs-brand) 70%, transparent);
}
.theme-necs .pcb-ai-spark svg { width: 20px; height: 20px; }
.theme-necs .pcb-ai-title { font-family: var(--necs-font-display, inherit); font-size: 1.05rem; font-weight: 800; margin: 0; line-height: 1.1; }
.theme-necs .pcb-ai-sub { margin: 2px 0 0; color: var(--necs-ink-2); font-size: .85rem; line-height: 1.35; }

.theme-necs .pcb-ai-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
}
.theme-necs .pcb-ai-go { width: 100%; }

.theme-necs .pcb-ai-label {
  display: block;
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--necs-ink-2);
  margin-bottom: 8px;
}

.theme-necs .pcb-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.theme-necs .pcb-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--necs-line);
  border-radius: 999px;
  background: var(--necs-surface);
  color: var(--necs-ink);
  font-weight: 700; font-size: .85rem;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease, transform .1s ease;
}
.theme-necs .pcb-chip:hover { border-color: color-mix(in srgb, var(--necs-brand) 55%, var(--necs-line)); }
.theme-necs .pcb-chip:active { transform: scale(.97); }
.theme-necs .pcb-chip.is-active {
  border-color: var(--necs-brand);
  background: var(--necs-brand); color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--necs-brand) 60%, transparent);
}

.theme-necs .pcb-ai-budget { display: flex; flex-direction: column; gap: 8px; }
.theme-necs .pcb-budget-input {
  display: flex; align-items: center;
  border: 1.5px solid var(--necs-line);
  border-radius: var(--necs-r-sm);
  background: var(--necs-surface-2, #f4f4f5);
  overflow: hidden;
  transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.theme-necs .pcb-budget-input:focus-within {
  border-color: var(--necs-brand); background: var(--necs-surface);
  box-shadow: var(--pcb-glow);
}
.theme-necs .pcb-budget-cur {
  padding: 0 4px 0 13px;
  font-family: var(--pcb-mono); font-weight: 700; color: var(--necs-ink-2);
}
.theme-necs .pcb-budget-input input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: var(--pcb-mono); font-size: 1.05rem; font-weight: 700; color: var(--necs-ink);
  padding: 10px 13px 10px 4px;
}
.theme-necs .pcb-budget-input input::-webkit-outer-spin-button,
.theme-necs .pcb-budget-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.theme-necs .pcb-budget-input input[type=number] { -moz-appearance: textfield; }

.theme-necs .pcb-budget-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-necs .pcb-budget-chip {
  min-height: 32px; padding: 0 11px;
  border: 1.5px solid var(--necs-line); border-radius: 999px;
  background: var(--necs-surface); color: var(--necs-ink-2);
  font-family: var(--pcb-mono); font-weight: 700; font-size: .8rem;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background-color .14s ease;
}
.theme-necs .pcb-budget-chip:hover { border-color: color-mix(in srgb, var(--necs-brand) 50%, var(--necs-line)); color: var(--necs-ink); }
.theme-necs .pcb-budget-chip.is-active { border-color: var(--necs-brand); color: var(--necs-brand); background: color-mix(in srgb, var(--necs-brand) 8%, transparent); }

.theme-necs .pcb-ai-go {
  position: relative;
  min-height: var(--pcb-tap);
  padding: 0 22px;
  border: none; border-radius: 999px;
  background: var(--necs-ink); color: #fff;
  font-weight: 800; font-size: .92rem; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .14s ease, box-shadow .18s ease, opacity .15s ease;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--necs-ink) 70%, transparent);
}
@media (max-width: 760px) { .theme-necs .pcb-ai-go { width: 100%; } }
.theme-necs .pcb-ai-go:hover { transform: translateY(-1px); }
.theme-necs .pcb-ai-go.is-loading { pointer-events: none; opacity: .9; }
.theme-necs .pcb-ai-go-load {
  display: none;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%;
  animation: pcb-spin .7s linear infinite;
}
.theme-necs .pcb-ai-go.is-loading .pcb-ai-go-txt { opacity: .55; }
.theme-necs .pcb-ai-go.is-loading .pcb-ai-go-load { display: inline-block; }

/* ── 3 · Tira de presets scrolleable ────────────────────────────────────── */
.theme-necs .pcb-presets { display: flex; flex-direction: column; gap: 9px; }
.theme-necs .pcb-presets-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.theme-necs .pcb-eyebrow {
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--necs-ink-2);
}
.theme-necs .pcb-presets-hint { font-size: .78rem; color: var(--necs-ink-2); }

.theme-necs .pcb-presets-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;           /* TODAS las filas exactamente igual de altas */
  align-content: start;
  gap: 10px;
  padding: 2px;
}
@media (max-width: 1080px) and (min-width: 901px) { .theme-necs .pcb-presets-rail { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .theme-necs .pcb-presets-rail { grid-template-columns: 1fr; } }

.theme-necs .pcb-preset {
  width: auto;
  align-self: stretch;           /* la card llena la fila → misma altura exacta */
  height: 100%;
  display: flex; align-items: center; gap: 13px;
  padding: 12px 13px;
  border: 1.5px solid var(--necs-line); border-radius: var(--necs-r-lg, 16px);
  background: var(--necs-surface); color: var(--necs-ink);
  text-decoration: none;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.theme-necs .pcb-preset:hover { border-color: var(--necs-brand); box-shadow: var(--necs-sh-1); transform: translateY(-2px); }
.theme-necs .pcb-preset:hover .pcb-preset-thumb img { transform: scale(1.06); }
.theme-necs .pcb-preset.is-active {
  border-color: var(--necs-brand);
  box-shadow: var(--pcb-glow);
}
.theme-necs .pcb-preset-thumb {
  width: 64px; height: 64px; flex: none;
  border-radius: 13px; overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 15%, color-mix(in srgb, var(--necs-brand) 12%, #fff) 0%, var(--necs-surface-2, #f1f2f6) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--necs-ink) 7%, transparent);
  display: grid; place-items: center; color: var(--necs-ink-2);
}
.theme-necs .pcb-preset-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.theme-necs .pcb-preset-thumb svg { width: 30px; height: 30px; }
.theme-necs .pcb-preset-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.theme-necs .pcb-preset-name {
  font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--necs-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-necs .pcb-preset-badge {
  align-self: flex-start;
  font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--necs-brand);
  background: color-mix(in srgb, var(--necs-brand) 11%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.theme-necs .pcb-preset-on {
  position: absolute; top: -7px; right: 9px;
  font-size: .6rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--necs-brand);
  border-radius: 999px; padding: 2px 8px;
}

/* ── 4 · Lista de slots ─────────────────────────────────────────────────── */
.theme-necs .pcb-build-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 2px; }
.theme-necs .pcb-build-title {
  font-family: var(--necs-font-display, inherit);
  font-size: 1.1rem; font-weight: 800; margin: 0;
}
.theme-necs .pcb-reset {
  border: none; background: none; cursor: pointer;
  color: var(--necs-ink-2); font-weight: 700; font-size: .82rem;
  padding: 6px 8px; border-radius: var(--necs-r-sm);
  transition: color .15s ease, background-color .15s ease;
}
.theme-necs .pcb-reset:hover { color: var(--necs-hot); background: color-mix(in srgb, var(--necs-hot) 8%, transparent); }

.theme-necs .pcb-warn {
  color: var(--necs-hot);
  background: color-mix(in srgb, var(--necs-hot) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--necs-hot) 26%, transparent);
  border-radius: var(--necs-r-sm);
  font-size: .85rem; font-weight: 600;
  padding: 10px 13px; margin: 4px 0 0;
}

/* Slots en DOS columnas (masonry) para no ocupar tanto alto. 1 col en móvil. */
.theme-necs .pcb-slots { column-count: 2; column-gap: var(--pcb-gap); margin-top: 8px; }
.theme-necs .pcb-slots > * { break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 var(--pcb-gap); }
@media (max-width: 820px) { .theme-necs .pcb-slots { column-count: 1; } }

.theme-necs .pcb-slot {
  background: var(--necs-surface);
  border: 1px solid var(--necs-line);
  border-radius: var(--necs-r);
  box-shadow: var(--necs-sh-1);
  padding: 11px clamp(12px, 2vw, 16px);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.theme-necs .pcb-slot.is-chosen {
  border-color: color-mix(in srgb, var(--necs-brand) 45%, var(--necs-line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--necs-brand) 28%, transparent), var(--necs-sh-1);
}
.theme-necs .pcb-slot.is-error {
  border-color: var(--necs-hot);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--necs-hot) 14%, transparent);
}

.theme-necs .pcb-slot-head { display: flex; gap: 12px; align-items: flex-start; }
.theme-necs .pcb-slot-ico {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--necs-brand) 11%, transparent);
  color: var(--necs-brand);
  display: grid; place-items: center;
  transition: background-color .18s ease, color .18s ease;
}
.theme-necs .pcb-slot.is-chosen .pcb-slot-ico { background: var(--necs-brand); color: #fff; }
.theme-necs .pcb-slot-ico svg { width: 21px; height: 21px; }

.theme-necs .pcb-slot-meta { min-width: 0; flex: 1; }
.theme-necs .pcb-slot-namerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.theme-necs .pcb-slot-name {
  font-family: var(--necs-font-display, inherit);
  font-weight: 800; font-size: 1.3rem; color: var(--necs-ink); line-height: 1.15; letter-spacing: -.01em;
}
.theme-necs .pcb-badge {
  font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--necs-hot);
  background: color-mix(in srgb, var(--necs-hot) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--necs-hot) 28%, transparent);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.theme-necs .pcb-badge.is-opt {
  color: var(--necs-ink-2);
  background: var(--necs-surface-2, #f4f4f5);
  border-color: var(--necs-line);
}
.theme-necs .pcb-slot-help { color: var(--necs-ink-2); font-size: .82rem; margin: 3px 0 0; line-height: 1.4; }

.theme-necs .pcb-slot-body { margin-top: 7px; }

/* Producto elegido (fila grande) */
.theme-necs .pcb-chosen {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 13px; align-items: center;
}
@media (max-width: 560px) {
  .theme-necs .pcb-chosen { grid-template-columns: 56px 1fr; }
  .theme-necs .pcb-chosen-actions { grid-column: 1 / -1; justify-content: space-between; }
}
.theme-necs .pcb-thumb {
  width: 56px; height: 56px; flex: none;
  border: 1px solid var(--necs-line); border-radius: 10px; overflow: hidden;
  background: var(--necs-surface-2, #f4f4f5);
  display: grid; place-items: center;
}
.theme-necs .pcb-thumb-lg { width: 64px; height: 64px; }
.theme-necs .pcb-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.theme-necs .pcb-chosen-info { min-width: 0; }
.theme-necs .pcb-chosen-name {
  margin: 0; font-weight: 600; color: var(--necs-ink); font-size: .92rem; line-height: 1.3;
  overflow-wrap: anywhere; /* nombre COMPLETO: nunca se corta */
}
.theme-necs .pcb-chosen-pricerow { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; }
.theme-necs .pcb-price { font-weight: 800; color: var(--necs-brand); font-size: 1rem; }
.theme-necs .pcb-chosen-line { color: var(--necs-ink-2); font-size: .82rem; font-weight: 700; }

.theme-necs .pcb-chosen-actions { display: flex; align-items: center; gap: 10px; }
.theme-necs .pcb-chosen-btns { display: flex; align-items: center; gap: 4px; }

/* Recomendado inline */
.theme-necs .pcb-rec {
  border: 1px dashed color-mix(in srgb, var(--necs-brand) 32%, var(--necs-line));
  border-radius: var(--necs-r-sm);
  background: color-mix(in srgb, var(--necs-brand) 4%, var(--necs-surface));
  padding: 11px 12px;
}
.theme-necs .pcb-rec-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--necs-brand);
  margin-bottom: 8px;
}
.theme-necs .pcb-rec-tag svg { width: 14px; height: 14px; }
.theme-necs .pcb-rec-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.theme-necs .pcb-rec-info { min-width: 0; }
.theme-necs .pcb-rec-name {
  margin: 0 0 2px; font-weight: 600; color: var(--necs-ink); font-size: .9rem; line-height: 1.3;
  overflow-wrap: anywhere; /* nombre COMPLETO: nunca se corta */
}
.theme-necs .pcb-rec-btns { display: flex; gap: 8px; margin-top: 11px; }
@media (max-width: 440px) { .theme-necs .pcb-rec-btns { flex-direction: column; } }

/* Sin recomendado */
.theme-necs .pcb-empty {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1.5px dashed var(--necs-line); border-radius: var(--necs-r-sm);
  padding: 8px 13px;
}
.theme-necs .pcb-empty-txt { color: var(--necs-ink-2); font-weight: 700; font-size: .9rem; }

/* placeholder de imagen */
.theme-necs .pcb-img-empty {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, var(--necs-line) 0, var(--necs-line) 1px, transparent 1px, transparent 9px);
  opacity: .5;
}

.theme-necs .pcb-slot-error { color: var(--necs-hot); font-size: .82rem; font-weight: 700; margin: 10px 0 0; }

/* ── 5 · Botones / stepper ──────────────────────────────────────────────── */
.theme-necs .pcb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border-radius: 999px;
  font-weight: 800; font-size: .86rem; cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s ease, border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.theme-necs .pcb-btn svg { width: 16px; height: 16px; }
.theme-necs .pcb-btn:active { transform: scale(.97); }
.theme-necs .pcb-btn-brand {
  background: var(--necs-brand); color: #fff;
  box-shadow: 0 5px 14px -6px color-mix(in srgb, var(--necs-brand) 60%, transparent);
}
.theme-necs .pcb-btn-brand:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--necs-brand) 66%, transparent); }
.theme-necs .pcb-btn-ghost {
  background: var(--necs-surface); color: var(--necs-ink);
  border-color: var(--necs-line);
}
.theme-necs .pcb-btn-ghost:hover { border-color: var(--necs-brand); color: var(--necs-brand); }

.theme-necs .pcb-btn-remove {
  width: 40px; height: 40px; flex: none;
  border: 1.5px solid color-mix(in srgb, #dc2626 38%, var(--necs-line)); border-radius: 50%;
  background: color-mix(in srgb, #dc2626 7%, var(--necs-surface)); color: #dc2626;
  cursor: pointer; display: grid; place-items: center;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.theme-necs .pcb-btn-remove svg { width: 18px; height: 18px; }
.theme-necs .pcb-btn-remove:hover { color: #fff; border-color: #dc2626; background: #dc2626; }

.theme-necs .pcb-qty {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--necs-line); border-radius: 999px; overflow: hidden;
  background: var(--necs-surface);
}
.theme-necs .pcb-qty-btn {
  width: 38px; height: 38px; border: none; background: none;
  color: var(--necs-ink); font-size: 1.2rem; font-weight: 700; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  transition: background-color .14s ease, color .14s ease;
}
.theme-necs .pcb-qty-btn:hover:not(:disabled) { background: var(--necs-brand); color: #fff; }
.theme-necs .pcb-qty-btn:disabled { color: var(--necs-ink-2); opacity: .4; cursor: default; }
.theme-necs .pcb-qty-val { min-width: 34px; text-align: center; font-weight: 800; color: var(--necs-ink); }

/* ── 6 · Picker drawer + grid ───────────────────────────────────────────── */
.theme-necs .pcb-overlay { position: fixed; inset: 0; z-index: 1200; display: flex; }
.theme-necs .pcb-overlay-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--necs-ink) 55%, transparent);
  opacity: 0; transition: opacity .25s ease; cursor: pointer;
}
.theme-necs .pcb-overlay.is-open .pcb-overlay-backdrop { opacity: 1; }
body.pcb-no-scroll { overflow: hidden; }

.theme-necs .pcb-icon-btn {
  width: 38px; height: 38px; flex: none;
  border: 1px solid var(--necs-line); border-radius: 50%;
  background: var(--necs-surface); color: var(--necs-ink); cursor: pointer;
  display: grid; place-items: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.theme-necs .pcb-icon-btn svg { width: 18px; height: 18px; }
.theme-necs .pcb-icon-btn:hover { background: var(--necs-ink); border-color: var(--necs-ink); color: #fff; }

.theme-necs .pcb-drawer {
  position: relative; margin-left: auto;
  width: min(560px, 100%); height: 100%;
  background: var(--necs-surface);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22,.61,.36,1);
}
.theme-necs .pcb-overlay.is-open .pcb-drawer { transform: translateX(0); }

.theme-necs .pcb-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--necs-line);
}
.theme-necs .pcb-drawer-eyebrow { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--necs-brand); }
.theme-necs .pcb-drawer-title { font-family: var(--necs-font-display, inherit); font-size: 1.15rem; font-weight: 800; color: var(--necs-ink); margin: 1px 0 0; }

.theme-necs .pcb-drawer-search { position: relative; padding: 13px 20px; border-bottom: 1px solid var(--necs-line); }
.theme-necs .pcb-drawer-search svg {
  position: absolute; left: 33px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--necs-ink-2); pointer-events: none;
}
.theme-necs .pcb-drawer-search input {
  width: 100%;
  font-family: var(--necs-font-body, inherit); font-size: 1rem; color: var(--necs-ink);
  background: var(--necs-surface-2, #f4f4f5);
  border: 1.5px solid var(--necs-line); border-radius: var(--necs-r-sm);
  padding: 11px 14px 11px 40px; outline: none;
  transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.theme-necs .pcb-drawer-search input:focus { border-color: var(--necs-brand); background: var(--necs-surface); box-shadow: var(--pcb-glow); }

.theme-necs .pcb-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.theme-necs .pcb-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
@media (max-width: 480px) { .theme-necs .pcb-picker-grid { grid-template-columns: 1fr; } }

.theme-necs .pcb-prod {
  position: relative; text-align: left;
  background: var(--necs-surface);
  border: 1.5px solid var(--necs-line); border-radius: var(--necs-r-sm);
  padding: 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color .14s ease, box-shadow .14s ease, transform .12s ease;
}
.theme-necs .pcb-prod:hover { border-color: var(--necs-brand); box-shadow: var(--necs-sh-1); transform: translateY(-1px); }
.theme-necs .pcb-prod:focus-visible { outline: 3px solid color-mix(in srgb, var(--necs-brand) 35%, transparent); outline-offset: 1px; }
.theme-necs .pcb-prod.is-current { border-color: var(--necs-brand); box-shadow: var(--pcb-glow); }
.theme-necs .pcb-prod-thumb {
  aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden;
  background: var(--necs-surface-2, #f4f4f5);
  display: grid; place-items: center;
}
.theme-necs .pcb-prod-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.theme-necs .pcb-prod-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.theme-necs .pcb-prod-name {
  margin: 0; font-weight: 600; font-size: .88rem; line-height: 1.3; color: var(--necs-ink);
  overflow-wrap: anywhere; /* nombre COMPLETO en el picker: nunca se corta */
}
.theme-necs .pcb-prod-sku { margin: 0; font-family: var(--pcb-mono); font-size: .72rem; color: var(--necs-ink-2); overflow-wrap: anywhere; }
.theme-necs .pcb-prod-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 5px; }
.theme-necs .pcb-prod-price { font-weight: 800; color: var(--necs-brand); font-size: .96rem; }
.theme-necs .pcb-prod-stock { font-size: .72rem; color: var(--necs-ink-2); white-space: nowrap; }
.theme-necs .pcb-prod-stock.is-out { color: var(--necs-hot); font-weight: 700; }
.theme-necs .pcb-prod-pick {
  position: absolute; top: 9px; right: 9px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--necs-brand); color: #fff;
  display: none; place-items: center;
}
.theme-necs .pcb-prod-pick svg { width: 14px; height: 14px; }
.theme-necs .pcb-prod.is-current .pcb-prod-pick { display: grid; }

/* Sin stock: visible en PLOMO, no seleccionable (no hover, no click). */
.theme-necs .pcb-prod.is-out {
  cursor: not-allowed;
  opacity: .6;
  background: var(--necs-surface-2, #f4f4f5);
  border-color: var(--necs-line);
}
.theme-necs .pcb-prod.is-out:hover { border-color: var(--necs-line); box-shadow: none; transform: none; }
.theme-necs .pcb-prod.is-out .pcb-prod-thumb img { filter: grayscale(1); }
.theme-necs .pcb-prod.is-out .pcb-prod-name,
.theme-necs .pcb-prod.is-out .pcb-prod-price { color: var(--necs-ink-2); }
.theme-necs .pcb-prod.is-out::after {
  content: "Sin stock";
  position: absolute; top: 9px; right: 9px;
  font-size: .62rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  color: #fff; background: var(--necs-ink-2);
  border-radius: 999px; padding: 2px 8px;
}

.theme-necs .pcb-picker-state { padding: 40px 16px; text-align: center; color: var(--necs-ink-2); font-size: .92rem; line-height: 1.5; }
.theme-necs .pcb-picker-state.is-loading::before {
  content: ''; display: block; width: 30px; height: 30px; margin: 0 auto 14px;
  border-radius: 50%; border: 3px solid var(--necs-line); border-top-color: var(--necs-brand);
  animation: pcb-spin .7s linear infinite;
}
.theme-necs .pcb-picker-state.is-error { color: var(--necs-hot); font-weight: 700; }

@keyframes pcb-spin { to { transform: rotate(360deg); } }

/* ── 7 · Modal de datos del cliente ─────────────────────────────────────── */
.theme-necs #pcb-form { align-items: center; justify-content: center; padding: 20px; }
.theme-necs .pcb-modal {
  position: relative; width: min(460px, 100%);
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--necs-surface); border-radius: var(--necs-r-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: clamp(20px, 3vw, 28px);
  transform: translateY(14px) scale(.985); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.theme-necs #pcb-form.is-open .pcb-modal { transform: none; opacity: 1; }

.theme-necs .pcb-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.theme-necs .pcb-modal-title { font-family: var(--necs-font-display, inherit); font-size: 1.3rem; font-weight: 800; color: var(--necs-ink); margin: 0; }

.theme-necs .pcb-modal-summary {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 14px 0; padding: 12px 14px;
  border-radius: var(--necs-r-sm);
  background: color-mix(in srgb, var(--necs-brand) 7%, var(--necs-surface-2, #f4f4f5));
  border: 1px solid color-mix(in srgb, var(--necs-brand) 18%, var(--necs-line));
}
.theme-necs .pcb-modal-summary span { font-size: .85rem; color: var(--necs-ink-2); font-weight: 600; }
.theme-necs .pcb-modal-summary span b { color: var(--necs-ink); font-weight: 800; }
.theme-necs .pcb-modal-summary strong { font-size: 1.25rem; font-weight: 800; color: var(--necs-brand); }

.theme-necs .pcb-modal-sub { color: var(--necs-ink-2); font-size: .88rem; line-height: 1.45; margin: 0 0 16px; }

.theme-necs .pcb-field { margin-bottom: 14px; }
.theme-necs .pcb-field > label { display: block; font-family: var(--necs-font-body, inherit); font-weight: 700; font-size: .88rem; color: var(--necs-ink); margin-bottom: 6px; }
.theme-necs .pcb-field > label .req { color: var(--necs-hot); margin-left: 2px; }
.theme-necs .pcb-field > label .opt { color: var(--necs-ink-2); font-weight: 500; margin-left: 4px; }
.theme-necs .pcb-field input,
.theme-necs .pcb-field textarea {
  width: 100%; font-family: var(--necs-font-body, inherit); font-size: 1rem; color: var(--necs-ink);
  background: var(--necs-surface-2, #f4f4f5);
  border: 1.5px solid var(--necs-line); border-radius: var(--necs-r-sm);
  padding: 11px 14px; outline: none;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.theme-necs .pcb-field input::placeholder,
.theme-necs .pcb-field textarea::placeholder { color: var(--necs-ink-2); }
.theme-necs .pcb-field input:focus,
.theme-necs .pcb-field textarea:focus { border-color: var(--necs-brand); background: var(--necs-surface); box-shadow: var(--pcb-glow); }
.theme-necs .pcb-field textarea { resize: vertical; min-height: 76px; }
.theme-necs .pcb-field input.is-invalid,
.theme-necs .pcb-field textarea.is-invalid { border-color: var(--necs-hot); }
.theme-necs .pcb-field-error { display: block; color: var(--necs-hot); font-size: .8rem; font-weight: 600; margin-top: 5px; }

.theme-necs .pcb-form-error {
  color: var(--necs-hot);
  background: color-mix(in srgb, var(--necs-hot) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--necs-hot) 26%, transparent);
  border-radius: var(--necs-r-sm); font-size: .85rem; font-weight: 600;
  padding: 10px 12px; margin: 4px 0 12px;
}

.theme-necs .pcb-form-submit { width: 100%; position: relative; }
.theme-necs .pcb-form-submit .pcb-ai-go-load { display: none; }
.theme-necs .pcb-form-submit.is-loading .pcb-form-submit-txt { opacity: .55; }
.theme-necs .pcb-form-submit.is-loading .pcb-ai-go-load { display: inline-block; }
.theme-necs .pcb-modal-note { color: var(--necs-ink-2); font-size: .78rem; line-height: 1.4; text-align: center; margin: 12px 0 0; }

/* ── 8 · Dock móvil ─────────────────────────────────────────────────────── */
.theme-necs .pcb-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: color-mix(in srgb, var(--necs-surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--necs-line);
  box-shadow: 0 -8px 24px -12px rgba(0,0,0,.25);
  transform: translateY(110%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
}
.theme-necs .pcb-dock.is-on { transform: translateY(0); }
.theme-necs .pcb-dock-in {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px clamp(14px, 4vw, 22px) calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: 980px; margin: 0 auto;
}
.theme-necs .pcb-dock-totals { line-height: 1.05; }
.theme-necs .pcb-dock-count { display: block; font-size: .7rem; color: var(--necs-ink-2); font-weight: 600; }
.theme-necs .pcb-dock-count b { color: var(--necs-ink); font-weight: 800; }
.theme-necs .pcb-dock-total { display: block; font-size: 1.3rem; font-weight: 800; color: var(--necs-brand); }
.theme-necs .pcb-dock-cta { flex: 1; max-width: 280px; }
/* En desktop el dock no aplica (el header lleva el CTA). */
@media (min-width: 781px) { .theme-necs .pcb-dock { display: none; } }

/* ── 9 · Toast ──────────────────────────────────────────────────────────── */
.theme-necs .pcb-toast,
body .pcb-toast {
  position: fixed; left: 50%; bottom: 86px; z-index: 1400;
  transform: translate(-50%, 16px); opacity: 0;
  display: flex; align-items: center; gap: 11px;
  max-width: min(540px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: var(--necs-r); border: 1px solid var(--necs-line);
  background: var(--necs-surface, #fff);
  box-shadow: 0 18px 44px -16px rgba(0,0,0,.4);
  color: var(--necs-ink, #16181d);
  font-size: .9rem; line-height: 1.4; font-weight: 600;
  transition: transform .3s cubic-bezier(.22,.61,.36,1), opacity .3s ease;
  cursor: pointer;
}
@media (min-width: 781px) { .theme-necs .pcb-toast, body .pcb-toast { bottom: 28px; } }
.theme-necs .pcb-toast.is-show,
body .pcb-toast.is-show { transform: translate(-50%, 0); opacity: 1; }
.theme-necs .pcb-toast-ico { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; line-height: 1; }
.theme-necs .pcb-toast.is-ok { border-color: color-mix(in srgb, #16a34a 40%, var(--necs-line)); }
.theme-necs .pcb-toast.is-ok .pcb-toast-ico { background: #16a34a; color: #fff; }
.theme-necs .pcb-toast.is-ok .pcb-toast-ico::after { content: '✓'; font-weight: 900; }
.theme-necs .pcb-toast.is-warn { border-color: color-mix(in srgb, #f59e0b 50%, var(--necs-line)); }
.theme-necs .pcb-toast.is-warn .pcb-toast-ico { background: #f59e0b; color: #fff; }
.theme-necs .pcb-toast.is-warn .pcb-toast-ico::after { content: '!'; font-weight: 900; }

/* ── 10 · Skeleton ──────────────────────────────────────────────────────── */
.theme-necs .pcb-slots-skeleton { display: flex; flex-direction: column; gap: var(--pcb-gap); }
.theme-necs .pcb-skel-card {
  height: 104px; border-radius: var(--necs-r); border: 1px solid var(--necs-line);
  background: linear-gradient(100deg, var(--necs-surface) 30%, var(--necs-surface-2, #ececec) 50%, var(--necs-surface) 70%);
  background-size: 200% 100%; animation: pcb-shimmer 1.3s ease-in-out infinite;
}
@keyframes pcb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── 11 · Reveal escalonado ─────────────────────────────────────────────── */
.theme-necs .pcb-reveal {
  opacity: 0; transform: translateY(10px);
  animation: pcb-rise .42s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: calc(var(--pcb-i, 0) * 48ms);
}
@keyframes pcb-rise { to { opacity: 1; transform: none; } }

/* ── 12 · Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .theme-necs .pcb-overlay-backdrop,
  .theme-necs .pcb-drawer,
  .theme-necs .pcb-modal,
  .theme-necs .pcb-prod,
  .theme-necs .pcb-dock,
  .theme-necs .pcb-toast,
  body .pcb-toast,
  .theme-necs .pcb-cta,
  .theme-necs .pcb-btn,
  .theme-necs .pcb-slot { transition: none !important; }
  .theme-necs .pcb-reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
  .theme-necs .pcb-skel-card,
  .theme-necs .pcb-ai-go-load,
  .theme-necs .pcb-picker-state.is-loading::before { animation: none !important; }
}
