/* ==========================================================================
   COMPONENTES — cada bloque está documentado en COMPONENTES.md
   ========================================================================== */

/* ---------- Icono (símbolos de esquemático) ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 28px; height: 28px; }
.ico--fill { fill: currentColor; stroke: none; }

/* ==========================================================================
   CTAButton — clic de interruptor + estado de carga tipo barra de progreso
   ========================================================================== */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1);
  min-height: 44px; padding: 0 var(--sp-2);
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em;
  font-variation-settings: "wdth" 104;
  color: var(--btn-fg); background: var(--btn-bg);
  border: var(--bw) solid var(--btn-bd); border-radius: var(--r-1);
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 0 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out),
              background-color var(--dur-2), border-color var(--dur-2), color var(--dur-2);
}
.btn:hover { border-color: var(--interactive); }
.btn:active, .btn[aria-pressed="true"].btn--toggle {
  transform: translateY(2px);
  box-shadow: 0 0 0 0 rgba(0,0,0,.35), inset 0 2px 4px rgba(0,0,0,.25);
}
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-contrast); --btn-bd: transparent; }
.btn--primary:hover { --btn-bg: var(--accent-strong); border-color: transparent; }
.btn--copper { --btn-bg: var(--c-copper); --btn-fg: var(--c-graphite-900); --btn-bd: transparent; }
[data-theme="light"] .btn--copper { --btn-bg: var(--c-copper-ink); --btn-fg: #fff; }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; }
.btn--ghost:hover { --btn-bg: var(--surface-2); border-color: var(--line); }
.btn--outline { --btn-bg: transparent; }
.btn--sm { min-height: 36px; padding: 0 var(--sp-15); font-size: var(--fs-xs); }
.btn--lg { min-height: 52px; padding: 0 var(--sp-3); font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .btn-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: currentColor; opacity: .85; transform: scaleX(0); transform-origin: left;
}
.btn[data-state="loading"] { pointer-events: none; }
.btn[data-state="loading"] .btn-progress { animation: btn-load 380ms var(--ease-out) forwards; }
.btn[data-state="done"] { --btn-bg: var(--ok); --btn-fg: var(--c-graphite-900); --btn-bd: transparent; }
[data-theme="light"] .btn[data-state="done"] { --btn-fg: #fff; }
@keyframes btn-load { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .btn[data-state="loading"] .btn-progress { animation: none; transform: scaleX(1); } }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--r-1); color: var(--text);
  border: 1px solid transparent; transition: background-color var(--dur-1), border-color var(--dur-1);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.icon-btn .count {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  font: 600 10px/1 var(--font-mono); color: var(--c-graphite-900); background: var(--trace);
  box-shadow: 0 0 0 2px var(--bg);
}
.icon-btn .count[data-zero] { display: none; }
.icon-btn .count.is-bump { animation: count-bump var(--dur-3) var(--ease-snap); }
@keyframes count-bump {
  0% { transform: scale(1); box-shadow: 0 0 0 2px var(--bg); }
  40% { transform: scale(1.35); box-shadow: 0 0 0 2px var(--bg), 0 0 14px 2px var(--trace-glow); }
  100% { transform: scale(1); }
}

/* ---------- Chips, badges, etiquetas ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 10px; border-radius: var(--r-1);
  font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--line);
}
.chip--accent { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chip--signal { color: var(--signal-text); border-color: color-mix(in srgb, var(--signal) 45%, transparent); background: color-mix(in srgb, var(--signal) 10%, transparent); }
.chip--copper { color: var(--copper-text); border-color: var(--trace-dim); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--interactive); color: var(--text); }
.chip .x { width: 14px; height: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 3px;
  font: 700 10px/1.1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--signal); color: var(--c-graphite-900);
}
.badge--accent { background: var(--accent); color: var(--accent-contrast); }
.badge--line { background: transparent; color: var(--text-muted); border: 1px solid var(--line-strong); }

/* ---------- LED ---------- */
.led {
  --led: var(--c-graphite-500);
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--led); box-shadow: inset 0 -1px 1px rgba(0,0,0,.4);
  transition: background-color var(--dur-2), box-shadow var(--dur-2);
}
.led.is-on, .led--on { box-shadow: 0 0 0 2px color-mix(in srgb, var(--led) 25%, transparent), 0 0 10px var(--led); }
.led--ok { --led: var(--ok); }
.led--signal { --led: var(--signal); }
.led--danger { --led: var(--danger); }
.led--cyan { --led: var(--interactive); }
@media (prefers-reduced-motion: no-preference) {
  .led--pulse { animation: led-pulse 1.8s ease-in-out infinite; }
}
@keyframes led-pulse { 50% { opacity: .45; } }

/* ==========================================================================
   Topbar + Header
   ========================================================================== */
.topbar {
  font: 500 var(--fs-xs)/1.3 var(--font-mono); color: var(--text-muted);
  background: var(--bg-sunken); border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; min-height: 34px; padding-block: 6px; }
.topbar a { color: var(--text); text-decoration: none; }
.topbar a:hover { color: var(--interactive-text); }
.topbar-msg { display: flex; align-items: center; gap: var(--sp-1); }
.topbar-links { display: none; gap: var(--sp-3); }
@media (min-width: 900px) { .topbar-links { display: flex; } }

