/* Configurador de racks. Todo con prefijo .ecrc para no chocar con el tema.
   Viene de la maqueta validada (maqueta/plantilla.html).
   Usa las variables del rediseno V2 del tema (custom.css): --ec-red,
   --ec-ink, --ec-bg, --ec-line, --ec-sh, --ec-font, --ec-cond, --ec-mono... */

.ecrc {
  --ecrc-ok: #1E8E3E;
  --ecrc-t: 180ms;
  color: var(--ec-ink);
  font: 15px/1.45 var(--ec-font);
  -webkit-font-smoothing: antialiased;
}
.ecrc *, .ecrc *::before, .ecrc *::after { box-sizing: border-box; }
.ecrc button { font: inherit; color: inherit; }
.ecrc :focus-visible { outline: 2px solid var(--ec-red); outline-offset: 2px; }
.ecrc h1, .ecrc h2, .ecrc h3 { letter-spacing: normal; }
/* El tema pinta los <code> en rojo con fondo: aquí son referencias, en gris. */
.ecrc code { color: inherit; background: none; padding: 0; border: 0; font: 500 12px var(--ec-mono); }
.ecrc.is-loading .ecrc-grid { opacity: .6; }

/* --- pagina --- */
.ecrc { max-width: 1880px; margin: 0 auto; padding: 20px 24px 40px; }
.ecrc-head { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.ecrc-head h1 { font: 800 34px/1 var(--ec-cond); text-transform: uppercase; letter-spacing: .01em; margin: 0; }
.ecrc-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ecrc-step { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 8px; border-radius: 999px; border: 1.5px solid var(--ec-line); background: #fff; font-weight: 600; cursor: pointer; }
.ecrc-step i { font: 700 13px var(--ec-cond); font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ec-bg); color: var(--ec-ink-2); }
.ecrc-step[aria-current="step"] { border-color: var(--ec-red); color: var(--ec-red-d); background: var(--ec-red-soft); }
.ecrc-step[aria-current="step"] i { background: var(--ec-red); color: #fff; }
.ecrc-step:disabled { cursor: not-allowed; color: var(--ec-mute); background: transparent; border-style: dashed; }
.ecrc-headbtns { display: flex; gap: 8px; margin-left: auto; }
.ecrc-step.is-done i { background: #E3F3E8; color: var(--ecrc-ok); }
/* buscador global */
.ecrc-gsearch { position: relative; flex: 0 1 340px; min-width: 220px; }
.ecrc-gsearch input { width: 100%; height: 40px; padding: 0 14px; border: 1.5px solid var(--ec-line); border-radius: 999px; font: 15px var(--ec-font); background: #fff; }
.ecrc-gres { position: absolute; z-index: 30; top: 46px; left: 0; width: min(520px, 90vw); max-height: 440px; overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 18px 40px rgba(0,0,0,.18); padding: 6px; }
.ecrc-gopt { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.ecrc-gopt:hover, .ecrc-gopt:focus { background: var(--ec-red-soft); }
.ecrc-gopt .tag { font: 700 11px var(--ec-cond); text-transform: uppercase; letter-spacing: .04em; color: var(--ec-ink-2); background: var(--ec-bg); border-radius: 4px; padding: 3px 6px; justify-self: start; }
.ecrc-gopt .n { font-weight: 600; font-size: 13px; line-height: 1.3; }
.ecrc-gopt .ecrc-meta { display: block; }
.ecrc-gopt .ecrc-price { font-size: 17px; }
/* barra Atras / Siguiente al pie del panel */
.ecrc-nav { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 10px; justify-content: space-between; margin: 20px -20px -20px; padding: 12px 20px; background: #fff; border-top: 1px solid var(--ec-line); border-radius: 0 0 12px 12px; }
.ecrc-nav .ecrc-btn--main { flex: 1; min-height: 46px; font-size: 16px; }
.ecrc-mastips { justify-self: start; font-size: 14px; }
.ecrc-famhead { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 6px 2px; font: 700 13px var(--ec-cond); text-transform: uppercase; letter-spacing: .05em; color: var(--ec-ink-2); }
.ecrc-famhead i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.ecrc-famhead small { font: 600 12px var(--ec-font); color: var(--ec-mute); letter-spacing: 0; }
.ecrc-vertodos { display: flex; width: 100%; margin: 6px 0 4px; color: var(--ec-red); border-color: var(--ec-red); }
.ecrc-vertodos:hover, .ecrc-vertodos:focus-visible { background: var(--ec-red-soft); }
/* ayuda del dibujo */
.ecrc-help { display: inline-block; position: relative; margin-left: 8px; vertical-align: middle; }
.ecrc-help summary { list-style: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ec-line); display: grid; place-items: center; font-weight: 700; color: var(--ec-ink-2); cursor: pointer; }
.ecrc-help summary::-webkit-details-marker { display: none; }
.ecrc-help[open] summary { border-color: var(--ec-red); color: var(--ec-red); }
.ecrc-help > div { position: absolute; right: 0; top: 30px; z-index: 20; width: 300px; background: #fff; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 14px 32px rgba(0,0,0,.16); padding: 12px 14px; font-size: 13px; color: var(--ec-ink-2); text-align: left; }
.ecrc-help p { margin: 0 0 6px; } .ecrc-help p:last-child { margin: 0; }
/* etiquetas junto al rack: se ocultan cuando salen los botones del equipo */
.dev .lbl { transition: opacity var(--ecrc-t); }
.dev:hover .lbl, .dev:focus .lbl, .dev:focus-within .lbl, .dev.is-sel .lbl { opacity: 0; }
/* resumen agrupado */
.ecrc-lines--rack { margin-top: 16px; }
.ecrc-grp { border-top: 1px solid var(--ec-line); padding-top: 8px; margin-top: 8px; }
.ecrc-grp summary { display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; padding: 2px 0; }
.ecrc-grp summary::-webkit-details-marker { display: none; }
.ecrc-grp summary span::before { content: "▸ "; color: var(--ec-mute); }
.ecrc-grp[open] summary span::before { content: "▾ "; }
.ecrc-grp summary small { font-weight: 500; color: var(--ec-mute); }
.ecrc-grp .ecrc-lines { border-top: 0; margin-top: 6px; padding-top: 0; max-height: 30vh; }

.ecrc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1.5px solid var(--ec-line); background: #fff; font-weight: 700; cursor: pointer; transition: border-color var(--ecrc-t), background var(--ecrc-t); }
.ecrc-btn:hover:not(:disabled) { border-color: var(--ec-ink-2); }
.ecrc-btn:disabled { opacity: .45; cursor: not-allowed; }
.ecrc-btn--main { background: var(--ec-red); border-color: var(--ec-red); color: #fff; }
.ecrc-btn--main:hover:not(:disabled) { background: var(--ec-red-d); border-color: var(--ec-red-d); }
.ecrc-btn--wide { width: 100%; min-height: 48px; font-size: 16px; }
.ecrc-btn--sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.ecrc-link { background: none; border: 0; padding: 0; color: var(--ec-red); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.ecrc-grid { display: grid; grid-template-columns: minmax(400px, 1.15fr) minmax(340px, 0.85fr) 320px; gap: 20px; align-items: start; }
.ecrc-card { background: #fff; border-radius: 12px; box-shadow: var(--ec-sh); }
.ecrc-panel { padding: 20px; }
.ecrc-panel h2, .ecrc-sum h2 { font: 800 20px/1.1 var(--ec-cond); text-transform: uppercase; margin: 0 0 14px; }
.ecrc-label { font: 700 14px var(--ec-cond); text-transform: uppercase; letter-spacing: .05em; color: var(--ec-ink-2); margin: 14px 0 6px; display: flex; justify-content: space-between; align-items: baseline; }
.ecrc-label small { font: 500 13px var(--ec-font); text-transform: none; letter-spacing: 0; color: var(--ec-mute); }

/* tipo */
.ecrc-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ecrc-type { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--ec-line); background: #fff; cursor: pointer; transition: border-color var(--ecrc-t), background var(--ecrc-t); }
.ecrc-type:hover { border-color: var(--ec-ink-2); }
.ecrc-type[aria-pressed="true"] { border-color: var(--ec-red); background: var(--ec-red-soft); }
.ecrc-type svg { width: 40px; height: 46px; }
.ecrc-type b { display: block; font: 800 18px/1 var(--ec-cond); text-transform: uppercase; }
.ecrc-type span { display: block; font-size: 13px; color: var(--ec-mute); margin-top: 4px; }

/* pildoras */
.ecrc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ecrc-pill { min-width: 40px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1.5px solid var(--ec-line); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: border-color var(--ecrc-t), background var(--ecrc-t), color var(--ecrc-t); }
.ecrc-pill:hover { border-color: var(--ec-ink-2); }
.ecrc-pill[aria-pressed="true"] { border-color: var(--ec-red); background: var(--ec-red-soft); color: var(--ec-red-d); }
.ecrc-pill.is-na { color: var(--ec-mute); background: transparent; border-style: dashed; text-decoration: line-through; text-decoration-color: rgba(122,127,138,.7); }
.ecrc-pill.is-na:hover { text-decoration: none; color: var(--ec-ink-2); }
.ecrc-dims { display: grid; grid-template-columns: 64px 1fr; gap: 8px 10px; align-items: center; }
.ecrc-dims > span { font-size: 13px; color: var(--ec-mute); font-weight: 600; }
.ecrc-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--ec-bg); font-size: 14px; color: var(--ec-ink-2); }

/* rack elegido */
.ecrc-racks { display: grid; gap: 10px; }
.ecrc-rack { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 10px 12px 10px 10px; border-radius: 10px; border: 1.5px solid var(--ec-line); background: #fff; cursor: pointer; text-align: left; width: 100%; }
.ecrc-rack:hover { border-color: var(--ec-ink-2); }
.ecrc-rack { position: relative; }
.ecrc-rack-sel { position: absolute; inset: 0; z-index: 1; width: 100%; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.ecrc-rack-sel:focus-visible { outline: 2px solid var(--ec-red); outline-offset: 2px; }
.ecrc-rack .ecrc-ficha { position: relative; z-index: 2; }
.ecrc-ficha { color: inherit; text-decoration: none; transition: color var(--ecrc-t); }
.ecrc-ficha:hover, .ecrc-ficha:focus-visible { color: var(--ec-red); text-decoration: underline; text-underline-offset: 2px; }
.ecrc-rack.is-on { border-color: var(--ec-red); box-shadow: 0 0 0 3px var(--ec-red-soft); }
.ecrc-rack img, .ecrc-ph { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: #fff; }
.ecrc-ph { display: grid; place-items: center; background: var(--ec-bg); color: var(--ec-mute); font-size: 11px; text-align: center; }
.ecrc-rack b { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.ecrc-meta { font-size: 13px; color: var(--ec-mute); margin-top: 3px; }
.ecrc-meta code { font: 500 12px var(--ec-mono); }
.ecrc-incluye { display: block; color: var(--ec-ink); font-weight: 600; }
.ecrc-price { font: 700 24px/1 var(--ec-cond); color: var(--ec-red); white-space: nowrap; text-align: right; }
.ecrc-price small { display: block; font: 500 12px var(--ec-font); color: var(--ec-mute); margin-top: 2px; }
.ecrc-stock { font-size: 13px; font-weight: 600; margin-top: 4px; }
.ecrc-stock.is-ok { color: var(--ecrc-ok); }
.ecrc-stock.is-no { color: var(--ec-mute); }
.is-out img, .is-out .ecrc-ph { filter: grayscale(1); opacity: .6; }
.ecrc-next { margin-top: 20px; }
.ecrc-sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.ecrc-cable { display: grid; place-items: center; }
.ecrc-cable i { width: 34px; height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); position: relative; }
.ecrc-cable i::before, .ecrc-cable i::after { content: ""; position: absolute; top: -3px; width: 9px; height: 14px; border-radius: 2px; background: #C4C7CE; }
.ecrc-cable i::before { left: -7px; } .ecrc-cable i::after { right: -7px; }
.ecrc-tag { display: inline-block; margin-left: 6px; font: 600 11px var(--ec-font); color: var(--ec-red-d); background: var(--ec-red-soft); padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }
.ecrc-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ec-red); color: #fff; font-weight: 700; }
.ecrc-qty input { width: 44px; height: 32px; border: 0; text-align: center; font: 700 15px var(--ec-font); -moz-appearance: textfield; background: transparent; }
.ecrc-qty input::-webkit-outer-spin-button, .ecrc-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ecrc-f3 { margin-top: 12px; grid-template-columns: 84px 1fr; }
.ecrc-select { height: 36px; padding: 0 10px; border-radius: 999px; border: 1.5px dashed var(--ec-line); background: #fff; font: 600 14px var(--ec-font); color: var(--ec-ink-2); }
.ecrc-others { display: grid; gap: 2px; }
.ecrc-other { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.ecrc-other:hover { background: var(--ec-bg); }
.ecrc-other[aria-pressed="true"] { background: var(--ec-red-soft); box-shadow: inset 3px 0 0 var(--ec-red); }
.ecrc-others { max-height: 420px; overflow: auto; }
.ecrc-rack--main { cursor: default; border-color: var(--ec-red); }
.ecrc-pill.is-any { font-weight: 500; }
.ecrc-other .ecrc-u { justify-self: start; font-size: 13px; padding: 2px 7px; }
.ecrc-other .n { font-weight: 600; font-size: 13px; line-height: 1.3; }
.ecrc-other .ecrc-meta { display: block; margin-top: 1px; }
.ecrc-other .ecrc-price { font-size: 17px; }
.ecrc-other.is-out .n { color: var(--ec-ink-2); }

/* paso 2 */
.ecrc-mini { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ec-bg); }
.ecrc-mini b { font-weight: 600; font-size: 14px; flex: 1; line-height: 1.3; min-width: 0; }
.ecrc-mini img, .ecrc-mini .ecrc-ph { width: 56px; height: 56px; flex: 0 0 56px; object-fit: contain; border-radius: 6px; background: #fff; }
.ecrc-mini .ecrc-btn { flex: 0 0 auto; }
.ecrc-tips { display: grid; gap: 8px; margin-top: 14px; }
.ecrc-tip { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-radius: 10px; border: 1.5px solid var(--ec-line); border-left: 4px solid var(--ec-red); background: #fff; font-size: 14px; animation: ecrc-in var(--ecrc-t) ease-out; }
.ecrc-tip p { margin: 0; flex: 1; }
.ecrc-x { width: 32px; height: 32px; border-radius: 6px; border: 0; background: none; color: var(--ec-mute); cursor: pointer; font-size: 18px; line-height: 1; }
.ecrc-x:hover { background: var(--ec-bg); color: var(--ec-ink); }
.ecrc-fams { display: flex; flex-wrap: wrap; gap: 6px; }
.ecrc-search { width: 100%; height: 40px; margin-top: 10px; padding: 0 12px; border: 1.5px solid var(--ec-line); border-radius: 8px; font: 16px var(--ec-font); background: #fff; }
.ecrc-list { display: grid; gap: 2px; margin-top: 12px; }
.ecrc-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.ecrc-row:hover { background: var(--ec-bg); }
.ecrc-row { grid-template-columns: 12px 52px 1fr auto; }
/* barra roja a la izquierda al pasar el ratón, como en Simon (16/11) */
.ecrc-row { position: relative; transition: background var(--ecrc-t); }
.ecrc-row::before, .ecrc-rack::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ec-red); transform: scaleY(0); transition: transform var(--ecrc-t); pointer-events: none; z-index: 3; }
.ecrc-rack::before { left: -1.5px; }
@media (hover: hover) and (pointer: fine) {
  .ecrc-row:hover::before, .ecrc-rack:not(.ecrc-rack--main):hover::before { transform: scaleY(1); }
}
.ecrc-grip { color: #C4C7CE; display: grid; place-items: center; align-self: stretch; touch-action: none; }
.ecrc-row.is-drag { cursor: grab; }
.ecrc-row.is-drag:hover .ecrc-grip { color: var(--ec-ink-2); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.ecrc-ghost { position: fixed; z-index: 50; pointer-events: none; max-width: 320px; padding: 8px 12px; border-radius: 8px; background: var(--ec-ink); color: #fff; font: 600 13px/1.3 var(--ec-font); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ecrc-ghost .ecrc-u { background: var(--ec-red); }
.ecrc-ghost.is-bad { background: var(--ec-red-d); }
.dev.is-moving { opacity: .35; }
.dev { touch-action: none; }
.ecrc-row img, .ecrc-row .ecrc-ph { width: 52px; height: 52px; }
.ecrc-row b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.ecrc-row .ecrc-price { font-size: 19px; }
.ecrc-u { display: inline-block; font: 700 12px var(--ec-cond); padding: 1px 6px; border-radius: 4px; background: var(--ec-ink); color: #fff; margin-right: 4px; vertical-align: 1px; }
.ecrc-why { font-size: 12.5px; color: var(--ec-red-d); margin-top: 3px; }
.ecrc-why .ecrc-link { font-size: 12.5px; }
.ecrc-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ec-line); border-radius: 8px; background: #fff; margin-top: 6px; }
.ecrc-qty button { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 18px; font-weight: 600; color: var(--ec-ink); }
.ecrc-qty button:disabled { color: #C4C7CE; cursor: not-allowed; }
.ecrc-qty output { min-width: 24px; text-align: center; font-weight: 700; }
.ecrc-right { display: flex; flex-direction: column; align-items: flex-end; }
.ecrc-incomp { margin-top: 14px; border-top: 1px solid var(--ec-line); padding-top: 10px; }
.ecrc-incomp summary { cursor: pointer; font-weight: 600; color: var(--ec-ink-2); font-size: 14px; padding: 6px 0; }
.ecrc-incomp .ecrc-row { opacity: .7; }
.ecrc-incomp .ecrc-why { color: var(--ec-ink-2); }

/* alzado */
.ecrc-stage { position: sticky; top: 16px; height: calc(100vh - 32px); min-height: 520px; max-height: 860px; padding: 12px; display: flex; flex-direction: column; }
.ecrc-stage-top { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px; font-size: 13px; color: var(--ec-mute); }
.ecrc-stage-top b { font: 800 18px var(--ec-cond); text-transform: uppercase; color: var(--ec-ink); }
/* fondo de puntos, como papel técnico, como en Simon (16/11) */
.ecrc-draw { position: relative; flex: 1; min-height: 0; border-radius: 10px; background: #FAFAFB radial-gradient(circle, #D9DBE0 1px, transparent 1.2px) 0 0 / 16px 16px; }
.ecrc-draw svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ecrc-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ec-mute); font-size: 15px; text-align: center; }
.ecrc-draw .ecrc-empty svg { position: static; width: 96px; height: 110px; opacity: .35; }
.ecrc-empty p { margin: 0; }
.ecrc-hint { text-align: center; font-size: 13px; color: var(--ec-mute); padding: 8px 0 2px; }
.slot { cursor: pointer; }
.slot rect { fill: transparent; transition: fill var(--ecrc-t); }
.slot text { opacity: 0; fill: #fff; font-weight: 700; pointer-events: none; transition: opacity var(--ecrc-t); }
.slot:hover rect, .slot:focus rect, .slot.is-open rect { fill: rgba(214,16,22,.35); stroke: var(--ec-red); stroke-dasharray: 6 4; }
.slot:hover text, .slot:focus text, .slot.is-open text { opacity: 1; }
.slot:focus { outline: none; }
.dev { cursor: pointer; }
.dev:focus { outline: none; }
.dev .face { transition: stroke var(--ecrc-t); }
.dev:hover .face, .dev:focus .face { stroke: #9AA0AA; }
.dev.is-sel .face { stroke: var(--ec-red); }
.dev .tb { opacity: 0; transition: opacity var(--ecrc-t); }
.dev:hover .tb, .dev:focus .tb, .dev:focus-within .tb, .dev.is-sel .tb { opacity: 1; }
.tb-b circle { fill: #fff; stroke: var(--ec-line); }
.tb-b path { fill: none; stroke: var(--ec-ink); stroke-linecap: round; stroke-linejoin: round; }
.tb-b:hover circle, .tb-b:focus circle { fill: var(--ec-red); stroke: var(--ec-red); }
.tb-b:hover path, .tb-b:focus path { stroke: #fff; }
.tb-b:focus { outline: none; }
.tb-b.is-off { opacity: .35; pointer-events: none; }
.dev.is-new { animation: ecrc-drop var(--ecrc-t) ease-out; }
@keyframes ecrc-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes ecrc-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* selector contextual */
.ecrc-pop { position: absolute; z-index: 5; width: 340px; max-height: 420px; overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 18px 40px rgba(0,0,0,.18); padding: 12px; animation: ecrc-in var(--ecrc-t) ease-out; }
.ecrc-popq { margin: 8px 0 4px; }
.ecrc-opt.is-no { cursor: default; opacity: .75; }
.ecrc-opt.is-no:hover { background: none; }
.ecrc-pop h3 { font: 800 16px var(--ec-cond); text-transform: uppercase; margin: 0; }
.ecrc-pop .ecrc-meta { margin: 2px 0 8px; }
.ecrc-pop-g { font: 700 12px var(--ec-cond); text-transform: uppercase; letter-spacing: .05em; color: var(--ec-mute); margin: 10px 0 4px; }
.ecrc-opt { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 6px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.ecrc-opt:hover, .ecrc-opt:focus { background: var(--ec-red-soft); }
.ecrc-opt img, .ecrc-opt .ecrc-ph { width: 40px; height: 40px; }
.ecrc-opt b { font-weight: 600; font-size: 13px; line-height: 1.25; }
.ecrc-opt .ecrc-price { font-size: 17px; }
.ecrc-pop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }

/* resumen */
.ecrc-sum { position: sticky; top: 16px; padding: 18px; }
.ecrc-ubar { display: flex; gap: 2px; height: 22px; margin-top: 6px; }
.ecrc-ubar i { flex: 1; border-radius: 2px; background: var(--ec-line); transition: background var(--ecrc-t); }
.ecrc-ucount { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: 14px; }
.ecrc-ucount b { font: 800 26px/1 var(--ec-cond); }
.ecrc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--ec-mute); }
.ecrc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ecrc-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ecrc-lines { list-style: none; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--ec-line); display: grid; gap: 10px; max-height: 38vh; overflow: auto; }
.ecrc-lines li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 13px; }
.ecrc-lines li b { font-weight: 600; line-height: 1.3; }
.ecrc-lines .ecrc-qty { margin-top: 0; justify-self: start; }
.ecrc-lines .ecrc-qty button { width: 28px; height: 28px; font-size: 16px; }
.ecrc-lines .amt { font-weight: 700; text-align: right; align-self: center; white-space: nowrap; }
.ecrc-lines .fixed { font-size: 13px; color: var(--ec-mute); align-self: center; }
.ecrc-total { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ec-line); }
.ecrc-total .big { display: flex; justify-content: space-between; align-items: baseline; }
.ecrc-total .big span { font-weight: 600; }
.ecrc-total .big b { font: 800 34px/1 var(--ec-cond); color: var(--ec-red); }
.ecrc-total .iva { display: flex; justify-content: space-between; color: var(--ec-mute); font-size: 14px; margin-top: 4px; }
.ecrc-allstock { margin: 12px 0; font-size: 14px; font-weight: 600; }
/* paso 4 */
.ecrc-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ecrc-checks li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 8px; background: var(--ec-bg); font-size: 14px; }
.ecrc-checks li > span:nth-child(2) { flex: 1; }
.ecrc-checks .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 22px; }
.ecrc-checks .is-ok .ic { background: #E3F3E8; color: var(--ecrc-ok); }
.ecrc-checks .is-warn { background: var(--ec-red-soft); }
.ecrc-checks .is-warn .ic { background: var(--ec-red); color: #fff; }
.ecrc-tablewrap { overflow-x: auto; border: 1px solid var(--ec-line); border-radius: 10px; }
.ecrc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ecrc-table th, .ecrc-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--ec-line); }
.ecrc-table thead th { font: 700 12px var(--ec-cond); text-transform: uppercase; letter-spacing: .05em; color: var(--ec-ink-2); background: var(--ec-bg); }
.ecrc-table .n { text-align: right; white-space: nowrap; }
.ecrc-table code { font: 500 12px var(--ec-mono); }
.ecrc-table tr.grp th { font: 800 13px var(--ec-cond); text-transform: uppercase; background: #fff; color: var(--ec-ink); padding-top: 14px; }
.ecrc-table tr.is-pedido td { background: #FBFBFC; }
.ecrc-table tfoot td { border-bottom: 0; font-weight: 600; }
.ecrc-table tfoot .tot { font: 800 24px var(--ec-cond); color: var(--ec-red); }
.ecrc-table tfoot .iva td { color: var(--ec-mute); font-weight: 500; padding-top: 0; }
.ecrc-st { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ecrc-st.is-ok { color: var(--ecrc-ok); }
.ecrc-st.is-no { color: var(--ec-mute); }
.ecrc-done { font-size: 13px; color: var(--ec-mute); margin: 8px 0 0; }
.ecrc-done a { color: var(--ec-red); font-weight: 600; text-decoration: underline; }
.ecrc-note--err { background: var(--ec-red-soft); color: var(--ec-ink); border-left: 3px solid var(--ec-red); }
.ecrc-note--err ul { margin: 6px 0 0; padding-left: 18px; }
.ecrc-note--err li { margin: 2px 0; }
.ecrc-sum [data-oferta] { margin-top: 8px; }
/* Paso 4: Atras y Anadir al carrito en una fila; la oferta, debajo a todo el ancho. */
.ecrc-nav { flex-wrap: wrap; }
.ecrc-nav [data-oferta] { order: 3; flex: 1 1 100%; }
/* Que la tabla del resumen no ensanche la columna (scroll dentro de la tabla). */
.ecrc-grid > * { min-width: 0; }
.ecrc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ecrc-sumbar { display: none; }

/* Por debajo de 1400 px el rack no tiene sitio con tres columnas: el resumen
   pasa a una barra fija abajo. */
@media (max-width: 1399px) {
  .ecrc-grid { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
  .ecrc-sum { display: none; }
  .ecrc-sumbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; box-shadow: 0 -6px 20px rgba(0,0,0,.08); padding: 10px 150px 10px 24px; gap: 20px; align-items: center; }
  /* 150 px a la derecha: ahí va el chat flotante (Smartsupp) y no debe tapar el botón. */
  .ecrc-sumbar .ecrc-ubar { flex: 1; max-width: 360px; margin: 0; }
  .ecrc-sumbar .t b { font: 800 26px/1 var(--ec-cond); color: var(--ec-red); }
  .ecrc-sumbar .t small { display: block; color: var(--ec-mute); font-size: 12px; }
  .ecrc { padding-bottom: 96px; }
  .ecrc-nav { bottom: 70px; }
  .ecrc-ancho { display: none; }
}
@media (max-width: 760px) {
  .ecrc { padding: 12px 16px 120px; }
  .ecrc-head h1 { font-size: 28px; }
  .ecrc-steps { overflow-x: auto; max-width: 100%; }
  .ecrc-step { flex: 0 0 auto; min-height: 44px; }
  .ecrc-grid { grid-template-columns: 1fr; }
  .ecrc-stage { position: relative; top: 0; height: auto; min-height: 0; max-height: none; order: -1; }
  .ecrc-draw { flex: none; min-height: 200px; }
  .ecrc input, .ecrc select { font-size: 16px; }
  .ecrc-mini { flex-wrap: wrap; }
  .ecrc-mini b { flex: 1 1 calc(100% - 68px); }
  .ecrc-mini .ecrc-btn { flex: 1 1 100%; }
  .ecrc-checks li { flex-wrap: wrap; }
  .ecrc-checks li > span:nth-child(2) { flex: 1 1 calc(100% - 32px); }
  .ecrc-checks li .ecrc-btn { margin-left: 32px; }
  .ecrc-pill, .ecrc-btn { min-height: 44px; }  .ecrc-gsearch input { font-size: 16px; }   /* 16 px: así iOS no hace zoom al escribir */
  .ecrc-hint { display: none; }
  .ecrc-qty button { width: 44px; height: 44px; }
  .ecrc-sumbar { flex-wrap: wrap; padding: 10px 16px; padding-right: 88px; gap: 10px; }
  .ecrc-sumbar .ecrc-ubar { display: none; }
  .ecrc-sumbar .ecrc-btn { flex: 1 1 100%; }
  /* En movil la oferta se descarga desde el resumen (paso 4). */
  .ecrc-sumbar [data-oferta] { display: none; }
  /* La barra de abajo ya lleva el boton principal: la de los pasos no se fija
     (fija, quedaba tapada por la barra, que en movil ocupa dos filas). */
  .ecrc-nav { position: static; }
  .ecrc-pop { width: calc(100% - 16px); left: 8px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ecrc { --ecrc-t: 0ms; }
  .dev.is-new, .ecrc-tip, .ecrc-pop { animation: none; }
}

/* Consulta de disponibilidad (lo que no entra en el carrito por stock) */
.ecrc-consulta { margin: 14px 0; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--ec-line); border-left: 3px solid var(--ec-red); }
.ecrc-consulta h3 { font: 800 18px var(--ec-cond); text-transform: uppercase; margin: 0 0 4px; color: var(--ec-ink); }
.ecrc-clista { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.ecrc-clista li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--ec-bg); font-size: 14px; }
.ecrc-clista li > span:first-child { flex: 1; min-width: 0; }
.ecrc-clista .ecrc-meta { display: block; }
.ecrc-cuds { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ec-mute); white-space: nowrap; }
.ecrc-cuds input { width: 76px; height: 36px; padding: 0 8px; border: 1px solid var(--ec-line); border-radius: 8px; font: inherit; color: var(--ec-ink); }
.ecrc-cfield { display: block; text-align: left; margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--ec-ink); }
.ecrc-cfield input, .ecrc-cfield textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--ec-line); border-radius: 8px; font: 400 15px var(--ec-font); color: var(--ec-ink); background: #fff; }
.ecrc-cfield input { height: 40px; }
.ecrc-crgpd { display: flex; text-align: left; align-items: center; gap: 8px; margin: 12px 0; font-size: 14px; }
.ecrc-crgpd a { color: var(--ec-red); text-decoration: underline; }
.ecrc-crgpd input { width: 18px; height: 18px; accent-color: var(--ec-red); }
.ecrc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 760px) {
  .ecrc-clista li { flex-wrap: wrap; }
  .ecrc-clista li > span:first-child { flex: 1 1 100%; }
  .ecrc-cuds input, .ecrc-cfield input { height: 44px; }
  .ecrc-cuds input, .ecrc-cfield input, .ecrc-cfield textarea { font-size: 16px; }
  .ecrc-consulta .ecrc-btn { width: 100%; }
  .ecrc textarea { font-size: 16px; }
}

/* Desplegables de puertas y montaje (paso 1) */
.ecrc-dds { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 12px; }
.ecrc-dd { flex: 0 1 auto; }
.ecrc-dd:has(.ecrc-dd-panel:not([hidden])) { flex-basis: 100%; }
.ecrc-dd-btn { display: inline-flex; align-items: center; gap: 8px; }
.ecrc-dd-val { font-weight: 500; color: var(--ec-mute); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecrc-dd-btn[aria-pressed="true"] .ecrc-dd-val { color: inherit; font-weight: 600; }
.ecrc-dd-btn svg { transition: transform var(--ecrc-t); }
.ecrc-dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.ecrc-dd-panel { margin-top: 8px; padding: 12px; background: var(--ec-bg); border-radius: var(--ec-r); grid-template-columns: 92px 1fr; }
.ecrc-dd-panel[hidden] { display: none; }
.ecrc-puertas { display: block; }
@media (max-width: 600px) {
  .ecrc-dd-btn { height: 44px; }
  .ecrc-dd-panel { grid-template-columns: 1fr; }
  .ecrc-dd-val { max-width: 150px; }
}
