/* Configurador inmersivo a pantalla completa, sin scroll de página */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.imm-section { padding-top: 16px; padding-bottom: 14px; box-sizing: border-box;
  height: calc(100vh - 71px); display: flex; flex-direction: column; }
.imm-section .container { max-width: 1560px; width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Cabecera mínima en una fila */
.imm-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.imm-head .badge-local { order: -1; }
.imm-head h1 { font-size: clamp(1.3rem, 2vw, 1.7rem); margin: 0; line-height: 1.1; }
.imm-head .section-lead { font-size: .9rem; margin: 0; color: var(--c-muted); }
@media (max-width: 720px){ .imm-head .section-lead { display: none; } }

/* ---- Barra de control: modalidad + precio + CTA ---- */
.imm-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--c-ink); color: #fff; border-radius: 14px; padding: 11px 18px; margin-bottom: 14px; }
.imm-bar .imm-modality { display: inline-flex; background: rgba(255,255,255,.1); border-radius: 10px; padding: 3px; }
.imm-bar .imm-modality button { border: 0; background: transparent; color: #d7d2f5; font-family: inherit; font-weight: 600; font-size: .84rem; padding: .45em .85em; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.imm-bar .imm-modality button.active { background: #fff; color: var(--c-primary-d); }
.imm-bar .imm-price { display: flex; align-items: baseline; gap: 7px; }
.imm-bar .imm-price .big { font-family: var(--font-head,inherit); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.imm-bar .imm-price .per { font-size: .8rem; color: #c9c4e6; }
.imm-bar .imm-meta { font-size: .78rem; color: #bcb6e0; line-height: 1.3; }
.imm-bar .imm-bar-cta { margin-left: auto; display: flex; gap: 10px; }
.imm-bar .imm-bar-cta .btn-primary { background: var(--c-primary); }
.imm-bar .imm-bar-cta .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.imm-bar .imm-bar-cta .btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ---- Layout a pantalla completa ---- */
.imm-head, .imm-bar { flex: none; }
.imm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr); gap: 20px; align-items: stretch;
  flex: 1; min-height: 0; transition: grid-template-columns .25s ease; }

/* Demo (izquierda, grande, llena el alto) */
.imm-demo { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.imm-demo-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.imm-demo-cap-l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.imm-demo-cap b { font-size: .95rem; }
.imm-demo-cap .muted { font-size: .8rem; }
/* Saliente negro a toda la altura para plegar/desplegar el panel de módulos */
.imm-handle { position: absolute; left: 0; top: 0; bottom: 0; width: 18px; border: 0; cursor: pointer; padding: 0;
  background: var(--c-ink); border-radius: 13px 0 0 13px; color: #fff;
  display: flex; align-items: center; justify-content: center; transition: background .15s; }
.imm-handle:hover { background: var(--c-primary); }
/* tres puntitos de "agarre" sobre el chevron, para que se lea como tirador */
.imm-handle svg { transition: transform .2s; opacity: .9; }
.imm-handle:hover svg { opacity: 1; }

/* Estado: panel de módulos plegado → la demo ocupa todo el ancho, el tirador se queda */
.imm-wrap.cfg-hidden { grid-template-columns: minmax(0, 1fr) 18px; }
.imm-wrap.cfg-hidden .imm-config { padding-left: 0; border: 0; background: transparent; box-shadow: none; }
.imm-wrap.cfg-hidden .imm-config-scroll { display: none; }
.imm-wrap.cfg-hidden .imm-handle svg { transform: rotate(180deg); }
.imm-wrap.cfg-hidden .imm-handle { border-radius: 11px; }
.imm-demo-frame { flex: 1; min-height: 0; border: 1px solid var(--c-line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--c-bg); }
.imm-demo-frame #erp-root, .imm-demo-frame .erp-shell { height: 100%; min-height: 0; }
.imm-demo-frame .demo-banner { display: none; }
.imm-demo-frame .btn-reset { display: none; }
.imm-demo-frame .erp-top { height: 50px; }
.imm-demo-frame .erp-top .co small { display: none; }
.imm-demo-frame .erp-main { padding: 16px; }

/* Configuración (derecha, scroll interno), panel con borde igual que la demo */
.imm-config { position: relative; min-width: 0; display: flex; flex-direction: column; min-height: 0;
  border: 1px solid var(--c-line); border-radius: 14px; background: var(--c-bg); box-shadow: var(--shadow-sm);
  padding: 14px 12px 14px 26px; overflow: hidden; }
.imm-config-scroll { overflow-y: auto; padding-right: 6px; padding-left: 2px; flex: 1; min-height: 0; }
.imm-cap { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); font-weight: 700; margin: 0 0 8px; }
.imm-config-scroll .imm-cap:not(:first-child) { margin-top: 16px; }

.imm-base-mini { display: flex; align-items: center; gap: 11px; background: var(--c-primary-l); border: 1px solid var(--c-primary); border-radius: 11px; padding: 10px 12px; }
.imm-base-mini b { font-size: .88rem; }
.imm-base-mini .sw-lock { width: 38px; height: 22px; border-radius: 999px; background: var(--c-primary); position: relative; flex: 0 0 auto; }
.imm-base-mini .sw-lock::after { content: ""; position: absolute; top: 2px; left: 18px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }

/* Interruptores compactos */
.imm-switches { display: flex; flex-direction: column; gap: 8px; }
.imm-switch { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--c-line); border-radius: 11px; padding: 9px 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.imm-switch:hover { border-color: var(--c-primary); }
.imm-switch.on { border-color: var(--c-primary); background: #f6f3ff; }
.imm-switch.disabled { opacity: .5; cursor: not-allowed; }
.imm-switch .sw { width: 38px; height: 22px; border-radius: 999px; background: #d3d3dd; position: relative; flex: 0 0 auto; transition: background .2s; }
.imm-switch.on .sw { background: var(--c-primary); }
.imm-switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.imm-switch.on .sw::after { transform: translateX(16px); }
.imm-switch .nm { flex: 1; min-width: 0; }
.imm-switch .nm b { font-size: .88rem; font-weight: 650; color: var(--c-ink); display: inline; }
.imm-switch .nm .tagdone, .imm-switch .nm .tagrec { margin-left: 6px; }
.imm-switch .pr { display: block; margin-top: 3px; font-size: .78rem; font-weight: 700; color: var(--c-primary-d); }
.imm-switch.disabled .pr { color: var(--c-muted); font-weight: 600; }
.tagdone { font-size: .58rem; font-weight: 800; letter-spacing: .03em; background: var(--c-ok-bg); color: var(--c-ok); padding: .12em .45em; border-radius: 999px; white-space: nowrap; display: inline-block; }
.tagrec { font-size: .58rem; font-weight: 800; letter-spacing: .03em; background: #fff4e0; color: var(--c-accent-d); padding: .12em .45em; border-radius: 999px; white-space: nowrap; display: inline-block; }

.imm-foot-note { font-size: .74rem; color: var(--c-muted); margin: 12px 0 0; }

.ok-check { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: var(--c-primary-l); color: var(--c-primary); display: grid; place-items: center; }

/* Pantalla completa: la app llena la ventana y no hay scroll de página.
   El footer se oculta aquí (es una herramienta, no una página de marketing). */
html, body { height: 100%; }
body { overflow: hidden; }
.site-footer { display: none; }

/* ---- Móvil / tablet: flujo normal, la página scrollea ---- */
@media (max-width: 980px){
  html, body { height: auto; }
  body { overflow: visible; }
  .site-footer { display: block; }
  .imm-section { height: auto; display: block; }
  .imm-section .container { max-width: 100%; display: block; }
  .imm-wrap { grid-template-columns: 1fr; flex: none; min-height: 0; }
  .imm-demo { order: 2; }
  .imm-demo-frame { height: 560px; flex: none; }
  .imm-config { order: 1; padding-left: 0; overflow: visible; }
  .imm-handle { display: none; }
  .imm-config-scroll { overflow: visible; padding-right: 0; }
}
@media (max-width: 540px){
  .imm-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .imm-bar .imm-modality { width: 100%; }
  .imm-bar .imm-modality button { flex: 1; text-align: center; }
  .imm-bar .imm-bar-cta { flex-direction: column; margin-left: 0; }
  .imm-bar .imm-bar-cta .btn { width: 100%; }
}