.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: grid; align-items: center; gap: var(--sp-1) var(--sp-15);
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "menu brand actions" "search search search";
  padding-block: var(--sp-1);
}
.menu-btn { grid-area: menu; }
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; object-fit: contain; }
/* Logo: versión original sobre fondo claro, versión clara sobre grafito */
.logo-on-dark { display: none; }
:root:not([data-theme="light"]) .logo-on-light { display: none; }
:root:not([data-theme="light"]) .logo-on-dark { display: block; }
.footer-logo { width: 150px; height: auto; margin-bottom: 4px; }
.brand-name { font: 800 15px/1 var(--font-display); font-variation-settings: "wdth" 118; letter-spacing: -.01em; text-transform: lowercase; }
.brand-name small { display: block; margin-top: 3px; font: 500 10px/1 var(--font-mono); letter-spacing: .28em; color: var(--copper-text); text-transform: uppercase; }
.header-actions { grid-area: actions; display: flex; align-items: center; gap: 2px; }
.header-actions .hide-sm { display: none; }
.search { grid-area: search; position: relative; }
@media (min-width: 1024px) {
  .header-row { grid-template-columns: auto minmax(320px, 1fr) auto; grid-template-areas: "brand search actions"; gap: var(--sp-3); padding-block: 12px; }
  .menu-btn { display: none; }
  .header-actions .hide-sm { display: inline-grid; }
}
@media (min-width: 600px) and (max-width: 1023px) { .header-actions .hide-sm.show-md { display: inline-grid; } }

/* Buscador protagonista */
.search-field {
  display: flex; align-items: center; gap: var(--sp-1);
  height: 48px; padding: 0 6px 0 14px; border-radius: var(--r-2);
  background: var(--surface); border: 1px solid var(--line-strong);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.search-field:focus-within { border-color: var(--interactive); box-shadow: var(--glow-cyan); }
.search-field .ico { color: var(--text-faint); }
.search-input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: var(--fs-md); color: var(--text);
}
.search-input::placeholder { color: var(--text-faint); }
.search-field kbd { display: none; }
@media (min-width: 1024px) { .search-field kbd { display: inline-grid; } }
.search-submit { height: 36px; min-height: 36px; padding: 0 14px; }
.search-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  max-height: min(70vh, 520px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-2);
  box-shadow: 0 24px 48px rgba(0,0,0,.35); padding: 6px;
}
.search-panel .sp-head { padding: 8px 10px 6px; font: 500 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); display: flex; justify-content: space-between; }
.search-opt {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-1); text-decoration: none; color: var(--text);
}
.search-opt[aria-selected="true"], .search-opt:hover { background: var(--surface-3); }
.search-opt .thumb { width: 44px; height: 34px; border-radius: 3px; overflow: hidden; background: var(--art-bg); }
.search-opt .t { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; }
.search-opt .m { font: 400 11px/1.3 var(--font-mono); color: var(--text-muted); }
.search-opt .p { font: 600 var(--fs-sm)/1 var(--font-mono); }
.search-opt mark { background: color-mix(in srgb, var(--interactive) 22%, transparent); color: inherit; border-radius: 2px; }
.search-empty { padding: 16px 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.search-hints { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 10px; }

/* Navegación principal */
.main-nav { display: none; }
@media (min-width: 1024px) {
  .main-nav { display: flex; align-items: center; gap: var(--sp-3); height: 42px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
  .main-nav a { text-decoration: none; color: var(--text-muted); position: relative; padding-block: 10px; white-space: nowrap; }
  .main-nav .nav-note { white-space: nowrap; }
  .main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); }
  .main-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--trace); }
  .main-nav .nav-spacer { flex: 1; }
  @media (max-width: 1279px) { .main-nav .nav-note.nav-note { display: none; } .main-nav { gap: var(--sp-2); } }
  .main-nav .nav-note { font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--text-faint); display: flex; gap: 8px; align-items: center; }
}

/* ==========================================================================
   Selector de modo — interruptor físico (rocker)
   ========================================================================== */
.mode-switch {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px;
  font: 600 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); border-radius: var(--r-1);
}
.mode-switch:hover { background: var(--surface-2); }
.ms-label { transition: color var(--dur-2); }
.mode-switch[aria-checked="false"] .ms-a,
.mode-switch[aria-checked="true"] .ms-b { color: var(--accent-text); }
.ms-track {
  position: relative; width: 46px; height: 24px; border-radius: 4px;
  background: linear-gradient(180deg, var(--c-graphite-950), var(--c-graphite-800));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}
.ms-track::before, .ms-track::after { /* tornillos */
  content: ""; position: absolute; top: 50%; width: 3px; height: 3px; margin-top: -1.5px; border-radius: 50%;
  background: var(--c-graphite-500);
}
.ms-track::before { left: 4px; } .ms-track::after { right: 4px; }
.ms-lever {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, #4b555c, #2a3136 60%, #20262a);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 2px 0 rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform var(--dur-2) var(--ease-snap);
}
.ms-lever::after { /* LED en la palanca */
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.mode-switch[aria-checked="true"] .ms-lever { transform: translateX(18px); }
.mode-switch .ms-label.ms-a { display: none; }
.mode-switch .ms-label.ms-b { display: none; }
@media (min-width: 480px) { .mode-switch .ms-label { display: inline !important; } }

/* ==========================================================================
   Drawer (menú móvil, carrito, filtros)
   ========================================================================== */
.drawer {
  position: fixed; inset: 0; z-index: var(--z-drawer); display: grid; pointer-events: none;
  grid-template-columns: 1fr;
}
.drawer[aria-hidden="false"] { pointer-events: auto; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(5,7,8,.6); opacity: 0; transition: opacity var(--dur-2); }
.drawer[aria-hidden="false"] .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; right: 0; width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line-strong);
  transform: translateX(100%); transition: transform var(--dur-3) var(--ease-out);
}
.drawer--left .drawer-panel { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--line-strong); transform: translateX(-100%); }
.drawer[aria-hidden="false"] .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: var(--fs-lg); }
.drawer-body { flex: 1; overflow: auto; padding: var(--sp-2) var(--sp-3); }
.drawer-foot { padding: var(--sp-2) var(--sp-3) var(--sp-3); border-top: 1px solid var(--line); background: var(--surface-2); }
.mobile-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.mobile-nav a .ico { color: var(--copper-text); }

/* ==========================================================================
   Rail lateral: bus de alimentación que se energiza con el scroll
   ========================================================================== */
.scroll-rail { display: none; }
@media (min-width: 1440px) {
  .scroll-rail {
    display: block; position: fixed; z-index: var(--z-rail); left: 22px; top: 140px; bottom: 56px; width: 14px; pointer-events: none;
  }
  .scroll-rail .rail-line, .scroll-rail .rail-fill { position: absolute; left: 6px; top: 18px; bottom: 18px; width: 2px; border-radius: 1px; }
  .scroll-rail .rail-line { background: var(--trace-dim); }
  .scroll-rail .rail-fill { background: var(--trace); box-shadow: 0 0 10px var(--trace-glow); transform-origin: top; transform: scaleY(var(--progress, 0)); }
  .scroll-rail .rail-tag { position: absolute; left: -2px; font: 600 9px/1 var(--font-mono); color: var(--copper-text); letter-spacing: .08em; }
  .scroll-rail .rail-tag--top { top: 0; } .scroll-rail .rail-tag--bot { bottom: 0; }
  @supports (animation-timeline: scroll()) {
    .scroll-rail .rail-fill { animation: rail-fill linear both; animation-timeline: scroll(root); }
  }
}
@keyframes rail-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ==========================================================================
   SectionHeader con pista de PCB que se energiza
   ========================================================================== */
.section-header { position: relative; margin-bottom: clamp(24px, 4vw, 40px); }
.section-header .sh-trace { width: 100%; height: 28px; margin-bottom: 14px; overflow: visible; }
.sh-trace .t-base { fill: none; stroke: var(--trace-dim); stroke-width: 2; }
.sh-trace .t-live { fill: none; stroke: var(--trace); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 4px var(--trace-glow)); }
.sh-trace .t-pulse { fill: none; stroke: #FFE2C4; stroke-width: 2; stroke-dasharray: .04 1; stroke-dashoffset: 1.04; opacity: 0; }
.sh-trace .via { fill: var(--bg); stroke: var(--trace); stroke-width: 2; }
.sh-trace .pad { fill: var(--trace); }
.section-header.is-live .t-live { transition: stroke-dashoffset 900ms var(--ease-out); stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .section-header.is-live .t-pulse { opacity: 1; animation: current-flow 2.6s linear 900ms infinite; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sh-trace .t-live { animation: energize linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    .section-header.is-live .t-live { transition: none; }
  }
}
@media (prefers-reduced-motion: reduce) { .sh-trace .t-live { stroke-dashoffset: 0; } }
@keyframes energize { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes current-flow { from { stroke-dashoffset: 1.04; } to { stroke-dashoffset: 0; } }
.section-header .sh-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.section-header .sh-text { max-width: 720px; }
.section-header .eyebrow { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.section-header .eyebrow .ref { color: var(--text-faint); }
.section-header h2 { margin-bottom: 10px; }
.section-header p { color: var(--text-muted); max-width: 60ch; }

/* ==========================================================================
   Ilustración de producto (panel tipo estudio de fotografía técnico)
   ========================================================================== */
.art {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background-color: var(--art-bg);
  background-image: linear-gradient(var(--art-grid) 1px, transparent 1px), linear-gradient(90deg, var(--art-grid) 1px, transparent 1px);
  background-size: 16px 16px;
}
.art svg { width: 100%; height: 100%; }
.art::after { /* marcas de esquina de plano técnico */
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) left top / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left top / 1px 10px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right bottom / 1px 10px no-repeat;
}

/* Fotos reales (normalmente con fondo blanco):
   - se apoyan sobre una "mesa de luz" color papel con la misma retícula de plano;
   - mix-blend-mode: multiply funde el blanco de la foto con la mesa (sin rectángulos blancos);
   - object-fit: contain + margen interno: todas quedan centradas y del mismo tamaño aparente. */
.art:has(> img) {
  background-color: var(--photo-bg);
  background-image: linear-gradient(var(--photo-grid) 1px, transparent 1px), linear-gradient(90deg, var(--photo-grid) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 40%, var(--photo-glow), transparent 70%);
  background-size: 16px 16px, 16px 16px, 100% 100%;
  box-shadow: inset 0 0 0 1px var(--photo-edge), inset 0 -30px 40px -30px rgba(0, 0, 0, .12);
}
.art:has(> img)::after {
  background:
    linear-gradient(var(--photo-mark), var(--photo-mark)) left top / 10px 1px no-repeat,
    linear-gradient(var(--photo-mark), var(--photo-mark)) left top / 1px 10px no-repeat,
    linear-gradient(var(--photo-mark), var(--photo-mark)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--photo-mark), var(--photo-mark)) right bottom / 1px 10px no-repeat;
}
/* La foto completa, sin recortar el producto: el blanco sobrante se funde con la mesa de luz */
.art > img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; filter: contrast(1.05) saturate(1.04); }
/* En las tarjetas, la foto va enmarcada como una placa (no a sangre) */
.product-card .pc-media .art:has(> img) { margin: 8px 8px 0; border-radius: 4px; }
.product-card:hover .art > img { transform: scale(1.03); }
.art > img { transition: transform var(--dur-3) var(--ease-out); }
.thumb.art > img, .tt-thumb.art > img, .ct-slot.art > img { object-fit: cover; }
/* Carga del catálogo: línea de cobre arriba mientras llegan los productos */
html.is-loading body::before {
  content: ""; position: fixed; z-index: 300; left: 0; top: 0; height: 2px; width: 40%;
  background: linear-gradient(90deg, transparent, var(--trace), transparent);
  animation: loading-line 1s linear infinite;
}
@keyframes loading-line { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { html.is-loading body::before { animation: none; width: 100%; opacity: .6; } }

/* ==========================================================================
   ProductCard
   ========================================================================== */
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  overflow: hidden; transition: border-color var(--dur-2), transform var(--dur-2) var(--ease-out);
}
.product-card:hover { border-color: var(--line-strong); }
.product-card:focus-within { border-color: var(--interactive); }
.product-card .pc-media { position: relative; display: block; }
.product-card .pc-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 1; }
.product-card .pc-compare {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 3px;
  font: 500 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line);
  cursor: pointer;
}
.product-card .pc-compare input { accent-color: var(--interactive); margin: 0; width: 14px; height: 14px; }
.product-card .pc-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.product-card .pc-meta { display: flex; justify-content: space-between; gap: 8px; font: 400 11px/1.2 var(--font-mono); color: var(--text-faint); }
.product-card .pc-title { font: 600 var(--fs-md)/1.3 var(--font-display); letter-spacing: -.005em; }
.product-card .pc-title a { text-decoration: none; }
.product-card .pc-title a::before { content: ""; position: absolute; inset: 0; z-index: 0; } /* toda la tarjeta clicable */
.product-card .pc-specs { display: flex; flex-wrap: wrap; gap: 4px; }
.product-card .pc-specs span { font: 500 10.5px/1 var(--font-mono); padding: 4px 6px; border-radius: 3px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--line); }
.product-card .pc-compat { font-size: var(--fs-xs); color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.product-card .pc-compat .ico { color: var(--ok); width: 14px; height: 14px; }
.product-card .pc-foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 8px; padding-top: 6px; }
.product-card .pc-foot .btn { position: relative; z-index: 1; }
.product-card .pc-compare, .product-card .btn, .product-card .pc-pro { position: relative; z-index: 2; }
.product-card .pc-compare { position: absolute; }
.product-card .pc-pro { font: 400 10.5px/1.35 var(--font-mono); color: var(--text-muted); border-top: 1px dashed var(--line); padding-top: 8px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.product-card .pc-pro b { color: var(--text); font-weight: 600; }

.price { font: 700 var(--fs-lg)/1 var(--font-mono); letter-spacing: -.02em; }
.price small { font-size: .62em; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.price-old { font: 400 var(--fs-xs)/1 var(--font-mono); color: var(--text-faint); text-decoration: line-through; }
.price-note { font: 400 10.5px/1.2 var(--font-mono); color: var(--accent-text); }

/* Lista horizontal deslizable de tarjetas */
.rail-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 280px); gap: var(--sp-2); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.rail-scroll > * { scroll-snap-align: start; }

/* ==========================================================================
   StockBadge
   ========================================================================== */
.stock { display: inline-flex; align-items: center; gap: 8px; font: 500 var(--fs-xs)/1.2 var(--font-mono); color: var(--text-muted); }
.stock--ok { color: var(--ok); }
.stock--low { color: var(--signal-text); }
.stock--out { color: var(--danger); }
.stock .stock-upd { color: var(--text-faint); font-weight: 400; }

/* ==========================================================================
   PriceTier — precios escalonados por volumen
   ========================================================================== */
.price-tier { width: 100%; font-family: var(--font-mono); font-size: var(--fs-sm); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.price-tier caption { text-align: left; padding: 0 0 8px; font: 600 10px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.price-tier th, .price-tier td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.price-tier th:first-child, .price-tier td:first-child { text-align: left; }
.price-tier thead th { font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); background: var(--surface-2); }
.price-tier tbody tr:last-child td { border-bottom: 0; }
.price-tier tr.is-active td { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); }
.price-tier tr.is-active td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.price-tier .save { color: var(--ok); }

/* ---------- Selector de cantidad ---------- */
.qty { display: inline-flex; align-items: stretch; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface-2); }
.qty button { width: 40px; display: grid; place-items: center; color: var(--text-muted); }
.qty button:hover { color: var(--interactive-text); background: var(--surface-3); }
.qty input { width: 56px; text-align: center; border: 0; border-inline: 1px solid var(--line); background: transparent; font: 600 var(--fs-sm)/1 var(--font-mono); -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty--sm { height: 34px; } .qty--sm button { width: 30px; } .qty--sm input { width: 44px; }

/* ==========================================================================
   CategoryModule — módulos montados en una placa
   ========================================================================== */
.board {
  position: relative; padding: clamp(14px, 2.5vw, 28px); border-radius: 10px;
  background: color-mix(in srgb, var(--c-mask) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c-mask) 40%, var(--line));
  background-image:
    radial-gradient(circle at 14px 14px, var(--bg) 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) 14px, var(--bg) 4px, transparent 5px),
    radial-gradient(circle at 14px calc(100% - 14px), var(--bg) 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), var(--bg) 4px, transparent 5px);
}
.board-silk { display: flex; justify-content: space-between; margin: 0 8px 14px; font: 500 10px/1 var(--font-mono); letter-spacing: .14em; color: color-mix(in srgb, var(--text) 55%, transparent); text-transform: uppercase; }
.board-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .board-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-products, .cm-products a { min-width: 0; }
.cat-module {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 100%;
  padding: 16px; border-radius: var(--r-2); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--dur-2), background-color var(--dur-2), transform var(--dur-2) var(--ease-out);
}
.cat-module::before { /* pines del módulo */
  content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--trace-dim) 0 6px, transparent 6px 12px);
  transition: background var(--dur-2);
}
.cat-module:hover, .cat-module:focus-within { border-color: color-mix(in srgb, var(--signal) 55%, var(--line)); background: var(--surface-2); }
.cat-module:hover::before, .cat-module:focus-within::before { background: repeating-linear-gradient(90deg, var(--trace) 0 6px, transparent 6px 12px); }
.cat-module:hover .led, .cat-module:focus-within .led { --led: var(--signal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--signal) 25%, transparent), 0 0 12px var(--signal); }
.cm-text { display: grid; gap: 10px; align-content: start; }
/* Módulo de expansión (categorías genéricas): ocupa toda la fila de la placa */
.cat-module--wide { grid-column: 1 / -1; border-style: dashed; }
.cat-module--wide::before { left: auto; right: 16px; width: 96px; }
@media (min-width: 760px) {
  .cat-module--wide { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: center; }
  .cat-module--wide .cm-head { flex-direction: column; align-items: flex-start; align-self: stretch; }
  .cat-module--wide .cm-products { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 20px; border-left: 1px dashed var(--line); }
}
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-ref { font: 500 10px/1 var(--font-mono); letter-spacing: .12em; color: var(--text-faint); }
.cm-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-1); background: var(--bg-sunken); color: var(--copper-text); border: 1px solid var(--line); }
.cm-icon .ico { width: 26px; height: 26px; }
.cm-title { font: 700 var(--fs-lg)/1.15 var(--font-display); font-variation-settings: "wdth" 110; }
.cm-title a { text-decoration: none; }
.cm-title a::after { content: ""; position: absolute; inset: 0; }
.cm-desc { font-size: var(--fs-sm); color: var(--text-muted); }
.cm-count { font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--copper-text); }
.cm-products { display: grid; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); position: relative; z-index: 1; }
.cm-products a { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); text-decoration: none; color: var(--text-muted); padding: 3px 0; }
.cm-products a:hover { color: var(--interactive-text); }
.cm-products a span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-products a span:last-child { font-family: var(--font-mono); color: var(--text); flex: none; }
/* El espacio de los 3 productos siempre está reservado: al pasar el cursor solo aparecen,
   sin recortes ni saltos de la cuadrícula. */
@media (hover: hover) and (pointer: fine) {
  .cm-products { opacity: 0; transform: translateY(4px); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-out); }
  .cat-module:hover .cm-products, .cat-module:focus-within .cm-products { opacity: 1; transform: none; }
}

/* ==========================================================================
   KitCard + carrusel con barra de carga
   ========================================================================== */
.carousel { position: relative; }
.carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: var(--sp-2); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
.carousel-track::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .carousel-track { grid-auto-columns: calc((100% - 2 * var(--sp-2)) / 3); } }
@media (min-width: 1180px) { .carousel-track { grid-auto-columns: calc((100% - 3 * var(--sp-2)) / 4); } }
.carousel-track > * { scroll-snap-align: start; }
.carousel-ctrl { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.loadbar { flex: 1; display: grid; grid-auto-flow: column; gap: 3px; height: 14px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 3px; }
.loadbar i { background: var(--surface-3); border-radius: 1px; transition: background-color var(--dur-1); }
.loadbar i.on { background: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); }
.loadbar-label { font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--text-muted); min-width: 4.5ch; text-align: right; }

.kit-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden;
  transition: border-color var(--dur-2);
}
.kit-card:hover, .kit-card:focus-within { border-color: var(--accent); }
.kit-card .kc-top { position: relative; padding: 16px; background: var(--bg-sunken); border-bottom: 1px solid var(--line); min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; overflow: hidden; }
.kit-card .kc-code { font: 700 11px/1 var(--font-mono); letter-spacing: .12em; color: var(--accent-text); }
.kit-card .kc-title { font: 700 var(--fs-xl)/1.1 var(--font-display); font-variation-settings: "wdth" 112; letter-spacing: -.02em; max-width: 14ch; position: relative; }
.kit-card .kc-title a { text-decoration: none; }
.kit-card .kc-sym { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; color: var(--trace); opacity: .55; }
.kit-card .kc-items .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 26px; }
.kit-card .kc-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; flex: 1; }
.kit-card .kc-desc { font-size: var(--fs-sm); color: var(--text-muted); }
.kit-card .kc-items { display: flex; flex-wrap: wrap; gap: 4px; }
.kit-card .kc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.kit-card .kc-save { font: 500 var(--fs-xs)/1.2 var(--font-mono); color: var(--ok); }

/* ==========================================================================
   SpecTable — ficha técnica tipo datasheet
   ========================================================================== */
.spec-table { font-size: var(--fs-sm); border-top: 2px solid var(--text); }
.spec-table caption { text-align: left; caption-side: top; padding-bottom: 10px; font: 600 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.spec-table th, .spec-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.spec-table th { width: 42%; font-weight: 500; color: var(--text-muted); }
.spec-table td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.spec-table tr:hover th, .spec-table tr:hover td { background: color-mix(in srgb, var(--interactive) 5%, transparent); }

/* Tabla técnica comparativa (catálogo, vista tabla) */
.tech-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.tech-table { font-size: var(--fs-sm); min-width: 980px; }
.tech-table th, .tech-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.tech-table thead th { position: sticky; top: 0; background: var(--surface-2); font: 500 10px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.tech-table thead th button { display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.tech-table thead th button:hover { color: var(--text); }
.tech-table thead th[aria-sort] button { color: var(--interactive-text); }
.tech-table td.mono, .tech-table td .mono { font-size: 12px; }
.tech-table tbody tr:hover { background: var(--surface-2); }
.tech-table .tt-name { display: flex; align-items: center; gap: 10px; white-space: normal; min-width: 240px; }
.tech-table .tt-name a { font-weight: 600; text-decoration: none; }
.tech-table .tt-name a:hover { color: var(--interactive-text); }
.tech-table .tt-thumb { width: 52px; flex: none; border-radius: 3px; overflow: hidden; }

/* ==========================================================================
   FilterPanel
   ========================================================================== */
.filter-panel { display: grid; gap: 0; }
.filter-group { border-bottom: 1px solid var(--line); }
.filter-group > summary {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
  padding: 14px 0; font: 600 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::after { content: "+"; font-size: 16px; color: var(--text-faint); }
.filter-group[open] > summary::after { content: "−"; }
.filter-group .fg-body { padding-bottom: 14px; display: grid; gap: 2px; }
.filter-opt { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 3px; cursor: pointer; font-size: var(--fs-sm); }
.filter-opt:hover { background: var(--surface-2); }
.filter-opt input { width: 16px; height: 16px; accent-color: var(--interactive); margin: 0; }
.filter-opt .n { margin-left: auto; font: 400 11px/1 var(--font-mono); color: var(--text-faint); }
.filter-opt.is-empty { opacity: .45; }
.range-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.range-row input { width: 100%; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; }
.field label, .field .label { font: 500 var(--fs-xs)/1.2 var(--font-mono); letter-spacing: .04em; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-1);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--interactive); box-shadow: var(--glow-cyan); }
.input.mono { font-family: var(--font-mono); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 46px; font-family: var(--font-mono); }
.input-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--text-faint); pointer-events: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; gap: var(--sp-2); }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.field-hint { font-size: var(--fs-xs); color: var(--text-faint); }
.field-error { font-size: var(--fs-xs); color: var(--danger); }

/* Segmentado (radio como botones) */
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r-1); background: var(--bg-sunken); border: 1px solid var(--line); }
.segmented button, .segmented label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 3px; font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--text-muted); cursor: pointer; }
.segmented [aria-pressed="true"], .segmented [aria-selected="true"], .segmented input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--interactive); }

/* ==========================================================================
   Tabs y acordeón
   ========================================================================== */
.tabs [role="tablist"] { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line-strong); scrollbar-width: none; }
.tabs [role="tab"] {
  position: relative; flex: none; padding: 14px 16px; font: 600 var(--fs-sm)/1 var(--font-display); color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--trace); }
.tabs [role="tab"] .n { font: 400 11px/1 var(--font-mono); color: var(--text-faint); margin-left: 4px; }
.tabs [role="tabpanel"] { padding-block: var(--sp-4); }
.tabs [role="tabpanel"]:focus-visible { outline-offset: 6px; }

.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font-weight: 600; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ""; width: 10px; height: 10px; flex: none; margin-top: 6px; border-right: 2px solid var(--copper-text); border-bottom: 2px solid var(--copper-text); transform: rotate(45deg); transition: transform var(--dur-2); }
.accordion details[open] summary::after { transform: rotate(-135deg); }
.accordion .acc-body { padding: 0 0 18px; color: var(--text-muted); max-width: 72ch; }
.accordion .acc-body > * + * { margin-top: 10px; }

/* ==========================================================================
   Calculator
   ========================================================================== */
.calc { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.calc-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.calc-head h3 { font-size: var(--fs-lg); }
.calc-head .cm-icon { width: 40px; height: 40px; }
.calc-desc { font-size: var(--fs-sm); color: var(--text-muted); }
.calc-inputs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.calc-out {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px;
  margin-top: auto; padding: 14px 16px; border-radius: var(--r-1);
  background: #0A1212; border: 1px solid rgba(63,224,208,.22);
  font-family: var(--font-mono); color: var(--c-cyan);
}
[data-theme="light"] .calc-out { background: #10201E; }
.calc-out .lbl { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(63,224,208,.6); width: 100%; }
.calc-out .val { font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -.02em; text-shadow: 0 0 12px rgba(63,224,208,.35); }
.calc-out .sub { font-size: 11px; color: rgba(233,237,239,.65); }
.calc-out .warn { color: var(--c-amber); }
.calc-formula { font: 400 11px/1.4 var(--font-mono); color: var(--text-faint); }
.resistor-svg { width: 100%; height: 64px; }
/* Calculadoras del segundo grupo (calc-mas.js) */
.calc .segmented { flex-wrap: wrap; max-width: 100%; }
.calc-outs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.calc-outs .calc-out { margin-top: 0; }
.calc-out .val.is-msg { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; line-height: 1.4; text-shadow: none; color: var(--c-amber); }
.calc-steps { padding: 12px 14px; border-radius: var(--r-1); background: var(--bg-sunken); border: 1px solid var(--line); font: 400 12px/1.6 var(--font-mono); color: var(--text-muted); overflow-wrap: anywhere; }
.calc-steps .f { color: var(--text); font-weight: 600; }
.calc-steps ol { margin: 6px 0 0; padding-left: 20px; list-style: decimal; }
.calc-steps b { color: var(--accent-text); font-weight: 700; }
.calc-steps dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.calc-steps dt { color: var(--text-faint); }
.calc-steps dd { margin: 0; color: var(--text); }
.calc-steps .note { margin-top: 6px; font-size: 11px; color: var(--text-faint); }
.calc-chart { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--bg-sunken); }
.calc-chart path { fill: none; stroke-width: 1.5; }
.calc-chart .ax { stroke: var(--line-strong); }
.calc-chart .g { stroke: var(--line); stroke-dasharray: 2 3; stroke-width: 1; }
.calc-chart .g--t { stroke: var(--text-faint); stroke-dasharray: 4 3; }
.calc-chart .c1 { stroke: var(--accent); stroke-width: 2; }
.calc-chart .c2 { stroke: var(--signal); stroke-width: 2; }
.calc-chart .p1 { fill: var(--accent); }
.calc-chart .p2 { fill: var(--signal); }
.calc-chart text { fill: var(--text-faint); font: 500 9px var(--font-mono); }
.calc-chart .t1 { fill: var(--accent-text); }
.calc-chart .t2 { fill: var(--signal-text); }
/* Esquemas de las calculadoras (esquemas.js): fondo transparente, componentes en el acento del modo
   (verde #3DBA87 en Académico, cobre en Pro) y lo que se calcula en el segundo acento */
.calc { --sch-part: var(--accent); --sch-hi: var(--accent-2); }
.calc-sch { display: grid; gap: 4px; }
.calc-sch:empty { display: none; }
.sch { display: block; width: 100%; height: auto; max-height: 150px; overflow: visible; }
.sch .w { fill: none; stroke: var(--text-muted); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.sch .c { fill: none; stroke: var(--sch-part); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--dur-1); }
.sch .c--thin { stroke-width: 1.2; }
.sch .body { fill: color-mix(in srgb, var(--sch-part) 14%, transparent); }
.sch .jn { fill: var(--text-muted); }
.sch .tm { fill: none; stroke: var(--text-muted); stroke-width: 1.3; }
.sch text { font-family: var(--font-mono); font-size: 10px; fill: var(--text); }
.sch .ref { font-weight: 600; }
.sch .val { font-size: 9.5px; fill: var(--text-muted); }
.sch .pn { font-size: 8.5px; fill: var(--text-muted); }
.sch .pm { fill: var(--text-muted); }
.sch .cap { font-size: 10.5px; font-weight: 700; fill: var(--text-muted); }
.sch .code { font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.sch .ic { font-size: 12px; font-weight: 700; fill: var(--sch-part); }
.sch .hi .c { stroke: var(--sch-hi); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--sch-hi) 55%, transparent)); }
.sch .hi text, .sch text.hi { fill: var(--sch-hi); font-weight: 700; }
.band-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.band-pickers select { font-size: 12px; min-height: 38px; padding: 6px 26px 6px 8px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line-strong); vertical-align: -1px; }

/* ==========================================================================
   Display de 7 segmentos
   ========================================================================== */
.seg-display {
  display: inline-flex; align-items: center; gap: 6px; padding: 14px 18px; border-radius: var(--r-2);
  background: #120B05; border: 1px solid rgba(255,176,32,.25); box-shadow: inset 0 0 24px rgba(0,0,0,.8);
}
.seg-digit { width: 30px; height: 52px; }
.seg-digit .s { fill: rgba(255,176,32,.08); transition: fill var(--dur-1); }
.seg-digit .s.on { fill: var(--c-amber); filter: drop-shadow(0 0 3px rgba(255,176,32,.8)); }
.seg-colon { width: 10px; height: 52px; }
.seg-colon circle { fill: var(--c-amber); filter: drop-shadow(0 0 3px rgba(255,176,32,.8)); }
@media (prefers-reduced-motion: no-preference) { .seg-colon.blink circle { animation: colon 1s steps(1) infinite; } }
@keyframes colon { 50% { opacity: .15; } }
.seg-units { display: flex; gap: 6px; padding: 6px 18px 0; font: 500 9px/1 var(--font-mono); letter-spacing: .14em; color: var(--text-faint); }

/* ==========================================================================
   Multímetro (barra de confianza)
   ========================================================================== */
.meter {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-amber) 9%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
}
.meter-dial { position: relative; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-sunken); border: 1px solid var(--line-strong); }
.meter-dial::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 20px; margin-left: -1.5px; border-radius: 2px; background: var(--text); transform-origin: 50% 0; transform: rotate(var(--rot, 200deg)); }
.meter-dial span { position: absolute; font: 600 8px/1 var(--font-mono); color: var(--text-faint); }
.meter-dial span.on { color: var(--signal-text); }
.meter-lcd { padding: 8px 10px; border-radius: 4px; background: #B8C2A3; color: #1F2418; box-shadow: inset 0 1px 3px rgba(0,0,0,.35); }
.meter-lcd .v { font: 700 22px/1 var(--font-mono); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 6px; }
.meter-lcd .v small { font-size: 11px; font-weight: 600; }
.meter-lcd .l { font: 600 10px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; opacity: .8; }
.meter-text { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--text-muted); }

/* ==========================================================================
   Testimonial / caso de cliente (plantilla verificable)
   ========================================================================== */
.case-card { display: flex; flex-direction: column; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-2); overflow: hidden; }
.case-card .case-photo { aspect-ratio: 16 / 10; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--text-faint); font: 500 var(--fs-xs)/1.4 var(--font-mono);
  background: repeating-linear-gradient(-45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); border-bottom: 1px dashed var(--line-strong); }
.case-card .case-photo .ico { width: 32px; height: 32px; margin: 0 auto 10px; color: var(--copper-text); }
.case-card .case-body { padding: 18px; display: grid; gap: 10px; }
.case-card blockquote { font-size: var(--fs-md); line-height: 1.5; }
.case-card .case-who { font: 500 var(--fs-xs)/1.4 var(--font-mono); color: var(--text-muted); }
.case-card .case-verify { display: flex; gap: 8px; align-items: center; font: 500 11px/1.3 var(--font-mono); color: var(--text-faint); padding-top: 10px; border-top: 1px solid var(--line); }
.case-card[data-placeholder] .slot { color: var(--signal-text); }

/* ==========================================================================
   Toast, FAB de asesoría, bandeja del comparador
   ========================================================================== */
.toast-region { position: fixed; z-index: var(--z-toast); left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-2); background: var(--c-graphite-800); color: #E9EDEF; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 18px 40px rgba(0,0,0,.4); font-size: var(--fs-sm); animation: toast-in var(--dur-2) var(--ease-out); }
.toast a { color: var(--c-cyan); font-weight: 600; margin-left: auto; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.fab {
  position: fixed; z-index: var(--z-fab); right: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px 0 14px; border-radius: var(--r-pill);
  background: var(--c-graphite-800); color: #E9EDEF; text-decoration: none;
  border: 1px solid rgba(63,224,208,.35); box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 0 0 4px rgba(63,224,208,.06);
  font: 600 var(--fs-sm)/1.15 var(--font-display);
  transition: transform var(--dur-2) var(--ease-out), padding var(--dur-2);
}
.fab:hover { transform: translateY(-2px); border-color: var(--c-cyan); }
.fab .fab-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #25D366; color: #06210F; flex: none; }
.fab .fab-ico .ico { width: 18px; height: 18px; }
.fab small { display: block; font: 500 10px/1.2 var(--font-mono); color: var(--c-cyan); letter-spacing: .04em; }
.fab .fab-text { max-width: 340px; overflow: hidden; white-space: nowrap; transition: max-width var(--dur-3) var(--ease-out), opacity var(--dur-2); }
.fab.is-compact { padding: 0 11px; }
.fab.is-compact .fab-text { max-width: 0; opacity: 0; }
@media (max-width: 599px) { .fab { padding: 0 11px; } .fab .fab-text { max-width: 0; opacity: 0; } }
body.has-compare .fab { bottom: 92px; }

.compare-tray {
  position: fixed; z-index: var(--z-fab); left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; width: min(720px, calc(100vw - 32px));
  background: var(--c-graphite-800); color: #E9EDEF; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-2);
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
}
.compare-tray .ct-label { font: 600 11px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-cyan); white-space: nowrap; }
.compare-tray .ct-slots { display: flex; gap: 6px; flex: 1; overflow: hidden; }
.compare-tray .ct-slot { width: 52px; height: 40px; border-radius: 3px; overflow: hidden; border: 1px dashed rgba(255,255,255,.2); flex: none; position: relative; }
.compare-tray .ct-slot button { position: absolute; inset: 0; opacity: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 16px; }
.compare-tray .ct-slot:hover button, .compare-tray .ct-slot button:focus-visible { opacity: 1; }
.compare-tray .btn--ghost { --btn-fg: #C7CFD4; }

/* Animación "viaje por la pista" al carrito */
.fly-layer { position: fixed; inset: 0; z-index: var(--z-fly); pointer-events: none; }
.fly-layer path { fill: none; stroke: var(--c-copper); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(227,154,94,.8)); }
.fly-dot { position: fixed; left: 0; top: 0; z-index: var(--z-fly); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #FFE2C4; box-shadow: 0 0 0 3px rgba(200,119,58,.5), 0 0 18px 4px rgba(227,154,94,.9); pointer-events: none; }

/* ==========================================================================
   Skeleton loaders con forma de componentes
   ========================================================================== */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 3px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent); }
@media (prefers-reduced-motion: no-preference) { .skel::after { animation: shimmer 1.2s infinite; } }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { padding: 0; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); overflow: hidden; }
.skel-chip { /* IC DIP: cuerpo con patitas */
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--art-bg);
}
.skel-chip .body { width: 44%; height: 36%; border-radius: 4px; }
.skel-chip .pins { position: absolute; left: 28%; right: 28%; height: 8%; background: repeating-linear-gradient(90deg, var(--surface-3) 0 8px, transparent 8px 16px); }
.skel-chip .pins.top { top: 24%; } .skel-chip .pins.bot { bottom: 24%; }
.skel-lines { padding: 16px; display: grid; gap: 10px; }
.skel-line { height: 10px; } .skel-line.w60 { width: 60%; } .skel-line.w40 { width: 40%; } .skel-line.h20 { height: 20px; width: 35%; }
.skel-resistor { height: 12px; border-radius: 6px; width: 70%; margin: 0 auto; }

/* ---------- Breadcrumb ---------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; font: 400 var(--fs-xs)/1.4 var(--font-mono); color: var(--text-faint); }
.breadcrumb li + li::before { content: "→"; margin-right: 6px; color: var(--trace); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--interactive-text); }

/* ---------- Panel genérico ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: clamp(16px, 2.5vw, 24px); }
.panel--sunken { background: var(--bg-sunken); }
.panel-title { font: 600 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; display: flex; justify-content: space-between; gap: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-muted); }
.kv dd { font-family: var(--font-mono); text-align: right; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-1); font-size: var(--fs-sm); background: color-mix(in srgb, var(--signal) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--signal) 35%, transparent); }
.notice .ico { color: var(--signal-text); margin-top: 1px; }
.notice--info { background: color-mix(in srgb, var(--interactive) 6%, var(--surface)); border-color: color-mix(in srgb, var(--interactive) 30%, transparent); }
.notice--info .ico { color: var(--interactive-text); }
.empty-state { text-align: center; padding: clamp(32px, 6vw, 64px) 16px; display: grid; justify-items: center; gap: 12px; color: var(--text-muted); }
.empty-state .ico { width: 48px; height: 48px; color: var(--copper-text); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: var(--sp-10); background: var(--bg-sunken); border-top: 1px solid var(--line); font-size: var(--fs-sm); position: relative; }
.site-footer::before { /* pista superior */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--trace) 20%, var(--trace) 80%, transparent);
  opacity: .6;
}
.footer-grid { display: grid; gap: var(--sp-4); padding-block: var(--sp-8) var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer-brand { grid-column: 1 / -1; max-width: 420px; }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr repeat(4, 1fr); } .footer-brand { grid-column: auto; } }
.footer-grid h3 { font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--copper-text); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--interactive-text); }
.footer-pay { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.footer-legal { border-top: 1px solid var(--line); padding-block: var(--sp-3); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font: 400 11px/1.5 var(--font-mono); color: var(--text-faint); }
.footer-legal a { color: var(--text-muted); }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* ==========================================================================
   Impresión: cotización / BOM a PDF
   ========================================================================== */
.print-doc { display: none; }
@media print {
  body { background: #fff !important; color: #000 !important; }
  body.printing > *:not(.print-doc) { display: none !important; }
  body.printing .print-doc { display: block !important; font-family: var(--font-body); color: #111; padding: 0; }
  .print-doc table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .print-doc th, .print-doc td { border-bottom: 1px solid #ccc; padding: 6px 4px; text-align: left; }
  .print-doc td.r, .print-doc th.r { text-align: right; }
  .print-doc .pd-head { display: flex; justify-content: space-between; border-bottom: 3px solid #C8773A; padding-bottom: 12px; margin-bottom: 16px; }
  .print-doc h1 { font-size: 20px; }
  .print-doc .mono { font-family: var(--font-mono); }
  .print-doc .tot { margin-top: 12px; margin-left: auto; width: 280px; }
  .print-doc .tot div { display: flex; justify-content: space-between; padding: 3px 0; }
  .print-doc .tot .grand { font-weight: 700; font-size: 14px; border-top: 2px solid #111; padding-top: 6px; }
  .print-doc .note { font-size: 10px; color: #555; margin-top: 18px; }
  @page { margin: 14mm; }
}
