/* assets/css/style.css */

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-page: #f5f6fb;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: #e0f2fe;
  --primary-dark: #1d4ed8;
  --accent: #22c55e;
  --accent-soft: #dcfce7;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --border-soft: #e5e7eb;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.15s ease-out;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-page);
}

/* TOPBAR */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0f172a;
  color: #e5e7eb;
  padding: 10px 0;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.03em;
}

.logo span {
  color: #38bdf8;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  min-width: 260px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  font-size: 13px;
}

.top-link {
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
}

.top-cta {
  border-radius: 999px;
  border: 1px solid #38bdf8;
  background: transparent;
  color: #e0f2fe;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

/* LAYOUT */

.page {
  padding: 20px 0 30px;
}

.page-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 16px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* COLUMNA IZQUIERDA */

.mode-switch {
  display: inline-flex;
  background: #e5e7eb;
  border-radius: 999px;
  padding: 3px;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: #4b5563;
}

.mode-btn-active {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  color: #111827;
}

.brand-phase {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-select,
.phase-select {
  display: flex;
  gap: 8px;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #f9fafb;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.chip-outline {
  background: #ffffff;
}

.chip-primary {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.chip-primary:hover {
  background: #bfdbfe;
}

/* CARDS GENERALES */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.03);
  padding: 14px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
  margin: 0;
  font-size: 15px;
}

.muted {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.modules-counter {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark);
}

/* LISTA MÓDULOS IZQUIERDA */

.module-group {
  margin-top: 8px;
}

.module-group-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.module-group-list {
  border-radius: var(--radius-md);
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  max-height: 260px;
  overflow: auto;
}

.module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: grab;
}

.module-item:last-child {
  border-bottom: none;
}

.module-item:active {
  cursor: grabbing;
}

.module-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-thumb {
  width: 30px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #6b7280;
  overflow: hidden;
}

.module-thumb img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.module-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-family {
  font-size: 11px;
  color: #9ca3af;
}

.module-label {
  font-size: 12px;
  font-weight: 600;
}

.module-meta {
  font-size: 11px;
  color: #6b7280;
}

.module-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  width: 26px;
  height: 26px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* BOTONES */

.btn-primary {
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.btn-full {
  width: 100%;
}

.btn-small {
  font-size: 11px;
  padding: 5px 10px;
}

/* BOARD CENTRAL */

.center-top-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}





.card-board-header h1 {
  margin: 0;
  font-size: 18px;
}

.board-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius-md);
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 10px;
}


/* --- REGLA / COTAS DEL TABLERO --- */

.board-dims {
  margin: 4px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.board-dims-info {
  color: var(--text-muted);
}

.board-dims-ruler {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  /* nº de módulos, lo rellenamos desde JS */
  --modules: 12;
}

/* rayitas verticales espaciadas en función de los módulos */
.board-dims-ruler::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    #9ca3af 0,
    #9ca3af 1px,
    transparent 1px,
    transparent calc(100% / var(--modules))
  );
  opacity: 0.8;
}

.board-dims-label-left,
.board-dims-label-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: #4b5563;
  padding: 0 3px;
  background: #f3f4f6cc;
}

.board-dims-label-left {
  left: 3px;
}

.board-dims-label-right {
  right: 3px;
}


.board-image-wrap {
  max-width: 520px;
  margin: 0 auto 8px;
}

.board-image-wrap img {
  width: 100%;
  display: block;
  border-radius: 8px;
}



.board-row {
  display: grid;
  gap: 4px;
}

.board-slot {
  height: 36px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #e5e7eb;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  color: #111827;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.06s ease-out;
  cursor: pointer;
}

.board-slot-empty {
  background: #f3f4f6;
  color: #9ca3af;
  font-style: italic;
}

.board-slot.drag-over {
  border-color: var(--primary);
  background: #dbeafe;
  transform: scale(1.03);
}

/* colores por categoría */

.board-slot-used[data-category="mcb"] {
  background: #f97316;
  color: #fff7ed;
  border-color: #ea580c;
}

.board-slot-used[data-category="rcd"] {
  background: #22c55e;
  color: #ecfdf3;
  border-color: #16a34a;
}

.board-slot-used[data-category="main"] {
  background: #1d4ed8;
  color: #eff6ff;
  border-color: #1d4ed8;
}

.board-slot-used[data-category="other"] {
  background: #6b7280;
  color: #f9fafb;
  border-color: #4b5563;
}

.card-board-footer {
  margin-top: 8px;
  font-size: 11px;
}

/* --- BLOQUE FILAS + ESCALA VERTICAL --- */

.board-rows-area {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 4px;
}

/* Regla vertical de altura */
.board-vert-scale {
  width: 28px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  position: relative;
  /* nº de filas, se rellena desde JS */
  --rows: 3;
  overflow: hidden;
}

/* Rayas horizontales por fila */
.board-vert-scale::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    #9ca3af 0,
    #9ca3af 1px,
    transparent 1px,
    transparent calc(100% / var(--rows))
  );
  opacity: 0.8;
}

.board-vert-label-top,
.board-vert-label-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #4b5563;
  padding: 0 3px;
  background: #f3f4f6cc;
  text-align: center;
  white-space: nowrap;
}

.board-vert-label-top {
  top: 2px;
}

.board-vert-label-bottom {
  bottom: 2px;
}

/* Ajuste para que las filas se alineen con la regla */
.board-rows-wrap {
  flex: 1;
}

/* VISTA TÉCNICA (SVG A ESCALA) */

.tech-view {
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed #d1d5db;
  background: #f3f4f6;
}

.tech-view-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tech-view svg {
  width: 100%;
  max-width: 620px;
  display: block;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}


/* POPUP VARIANTES (ABAJO FIJO) */

.module-popup {
  position: fixed;
  z-index: 50;
  display: none;
}


.module-popup-inner {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  border: 1px solid #e5e7eb;
  min-width: 260px;
  max-width: 360px;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.module-popup-header {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.module-popup-title {
  font-size: 13px;
  font-weight: 600;
}

.module-popup-current {
  font-size: 11px;
  color: var(--text-muted);
}

.icon-btn-small {
  width: 22px;
  height: 22px;
  font-size: 11px;
  padding: 0;
}

.module-popup-body {
  padding: 4px 0;
  overflow: auto;
}

.popup-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  border-top: 1px solid #f3f4f6;
  cursor: pointer;
}

.popup-option:hover {
  background: #f3f4f6;
}

.popup-option.selected {
  background: #e0f2fe;
}

.popup-option-radio {
  flex-shrink: 0;
}

.popup-option-radio input {
  width: 14px;
  height: 14px;
}

.popup-option-text-main {
  font-weight: 500;
}

.popup-option-text-sub {
  font-size: 11px;
  color: #6b7280;
}

.module-popup-footer {
  padding: 6px 10px 8px;
  border-top: 1px solid #e5e7eb;
}

/* COLUMNA DERECHA */

.card-price {
  padding: 14px;
}

.price-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.price-big {
  font-size: 22px;
  font-weight: 700;
}

.price-small {
  font-size: 11px;
  color: var(--text-muted);
}

.price-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.price-badge {
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 11px;
}

.price-badge-green {
  background: var(--accent-soft);
  color: #166534;
}

.price-badge-amber {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.order-notes {
  width: 100%;
  min-height: 60px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  font-size: 12px;
  resize: vertical;
  margin-bottom: 8px;
}

.order-footer {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qty-picker {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  overflow: hidden;
}

.qty-btn {
  border: none;
  background: #f3f4f6;
  width: 26px;
  height: 26px;
  font-size: 16px;
  cursor: pointer;
}

#qty-input {
  width: 38px;
  border: none;
  text-align: center;
  font-size: 13px;
}

.card-bom {
  padding: 12px;
}

.card-header-simple h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.bom-body {
  max-height: 260px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 11px;
}

.bom-item {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.bom-item:last-child {
  border-bottom: none;
}

.bom-footer {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.bom-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bom-note::before {
  content: "✔";
  color: var(--accent);
}

/* MODAL CAMBIAR TAMAÑO */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  background: #ffffff;
  border-radius: 20px;
  width: 720px;
  max-width: calc(100% - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.modal-header {
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

.modal-tab {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  font-size: 12px;
  border: none;
  background: #f9fafb;
  cursor: pointer;
}

.modal-tab-active {
  background: #ffffff;
  border-bottom: 2px solid var(--primary);
  color: var(--primary-dark);
}

.modal-body {
  padding: 6px 0 8px;
  overflow: auto;
}

.size-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
  cursor: pointer;
}

.size-row:hover {
  background: #f3f4f6;
}

.size-row.selected {
  background: #e0f2fe;
}

.size-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.size-radio input {
  width: 14px;
  height: 14px;
}

.size-thumb {
  width: 40px;
  height: 60px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #6b7280;
  overflow: hidden;
}

.size-thumb img {
  width: 100%;
  display: block;
}

.size-text-main {
  font-weight: 600;
}

.size-text-sub {
  font-size: 11px;
  color: #6b7280;
}

.size-right {
  text-align: right;
  font-size: 12px;
  min-width: 120px;
}

.size-right strong {
  color: #16a34a;
}

/* RESPONSIVE */

@media (max-width: 1040px) {
  .page-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  }

  .col-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .page-inner {
    grid-template-columns: 1fr;
  }

  .col-right {
    grid-template-columns: 1fr;
  }

 
  .modal {
    width: 100%;
    max-width: calc(100% - 20px);
  }
}

/* --- Tarjeta del cuadro: layout básico --- */







/* imagen del armario (si la usas) */
.board-image-wrap {
  display: none; /* JS la muestra si hay imagen */
  max-width: 260px;
}
.board-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- REGLA HORIZONTAL --- */

.board-dims {
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.board-dims-info {
  color: var(--text-muted, #6b7280);
}

.board-dims-ruler {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  --modules: 12; /* JS lo sobrescribe */
}

.board-dims-ruler::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    #9ca3af 0,
    #9ca3af 1px,
    transparent 1px,
    transparent calc(100% / var(--modules))
  );
  opacity: 0.8;
}

.board-dims-label-left,
.board-dims-label-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: #4b5563;
  padding: 0 3px;
  background: #f3f4f6cc;
}

.board-dims-label-left {
  left: 3px;
}
.board-dims-label-right {
  right: 3px;
}

/* --- BLOQUE FILAS + ESCALA VERTICAL --- */

.board-rows-area {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 4px;
}


/* regla vertical de altura */
.board-vert-scale {
  width: 28px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  position: relative;
  --rows: 3; /* JS lo sobrescribe */
  overflow: hidden;
}

.board-vert-scale::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    #9ca3af 0,
    #9ca3af 1px,
    transparent 1px,
    transparent calc(100% / var(--rows))
  );
  opacity: 0.8;
}

.board-vert-label-top,
.board-vert-label-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #4b5563;
  padding: 0 3px;
  background: #f3f4f6cc;
  text-align: center;
  white-space: nowrap;
}

.board-vert-label-top {
  top: 2px;
}
.board-vert-label-bottom {
  bottom: 2px;
}


/* --- Solo mostrar la vista técnica en el panel central --- */

/* Ocultar imagen del gabinete, regla horizontal y filas de slots */
.board-image-wrap,
.board-dims,
.board-rows-area {
  display: none !important;
}

/* (Opcional) Ocultar el resumen de módulos debajo del cuadro */
.card-board-footer {
  display: none !important;
}

/* Selector de marca en la cabecera izquierda */

.brand-select-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.brand-select-box label {
  font-size: 11px;
  color: var(--text-muted);
}

.brand-select-box select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 10px;
  font-size: 12px;
  background: #ffffff;
  outline: none;
}

/* Layout marca + gama + fase */
.brand-phase {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.brand-phase .brand-select-box {
  flex: 1;
}

.brand-phase .phase-select {
  display: flex;
  gap: 6px;
}

.template-select-box{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.template-select-box label{
  font-size:12px;
  color:#6b7280;
}

.template-select-row{
  display:flex;
  gap:8px;
  align-items:center;
}

.template-select-row select{
  flex:1;
  border-radius:999px;
  border:1px solid #e5e7eb;
  padding:6px 10px;
  font-size:13px;
}

.template-select-row .btn-secondary{
  white-space:nowrap;
  padding-inline:14px;
}


/* Desactivar selección de texto en la vista técnica */
#tech-view,
#tech-view svg,
#tech-view svg text,
#tech-view svg tspan {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.modules-search-box{
  margin-bottom: 10px;
}

.modules-search-box input{
  width: 100%;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
}

.modules-search-box input:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37,99,235,0.15);
}

.order-actions{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
}
.order-actions .btn-primary{
  padding-inline:18px;
}

/* -------------------------------------------------------
 * RETOQUE VISUAL CONFIGURADOR ELECCONFIG
 * (añadir al final de assets/css/style.css)
 * -----------------------------------------------------*/

/* Fondo general + tipografía más limpia */
body {
  background: radial-gradient(circle at top left, #e0f2fe 0, #f9fafb 45%, #f3f4f6 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
}

/* Contenedor principal (3 columnas) */
.main-layout {
  max-width: 1440px;
  margin: 18px auto 26px;
  padding: 0 18px;
}

/* Tarjetas generales */
.card,
.summary-card {
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #ffffff;
}

/* Topbar (modo simple / diseño propio / etc.) */
.topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Pestañas de modo */
.mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: #e5e7eb;
}

.mode-tab {
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  border: none;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.mode-tab-active {
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}

/* Selector de marca / gama / fase */
.config-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.config-header-row .chip,
.chip-primary {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chip-primary {
  background: #111827;
  color: #e5e7eb;
  border-color: #111827;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.4);
}

/* Panel izquierdo – lista de módulos */
.modules-panel {
  background: #ffffff;
  border-radius: 20px;
  padding: 12px 10px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.modules-panel-header {
  padding: 4px 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

.modules-panel-title {
  font-size: 14px;
  font-weight: 600;
}

/* Buscador de módulos */
.modules-search input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

/* Scroll agradable en lista de módulos */
#modules-groups {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 4px;
}

#modules-groups::-webkit-scrollbar {
  width: 6px;
}
#modules-groups::-webkit-scrollbar-track {
  background: transparent;
}
#modules-groups::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 999px;
}

/* Grupo de módulos */
.module-group {
  margin-bottom: 10px;
}

.module-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7280;
  margin: 6px 0 4px;
}

/* Item de módulo (izquierda) */
.module-item {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 6px 7px;
  margin-bottom: 4px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

.module-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  box-shadow: 0 8px 18px rgba(129, 140, 248, 0.35);
  transform: translateY(-1px);
}

.module-main {
  display: flex;
  gap: 6px;
  align-items: center;
}

.module-thumb {
  width: 34px;
  height: 60px;
  border-radius: 9px;
  overflow: hidden;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.module-family {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
}

.module-label {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.module-meta {
  font-size: 11px;
  color: #6b7280;
}

.module-actions .btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #f9fafb;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.module-actions .btn-icon:hover {
  transform: translateY(-1px) scale(1.03);
  background: #0f172a;
}

/* Panel central – tablero + vista técnica */
.board-visual {
  border-radius: 24px;
  background: linear-gradient(145deg, #f9fafb, #eef2ff);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  padding: 14px 12px 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

#tech-view {
  margin-top: 8px;
}

/* Encabezado de dimensiones */
.board-dims {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #4b5563;
}

/* Escala vertical a la izquierda del tablero (si existe) */
.board-vert-scale {
  --rows: 3;
  position: relative;
}
.board-vert-scale::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, #d1d5db 0, #9ca3af 100%);
  opacity: 0.6;
}

/* Celdas del tablero textual (debajo de la vista técnica) */
.board-row {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.board-slot {
  min-height: 30px;
  border-radius: 9px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.board-slot-empty {
  background: rgba(255, 255, 255, 0.7);
}

.board-slot-used {
  border-style: solid;
  border-color: #1f2937;
  background: #111827;
  color: #e5e7eb;
  font-weight: 500;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.55);
}

.board-slot.drag-over {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

/* SVG – que se note más el módulo sobre el fondo */
#tech-view svg {
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35),
              0 18px 40px rgba(15, 23, 42, 0.25);
}

/* Popup variantes */
#module-popup {
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.popup-option {
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: background 0.12s ease;
}
.popup-option:hover {
  background: #eef2ff;
}
.popup-option.selected {
  background: #111827;
  color: #f9fafb;
}

/* Panel derecho – resumen + Rexel */
.summary-card {
  position: sticky;
  top: 18px;
}

.summary-header {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

#price-total {
  font-size: 22px;
  font-weight: 700;
}

#price-total-vat {
  font-size: 12px;
  color: #4b5563;
}

.summary-line-cta {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  font-size: 11px;
  color: #166534;
}

/* Lista BOM */
.bom-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed #e5e7eb;
}
.bom-item:last-child {
  border-bottom: none;
}

/* Exportar a Rexel */
.rexel-box textarea,
#rexel-export {
  width: 100%;
  min-height: 72px;
  border-radius: 14px;
  border: 1px dashed #94a3b8;
  background: #f9fafb;
  padding: 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Botones principales */
.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

.btn-primary {
  background: #16a34a;
  color: #f9fafb;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.55);
}
.btn-primary:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #111827;
  color: #e5e7eb;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.55);
}
.btn-secondary:hover {
  background: #020617;
  transform: translateY(-1px);
}

/* Pequeño pulido en mobile */
@media (max-width: 1024px) {
  .main-layout {
    padding: 0 8px;
  }
  .summary-card {
    position: static;
    margin-top: 12px;
  }
  #modules-groups {
    max-height: none;
  }
}
/* ==== OVERRIDES VISUALES ==== */

/* Panel de módulos en azul claro */
.modules-panel {
  background: #eef6ff;                  /* azul muy claro */
  border-radius: 20px;
  padding: 12px 10px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
  border: 1px solid rgba(147, 197, 253, 0.8); /* borde azul */
}

/* Botón secundario (nada de negro) */
.btn-secondary {
  background: #3b82f6;                  /* azul principal */
  color: #ffffff;
  border: none;
  box-shadow: 0 12px 26px rgba(59, 130, 246, 0.45);
}
.btn-secondary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Botón redondo de cada módulo (el + de arrastrar) sin negro */
.module-actions .btn-icon {
  background: #3b82f6;
  color: #f9fafb;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.45);
}
.module-actions .btn-icon:hover {
  background: #2563eb;
}

/* Opcional: pestaña activa y chip “primario” también en azul */
.mode-tab-active {
  background: #3b82f6;
  color: #f9fafb;
  box-shadow: 0 7px 18px rgba(59, 130, 246, 0.45);
}

.chip-primary {
  background: #3b82f6;
  color: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45);
}

/* --- TOPBAR AZUL OSCURO --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0f172a;               /* azul oscuro pleno */
  color: #e5e7eb;
  padding: 8px 0;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
  border-radius: 0;
  border: none;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.03em;
  color: #f9fafb;
}
.logo span {
  color: #38bdf8;
}

/* Contenedor general de filtros de la izquierda */
.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Caja de cada filtro (Marca / Gama) */
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.filter-field label {
  color: #e5e7eb;            /* texto claro sobre barra azul o fondo azul claro */
}

/* Selects de filtros */
.filter-field select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  font-size: 13px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.filter-field select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* Botones 1 fase / Trifásico */
.phase-select {
  display: flex;
  gap: 8px;
}

.phase-select .chip {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  padding: 6px 12px;
  font-size: 12px;
}

.phase-select .chip-active {
  background: #2563eb;
  color: #f9fafb;
  border-color: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

/* === BLOQUE FILTROS IZQUIERDA (Marca / Gama / Fase) === */

.brand-phase {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, #e0f2fe, #f5f6ff);
  border: 1px solid #bfdbfe;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-select-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.brand-select-box label {
  font-size: 11px;
  color: #4b5563;
}

.brand-select-box select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  font-size: 13px;
  background: #ffffff;
  color: #111827;
  outline: none;
  appearance: none;
}

.brand-select-box select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* Botones 1 fase / Trifásico como pills claros */

.phase-select {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.phase-select .chip {
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  background: #ffffff;
  color: #111827;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
              border-color 0.15s ease, transform 0.08s ease;
}

.phase-select .chip:hover {
  background: #e5edff;
}

.phase-select .chip-primary {
  background: #2563eb;
  color: #f9fafb;
  border-color: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

/* === PANEL DE MÓDULOS EN AZUL CLARO === */

.card-modules {
  background: linear-gradient(145deg, #eef2ff, #f9fafb);
  border-radius: 20px;
  border: 1px solid #c7d2fe;
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.35);
}

/* Cabecera módulos un poco más marcada */
.card-modules .card-header {
  border-bottom: 1px solid #d1d5fe;
}

/* Contador de módulos en azul suave */
.modules-counter {
  background: #e0f2fe;
  color: #1d4ed8;
}

/* === BOTONES DE ACCIÓN (QUITAR NEGRO, PASAR A AZUL) === */

.module-actions .btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: #2563eb;          /* azul, no negro */
  color: #f9fafb;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
  transition: background 0.12s ease, box-shadow 0.12s ease,
              transform 0.08s ease;
}

.module-actions .btn-icon:hover {
  background: #1d4ed8;
  transform: translateY(-1px) scale(1.03);
}

/* Buscador de módulos integrado con el panel azul */
.modules-search-box input {
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #ffffff;
}
.modules-search-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}
/* === BLOQUE FILTROS IZQUIERDA A TODO ANCHO === */

.brand-phase {
  width: 100%;
  box-sizing: border-box;

  padding: 18px 20px;
  margin-bottom: 18px;

  border-radius: 18px;
  background: linear-gradient(145deg, #e0f2fe, #f5faff);
  border: 1px solid #bfdbfe;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cada fila (Marca / Gama / Fase) a ancho completo */
.brand-phase .brand-select-box,
.brand-phase .phase-select {
  width: 100%;
}

/* selects anchos */
.brand-phase select {
  width: 100%;
  box-sizing: border-box;
}

/* fase: botones alineados anchos */
.phase-select {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
}

.phase-select .chip {
  flex: 1;                        /* ← cada botón ocupa el mismo ancho */
  text-align: center;
  padding: 8px 0;
}

/* ==== POPUP UNIFILAR SIMPLE ================================= */

.unifilar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;              /* se muestra con JS */
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.unifilar-modal {
  background: #ffffff;
  border-radius: 20px;
  width: 820px;
  max-width: calc(100% - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
  padding: 16px 18px 12px;
}

.unifilar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.unifilar-header h2 {
  margin: 0;
  font-size: 16px;
}

.unifilar-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.unifilar-body {
  flex: 1;
  overflow: auto;
  padding: 8px 0 6px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

/* cada línea del unifilar */
.unifilar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 4px 0;
}

/* “bloque” DIN */
.unifilar-block {
  width: 34px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid #111827;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
  flex-shrink: 0;
}

/* barra horizontal de circuito (simple) */
.unifilar-bar {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, #9ca3af 0, #6b7280 100%);
}

/* texto circuito */
.unifilar-text {
  min-width: 220px;
  font-size: 12px;
  color: #111827;
}

.unifilar-text strong {
  margin-right: 4px;
}

/* footer */
.unifilar-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* botón cerrar en el popup */
.unifilar-footer .btn-small {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
}

/* Botoncito nuevo debajo de Rexel */
.unifilar-actions {
  margin-top: 10px;
}

/* PRINT: solo imprimir el unifilar --------------------------- */
@media print {
  body * {
    visibility: hidden;
  }
  #unifilar-modal,
  #unifilar-modal * {
    visibility: visible;
  }
  #unifilar-modal {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
}


/* ===== UNIFILAR POPUP ===== */

.unifilar-modal-body {
  padding: 10px 16px 14px;
}

.unifilar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Fila base */
.unifilar-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 140px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-size: 12px;
}

.unifilar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.unifilar-block {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid #111827;
}

.unifilar-bar {
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: #111827;
}

.unifilar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.unifilar-circuit {
  font-weight: 600;
}

.unifilar-desc {
  font-size: 11px;
  color: #4b5563;
}

/* Selector de padre */
.unifilar-parent-select-wrap {
  font-size: 11px;
  display: flex;
  justify-content: flex-end;
}

.unifilar-parent-select-wrap label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.unifilar-parent-select-wrap span {
  color: #6b7280;
}

.unifilar-parent-select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 8px;
  font-size: 11px;
}

/* Estilo visual cuando tiene padre (hijo) */
.unifilar-row.unifilar-child {
  position: relative;
  margin-left: 18px;
}

.unifilar-row.unifilar-child::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #9ca3af, #4b5563);
  border-radius: 999px;
}

/* Marcar padre con barra un poco más gruesa */
.unifilar-row.unifilar-parent .unifilar-bar {
  height: 3px;
}

/* Pequeño texto del padre (opcional, usa data-parent-label si quieres mostrarlo) */
/* .unifilar-row.unifilar-child .unifilar-circuit::after {
  content: " ← " attr(data-parent-label);
  font-weight: 400;
  color: #6b7280;
  margin-left: 4px;
} */


/* Layout columna izquierda del unifilar */
.unifilar-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  margin-bottom: 6px;
}

.unifilar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Símbolo simple de disyuntor */
.unifilar-block {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #0f172a;
  position: relative;
  box-sizing: border-box;
}

/* diagonal = contacto/disyuntor abierto */
.unifilar-block::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  bottom: 3px;
  border-radius: 999px;
  border-top: 2px solid #0f172a;
  transform: rotate(-25deg);
}

/* barra de fase */
.unifilar-bar {
  height: 2px;
  width: 40px;
  border-radius: 999px;
  background: #0f172a;
}

/* texto */
.unifilar-circuit {
  font-size: 13px;
  font-weight: 600;
}
.unifilar-desc {
  font-size: 11px;
  color: #4b5563;
}

/* padre/hijo (la línea vertical ya la tienes) */
.unifilar-row.unifilar-child {
  position: relative;
  margin-left: 18px;
}
.unifilar-row.unifilar-child::before {
  content: "";
  position: absolute;
  left: -14px;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: #cbd5e1;
}


.unifilar-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  margin-bottom: 6px;

  /* escalera: desplazamiento por nivel */
  --level: 0;
  margin-left: calc(var(--level) * 26px);
}

.unifilar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* símbolo disyuntor */
.unifilar-block {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #0f172a;
  position: relative;
  box-sizing: border-box;
}
.unifilar-block::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  bottom: 3px;
  border-top: 2px solid #0f172a;
  transform: rotate(-25deg);
}

/* barra de fase */
.unifilar-bar {
  height: 2px;
  width: 40px;
  border-radius: 999px;
  background: #0f172a;
}

/* hijos: línea vertical de conexión */
.unifilar-row.unifilar-child {
  position: relative;
}

.unifilar-row.unifilar-child::before {
  content: "";
  position: absolute;
  left: -14px;        /* se desplaza con el margen del nivel */
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: #cbd5e1;
}

.unifilar-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  margin-bottom: 6px;

  /* escalera clara y evidente */
  --level: 0;
  margin-left: calc(var(--level) * 55px);
}

/* línea vertical para hijos */
.unifilar-row.unifilar-child {
  position: relative;
}

.unifilar-row.unifilar-child::before {
  content: "";
  position: absolute;
  left: -30px;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: #cbd5e1;
}

.unifilar-row {
  margin-left: calc(var(--level) * 40px);
}


/* ===========================
   UNIFILAR – VISTA EN ESCALERA
   =========================== */

.unifilar-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 10px 14px;
  margin-bottom: 6px;

  /* AQUÍ VA LA MAGIA DEL NIVEL */
  margin-left: calc(var(--level, 0) * 32px) !important;

  border-radius: 14px;
  background: #f9fafb;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* bloque símbolo + barrita */
.unifilar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 70px;
}

.unifilar-symbol {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #0f172a;
  box-sizing: border-box;
}

.unifilar-bar {
  flex: 1;
  height: 2px;
  background: #0f172a;
  border-radius: 999px;
}

/* textos */
.unifilar-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.unifilar-circuit {
  font-size: 13px;
  font-weight: 600;
}

.unifilar-desc {
  font-size: 12px;
  color: #4b5563;
}

/* selector de padre a la derecha */
.unifilar-parent-select-wrap {
  min-width: 130px;
  font-size: 11px;
}

.unifilar-parent-select-wrap span {
  display: block;
  margin-bottom: 3px;
  color: #6b7280;
}

.unifilar-parent-select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 10px;
  font-size: 12px;
  background: #ffffff;
}

/* hijo: línea vertical de conexión con el padre */
.unifilar-row.unifilar-child::before {
  content: "";
  position: absolute;
  /* punto medio a la izquierda de la tarjeta */
  left: -16px;
  top: 0;
  bottom: 50%;
  width: 2px;
  background: #cbd5e1;
}

/* opcional: un pequeño nodo donde engancha */
.unifilar-row.unifilar-child::after {
  content: "";
  position: absolute;
  left: -17px;
  bottom: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #0f172a;
}


/* ==== DIAGRAMA UNIFILAR TIPO BARRA ==== */

.unifilar-diagram {
  margin-top: 18px;
  padding: 20px 18px 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  font-size: 11px;
}

/* barra superior */
.uni-bus {
  position: absolute;
  top: 18px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: #111827;
}

/* columnas (cada circuito) */
.uni-cols {
  display: flex;
  gap: 24px;
  margin-top: 26px;
}

.uni-col {
  position: relative;
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding-top: 8px;
}

/* línea vertical que baja de la barra */
.uni-vert-line {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 22px;
  background: #111827;
}

/* símbolo de “disyuntor/contacto” muy simple */
.uni-symbol {
  width: 26px;
  height: 26px;
  margin: 0 auto 4px;
  border-radius: 4px;
  border: 2px solid #111827;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uni-symbol-inner {
  display: block;
  width: 16px;
  height: 10px;
  border-left: 2px solid #111827;
  border-right: 2px solid #111827;
  border-bottom: 2px solid #111827;
  transform: skewX(-15deg);
}

/* textos debajo del símbolo */
.uni-col-label {
  font-weight: 600;
  margin-bottom: 2px;
}

.uni-col-desc {
  font-size: 10px;
  color: #4b5563;
}

/* ==== PRINT: para que el PDF parezca más un esquema ==== */

@media print {
  body {
    background: #ffffff;
  }

  /* solo el contenido del popup */
  .topbar,
  .page,
  .page-inner {
    display: none !important;
  }

  .unifilar-backdrop {
    position: static !important;
    background: #ffffff !important;
  }

  .unifilar-modal {
    position: static !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
  }

  /* ocultar botones y selects para el PDF */
  .unifilar-header button,
  .unifilar-footer,
  .unifilar-parent-select-wrap {
    display: none !important;
  }

  /* se puede dejar la lista o reducirla; aquí la dejamos fina */
  .unifilar-row {
    border: none;
    box-shadow: none;
    padding: 4px 0;
  }

  /* el diagrama de barra es lo importante en el PDF */
  .unifilar-diagram {
    margin-top: 24px;
    page-break-inside: avoid;
  }
}


/* =========================================
   UNIFILAR – POPUP + LISTA + DIAGRAMA BARRA
   ========================================= */

/* BACKDROP + MODAL */
.unifilar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;              /* se muestra con JS */
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.unifilar-modal {
  background: #ffffff;
  border-radius: 20px;
  width: 860px;
  max-width: calc(100% - 40px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
  padding: 16px 18px 12px;
}

.unifilar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.unifilar-header h2 {
  margin: 0;
  font-size: 16px;
}

.unifilar-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: #6b7280;
}

.unifilar-body {
  flex: 1;
  overflow: auto;
  padding: 10px 0 10px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unifilar-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* LISTA EN MODO “ESCALERA” */

#unifilar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* fila base */
.unifilar-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) 150px;
  gap: 10px;
  align-items: center;

  padding: 8px 10px;
  margin-bottom: 4px;

  /* nivel de escalera -> lo tocará JS via --level */
  margin-left: calc(var(--level, 0) * 32px);

  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  font-size: 12px;
}

.unifilar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* símbolo genérico de disyuntor */
.unifilar-block {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #0f172a;
  position: relative;
  box-sizing: border-box;
}

.unifilar-block::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  bottom: 3px;
  border-top: 2px solid #0f172a;
  transform: rotate(-25deg);
}

/* barrita de fase */
.unifilar-bar {
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: #0f172a;
}

.unifilar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.unifilar-circuit {
  font-size: 13px;
  font-weight: 600;
}

.unifilar-desc {
  font-size: 11px;
  color: #4b5563;
}

/* selector de padre */
.unifilar-parent-select-wrap {
  font-size: 11px;
  text-align: right;
}

.unifilar-parent-select-wrap label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.unifilar-parent-select-wrap span {
  color: #6b7280;
}

.unifilar-parent-select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 8px;
  font-size: 11px;
  background: #ffffff;
}

/* hijo: dibuja línea vertical hacia el padre */
.unifilar-row.unifilar-child::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 50%;
  width: 2px;
  background: #cbd5e1;
}

.unifilar-row.unifilar-child::after {
  content: "";
  position: absolute;
  left: -18px;
  bottom: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #0f172a;
}

/* ==== DIAGRAMA UNIFILAR TIPO BARRA (CON JERARQUÍA) ==== */

.unifilar-diagram {
  margin-top: 10px;
  padding: 18px 16px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  font-size: 11px;
}

/* barra superior */
.uni-bus {
  position: absolute;
  top: 18px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: #111827;
}

/* columnas = raíces */
.uni-cols {
  display: flex;
  gap: 28px;
  margin-top: 30px;
}

.uni-col {
  position: relative;
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding-top: 10px;
}

/* línea vertical que baja desde la barra */
.uni-vert-line {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: #111827;
}

/* cada aparato (raíz + hijos) */
.uni-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 18px;
}

/* símbolo genérico */
.uni-symbol {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 2px solid #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.uni-symbol-inner {
  display: block;
  width: 16px;
  height: 10px;
  border-left: 2px solid #111827;
  border-right: 2px solid #111827;
  border-bottom: 2px solid #111827;
  transform: skewX(-15deg);
}

/* textos debajo */
.uni-col-label {
  font-weight: 600;
  margin-bottom: 1px;
}

.uni-col-desc {
  font-size: 10px;
  color: #4b5563;
}

/* ==== PRINT – solo el unifilar en el PDF ==== */
@media print {
  body * {
    visibility: hidden;
  }
  #unifilar-modal,
  #unifilar-modal * {
    visibility: visible;
  }
  #unifilar-modal {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* ocultar botones y selects en el PDF */
  .unifilar-header button,
  .unifilar-footer,
  .unifilar-parent-select-wrap {
    display: none !important;
  }

  .unifilar-row {
    box-shadow: none;
    border: none;
    padding: 4px 0;
  }
}

/* ============================
   LAYOUT CONFIGURADOR MÓVIL
   ============================ */

/* Tablet y móvil: columnas en vertical */
@media (max-width: 900px) {

  .page {
    padding: 10px 0 20px;
  }

  .page-inner {
    max-width: 100%;
    margin: 0;
    padding: 0 10px;
    display: flex;           /* cambio grid -> flex para poder reordenar */
    flex-direction: column;
    gap: 12px;
  }

  /* ORDEN: 1º tablero, 2º módulos, 3º precio/BOM */
  .col-center { order: 1; }
  .col-left   { order: 2; }
  .col-right  { order: 3; }

  /* Tarjetas algo más compactas */
  .card {
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15,23,42,0.06);
  }


  .card-board-header h1 {
    font-size: 16px;
  }

  /* Plantillas: select y botón apilados en pantallas estrechas */
  .template-select-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .template-select-row select {
    flex: 1 1 100%;
  }
  .template-select-row .btn-secondary {
    flex: 1 1 100%;
    justify-content: center;
  }

  /* Panel filtros (marca / gama / fase) a ancho completo y más compacto */
  .brand-phase {
    padding: 10px 12px;
    margin-bottom: 10px;
    gap: 10px;
  }

  /* Lista de módulos: altura limitada para que no se coma toda la pantalla */
  .module-group-list {
    max-height: 220px;
  }

  /* Panel de módulos en general */
  .card-modules {
    margin-top: 0;
  }

  /* Panel derecho (precio + BOM) debajo, sin sticky */
  .card-price,
  .card-bom {
    padding: 12px;
  }

  .price-main {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }

  .price-big {
    font-size: 18px;
  }

  .bom-body {
    max-height: 220px;
  }

  /* Notas / textarea más bajas */
  .order-notes {
    min-height: 50px;
  }

  /* Footer pedido: botones ocupan todo el ancho si hace falta */
  .order-footer {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .qty-picker {
    order: 1;
  }
  .order-actions {
    order: 2;
    width: 100%;
    justify-content: flex-end;
  }
  .order-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Vista técnica: que use bien el ancho en móvil */
  .tech-view {
    padding: 6px;
  }
  #tech-view svg {
    max-width: 100%;
  }
}

/* Móviles pequeños: aún más compacto */
@media (max-width: 600px) {
  .modules-counter {
    font-size: 11px;
    padding: 3px 6px;
  }

  .module-item {
    padding: 6px 7px;
  }

  .module-thumb {
    width: 28px;
    height: 50px;
  }

  .card-board-header h1 {
    font-size: 15px;
  }

  .board-visual {
    padding: 10px;
  }

  .brand-phase select {
    font-size: 12px;
    padding: 5px 10px;
  }
}

.config-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.config-modal-backdrop.active {
  display: flex !important;
}

.config-modal {
  background: #fff;
  border-radius: 14px;
  width: 420px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.config-modal-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.config-modal-body {
  font-size: 14px;
}

.config-modal-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.addcart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.addcart-backdrop.active {
  display: flex;
}

.addcart-modal {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 20px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 18px 45px rgba(15,23,42,0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.addcart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

.addcart-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}

.addcart-body {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.addcart-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.addcart-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f4f6;
}

.addcart-details h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.addcart-details div {
  font-size: 12px;
  color: #6b7280;
}

.addcart-price {
  font-weight: 600;
  font-size: 15px;
}

.addcart-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* OFFCANVAS CARRITO */
.cart-pill {
  border:none;
  background:#fff;
  cursor:pointer;
}

.cart-offcanvas {
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:1500;
}

.cart-offcanvas.open {
  pointer-events:auto;
}

.cart-offcanvas-backdrop {
  position:absolute;
  inset:0;
  background:rgba(15,23,42,0.35);
  opacity:0;
  transition:opacity .15s ease-out;
}

.cart-offcanvas-panel {
  position:absolute;
  top:0;
  right:0;
  width:360px;
  max-width:100%;
  height:100%;
  background:#ffffff;
  box-shadow:-10px 0 30px rgba(15,23,42,0.25);
  transform:translateX(100%);
  transition:transform .2s ease-out;
  display:flex;
  flex-direction:column;
  padding:16px 18px;
}

.cart-offcanvas.open .cart-offcanvas-backdrop {
  opacity:1;
}

.cart-offcanvas.open .cart-offcanvas-panel {
  transform:translateX(0);
}

.cart-offcanvas-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
  margin-bottom:12px;
}

.cart-offcanvas-title {
  font-size:18px;
  font-weight:700;
}

.cart-offcanvas-sub {
  font-size:12px;
  color:#6b7280;
}

.cart-offcanvas-close {
  border:none;
  background:transparent;
  font-size:18px;
  cursor:pointer;
}

.cart-offcanvas-body {
  font-size:13px;
  color:#111827;
}

.cart-offcanvas-text {
  margin:0 0 14px;
}

.cart-offcanvas-mini {
  margin-top:8px;
  font-size:11px;
  color:#6b7280;
}

.cart-offcanvas-checkout-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 16px;
  border-radius:999px;
  background:#2563eb;
  color:#fff;
  font-size:14px;
  font-weight:600;
  text-decoration:none;
}

.cart-offcanvas-checkout-btn:hover {
  background:#1d4ed8;
}

.cart-offcanvas-secondary-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid #2563eb;
  color:#2563eb;
  font-size:13px;
  font-weight:500;
  text-decoration:none;
}

.cart-offcanvas-secondary-btn:hover {
  background:#e0f2fe;
}

/* MODAL HERRAMIENTAS DITEC BT */
.tools-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.tools-modal {
  background: #f9fafb;
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(15,23,42,0.55);
  width: min(1100px, 96vw);
  height: min(650px, 94vh);
  display: grid;
  grid-template-columns: 230px 1fr;
  overflow: hidden;
}

.tools-sidebar {
  background: #0f172a;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
}

.tools-sidebar-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.tools-nav-item {
  border: none;
  background: transparent;
  color: #e5e7eb;
  text-align: left;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  cursor: pointer;
  margin-bottom: 4px;
}

.tools-nav-item.active {
  background: #dc2626;
  color: #fff;
}

.tools-sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(148,163,184,0.4);
}

.tools-btn-primary {
  border-radius: 999px;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 0.9rem;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tools-main {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tools-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.tools-header h2 {
  font-size: 1.2rem;
  margin: 0;
}

.tools-header-subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.tools-close-btn {
  border-radius: 999px;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 1.4rem;
  cursor: pointer;
  background: #fee2e2;
  color: #991b1b;
}

.tools-content {
  flex: 1;
  overflow: auto;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px 16px 18px;
  border: 1px solid #e5e7eb;
}

.tool-panel { display: none; }
.tool-panel.active { display: block; }

.tool-desc {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap: 8px 12px;
}

.tool-field label {
  font-size: 0.82rem;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

.tool-field small {
  font-size: 0.75rem;
  color: #6b7280;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.tool-field textarea { resize: vertical; }

.tool-results {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

.tool-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.tool-result-label {
  font-size: 0.78rem;
  color: #6b7280;
}

.tool-result-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.tool-note {
  font-size: 0.75rem;
  color: #6b7280;
}

.tool-balance-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.tool-table th,
.tool-table td {
  border: 1px solid #e5e7eb;
  padding: 4px 6px;
}

.tool-table th {
  background: #f9fafb;
}

.module-popup-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.module-popup-tab {
  border: none;
  background: #e5e7eb;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.module-popup-tab.active {
  background: #dc2626;
  color: #fff;
}

.module-popup-content {
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}

/* Fondo completo */
.tools-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
}

/* Caja del modal */
.tools-modal {
  width: 90vw !important;
  height: 90vh !important;
  max-width: 90vw !important;
  max-height: 90vh !important;

  overflow: hidden;       /* mantiene bordes limpios */
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

/* El área interna debe desplazarse si hay mucha info */
.tools-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.module-popup-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.module-popup-help {
  margin-left: auto;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease-out, transform 0.1s ease-out;
}

.module-popup-help:hover {
  background: #d1d5db;
  transform: translateY(-1px);
}

/* Overlay ayuda circuito */
.circuit-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

.circuit-help-box {
  background: #ffffff;
  border-radius: 14px;
  max-width: 620px;
  width: 90%;
  max-height: 80vh;
  padding: 16px 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
  overflow-y: auto;
  font-size: 13px;
}

.circuit-help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.circuit-help-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.circuit-help-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.circuit-help-list {
  padding-left: 18px;
  margin: 8px 0;
}

.circuit-help-list li {
  margin-bottom: 6px;
}

.circuit-help-list code {
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 12px;
}

.circuit-help-note {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

/* Asegúrate de que el contenedor no tenga overflow oculto */
.page,
.page-inner {
  overflow: visible;
}

/* Que la columna central no se estire a lo alto */
.col-center {
  align-self: flex-start;
}

/* Layout columnas (por si no lo tienes así) */
.page-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start; /* importante para sticky */
}

/* Columna central no debe estirarse a toda la altura */
.col-center {
  flex: 1;
  align-self: flex-start;
}

/* Tarjeta del cuadro: ahora sticky */
.card-board {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 90px;   /* ajusta */
  z-index: 10;
}


/* Versión escritorio: fila */
.card-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
/* MÓVIL: cabecera en columna */
@media (max-width: 768px) {
  .card-board-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* === LAYOUT 3 COLUMNAS (FORZADO) ================================ */

.page-inner {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: flex-start;   /* importante para sticky */
}

/* Que ninguna columna tenga scroll propio ni oculte overflow */
.page,
.page-inner,
.col,
.col-left,
.col-center,
.col-right {
  overflow: visible !important;
}

/* Asegurar que la central no se estira rara */
.col-center {
  align-self: flex-start;
}

/* === TARJETA DEL CUADRO STICKY ================================= */

.card-board {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;

  position: sticky;
  top: 120px;        /* prueba con 90; luego ajusta 70 / 100 / 120 */
  z-index: 20;
}

/* Cabecera del cuadro (limpia) */
.card-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* Versión móvil: cabecera en columna */
@media (max-width: 768px) {
  .page-inner {
    display: block;
  }

  .card-board {
    position: static; /* en móvil la quitamos de sticky para no liar */
  }

  .card-board-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


.tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.tools-header-main {
  flex: 1;
  min-width: 0;
}

.tools-header-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.tools-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tools-ik-select label {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 2px;
}

.tools-ik-select select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.tools-close-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tools-close-btn:hover {
  background: #fecaca;
}
.tools-report-box{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-left:16px;
  font-size:12px;
}

.tools-report-row{
  display:flex;
  gap:8px;
  margin-bottom:2px;
}

.tools-report-field{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:110px;
}

.tools-report-field.small{
  min-width:90px;
  max-width:110px;
}

.tools-report-field.tiny{
  min-width:70px;
  max-width:80px;
}

.tools-report-field label{
  font-size:11px;
  color:#6b7280;
}

.tools-report-field input,
.tools-report-field select{
  font-size:12px;
  padding:3px 6px;
  border-radius:6px;
  border:1px solid #e5e7eb;
}

/* FONDO OSCURO A PANTALLA COMPLETA */
.module-popup {
  position: fixed;
  inset: 0;                      /* top:0; right:0; bottom:0; left:0 */
  background: rgba(15, 23, 42, 0.45);
  z-index: 2500;
  display: none;                 /* se muestra desde JS */
}

/* CAJA BLANCA CENTRADA */
.module-popup-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  /* centro exacto */
  max-width: 380px;
  width: calc(100% - 32px);          /* margen en móviles */
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15,23,42,.35);
}

/* Overlay a pantalla completa */
.module-popup {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 2500;
  display: none;                /* 'flex' al abrir */
  justify-content: center;
  align-items: center;
}

/* Caja blanca */
.module-popup-inner {
  max-width: 360px;
  width: calc(100% - 32px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15,23,42,0.35);
}

.card-board-header {
  display: flex;
  flex-direction: column;   /* texto arriba, acciones abajo */
  gap: 10px;
  padding: 12px 4px 16px;
  border-bottom: 1px solid var(--border-soft, #e5e7eb);
}

.cabinet-text h1 {
  margin: 0;
  font-size: 18px;
}

.cabinet-text .muted {
  margin-top: 2px;
  font-size: 12px;
}

/* Fila de botones + plantilla */
.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Bloque de plantillas */
.template-select-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-select-box label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted, #6b7280);
}

/* Fila select + Aplicar */
.template-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-select-row select {
  min-width: 170px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft, #e5e7eb);
  font-size: 13px;
}

/* Opcional: que Cambiar y Aplicar sean “pastilla” */
#btn-change-size,
#btn-apply-template {
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  white-space: nowrap;
}

/* En móvil que todo se apile bien */
@media (max-width: 600px) {
  .cabinet-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .template-select-row {
    width: 100%;
  }

  .template-select-row select {
    flex: 1;
  }
}
.tools-help-btn {
  border: none;
  background: #e5e7eb;
  color: #111827;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  margin-right: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tools-help-btn:hover {
  background: #d1d5db;
}
.tools-modal {
  position: relative; /* importante para el absolute del panel */
}

.tools-help-panel {
  position: absolute;
  top: 12px;
  right: 50px; /* para no tapar la X */
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.35);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 50;
  display: none; /* oculto por defecto */
}

.tools-help-panel.is-visible {
  display: block;
}

.tools-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.tools-help-title {
  font-size: 13px;
  font-weight: 600;
}

.tools-help-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.tools-help-body ul {
  margin: 6px 0;
  padding-left: 16px;
}

.tools-help-body li {
  margin-bottom: 3px;
}

.tools-help-note {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7280;
}
/* Modal grande herramientas */
.tools-modal-overlay {
  z-index: 2000;
}

/* Todo lo que deba estar POR ENCIMA del modal de herramientas */
#circuit-help-overlay,
#resumen-detail-overlay {
  position: fixed;        /* por si acaso */
  z-index: 2100;
}

#tools-help-overlay {
  display: none !important;
}

/* --- Prioridades de popups sobre el configurador --- */

/* Modal grande de herramientas */
.tools-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

/* Popup módulo (variantes/circuito) SIEMPRE por encima de todo */
.module-popup {
  position: fixed;
  z-index: 2200;
}

/* Ayuda de circuito y detalle de resumen por encima del modal herramientas */
#circuit-help-overlay,
#resumen-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
}

/* Panel de ayuda dentro del modal herramientas */
.tools-help-panel {
  position: absolute;
  top: 12px;
  right: 60px;    /* para dejar sitio al botón de cerrar */
  z-index: 2050;  /* por encima del contenido del modal */
}

/* Por si todavía existe el overlay viejo de ayuda, lo matamos */
#tools-help-overlay {
  display: none !important;
}
.tools-header {
  position: relative; /* necesario para usar absolute dentro */
}

.tools-help-btn,
.tools-close-btn {
  position: absolute;
  top: 12px;          /* ajusta si hace falta */
  z-index: 2100;
}

/* Botón de ayuda a la derecha del de cerrar */
.tools-close-btn {
  right: 12px;
}

.tools-help-btn {
  right: 52px; /* separarlo 40px del de cerrar */
}

/* ============ OFF-CANVAS MÓVIL ============ */

/* Barra solo en móvil */
.mobile-toolbar {
  display: none;
}

/* Backdrop general off-canvas */
.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1600;
  transition: opacity 0.2s ease;
}

.offcanvas-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Botones de la barra móvil */
.mobile-toolbar-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
}
/* ===========================
   DESKTOP / PANTALLA COMPLETA
   A partir de 1042px → 3 columnas normales
=========================== */
@media (min-width: 1042px) {
  #desktop-config {
    display: block;
  }
  #mobile-config {
    display: none;
  }

  .page-inner {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 320px;
    gap: 16px;
    position: static;
  }

  .col-left,
  .col-center,
  .col-right {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    padding: 0;
  }

  /* Nada de off-canvas ni backdrop en desktop */
  .mobile-toolbar,
  .offcanvas-backdrop {
    display: none !important;
  }

  body.offcanvas-open {
    overflow: auto;
  }
}
/* 1) MODO MÓVIL SIMPLE – móviles muy pequeños */
@media (max-width: 345px) {

  #desktop-config {
    display: none !important;
  }

  #mobile-config {
    display: block !important;
  }

  .mobile-card {
    max-width: 345px;
    margin: 16px auto;
    padding: 18px 14px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15,23,42,.12);
  }

  .mobile-title {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .mobile-text {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 12px;
  }

  .mobile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-field label {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .mobile-field input,
  .mobile-field select,
  .mobile-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
  }

  .mobile-buttons {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-small {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    text-align: center;
  }
}

/* Si fuerza escritorio, aunque sea pequeño, mostramos desktop */
body.force-desktop #desktop-config {
  display: block !important;
}
body.force-desktop #mobile-config {
  display: none !important;
}
/* Barra móvil oculta por defecto (solo aparece en móviles) */
.mobile-toolbar {
  display: none;
}

/* Backdrop general off-canvas */
.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1600;
  transition: opacity 0.2s ease;
}

.offcanvas-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Botones de la barra móvil */
.mobile-toolbar-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
}

/* 2) OFF-CANVAS en móviles normales 345–1041px */
@media (max-width: 1041px) and (min-width: 346px) {

  #desktop-config {
    display: block;
  }
  #mobile-config {
    display: none;
  }

  .page-inner {
    position: relative;
    display: block;
  }

  .mobile-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }

  .col-center {
    width: 100%;
    max-width: 100%;
  }

  .col-left,
  .col-right {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    max-height: 100vh;
    width: 80%;
    max-width: 360px;
    background: #f9fafb;
    z-index: 1700;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.35);
     transition:
      transform .35s cubic-bezier(.18, 1.2, .32, 1),
      opacity   .22s ease-out;
   
    pointer-events: none;
  }

  .col-left {
    left: 0;
    transform: translateX(-100%);
  }

  .col-right {
    right: 0;
    transform: translateX(100%);
  }

  .col-left.is-open,
  .col-right.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    will-change: transform, opacity;
    box-shadow: 0 0 32px rgba(0,0,0,.3);
  }
  
  .card-board-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding-top: 12px;
  }
   #price-floating {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 2000;
    user-select: none;
    pointer-events: auto;
    cursor: pointer;
    display: none; /* se muestra solo cuando haya valor */
  }

  /* Si abres el panel derecho, que no solape */
  .col-right.is-open ~ #price-floating {
    right: calc(18px + 360px);
  }
  
  .mobile-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    position: sticky;
    top: 56px;          /* AJUSTA: altura de tu header */
    background: #f8fafc;
    padding: 6px 10px;
    z-index: 1000;
  }

  .mobile-toolbar-btn {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 12px;
    font-weight: 600;
  }
}

/* Bloquear scroll del fondo cuando hay off-canvas abierto */
body.offcanvas-open {
  overflow: hidden;
}

.mobile-toolbar {
  position: sticky;
  top: 0;
  background: #f8fafc;
  padding: 6px 10px;
  z-index: 1000;
}
.mobile-toolbar-btn {
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  font-weight: 600;
}

/* === ESCRITORIO GRANDE: 3 columnas + cuadro sticky === */
@media (min-width: 1042px) {
  #desktop-config {
    display: block;
  }
  #mobile-config {
    display: none;
  }

  .page-inner {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: flex-start;
  }

  .col-left,
  .col-right,
  .col-center {
    position: static;
    max-width: none;
    overflow: visible;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    padding: 0;
  }

  /* Aquí hacemos sticky SOLO el cuadro */
  .card-board {
    position: sticky;
    top: 300px;   /* ajusta según altura del header */
    z-index: 20;
  }

  /* El precio flotante es SOLO móvil: ocúltalo en escritorio */
  #price-floating {
    display: none !important;
  }
}


@media (min-width: 1042px) {
  #price-floating {
    display: none !important;
  }
}

/* ==========================================
   1) ESCRITORIO GRANDE (≥ 1042px)
   - 3 columnas
   - Columna central sticky
   - SIN barra móvil
   - SIN precio flotante
========================================== */
@media (min-width: 1042px) {

  /* layout 3 columnas */
  .page-inner {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 320px;
    gap: 16px;
    position: static;
  }

  .col-left,
  .col-center,
  .col-right {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    padding: 0;
  }

  /* centro sticky solo en escritorio grande */
  .col-center {
    position: sticky;
    top: 90px;          /* ajusta según la altura de tu header */
    align-self: flex-start;
    z-index: 5;
  }

  /* la tarjeta del cuadro ya NO es sticky, lo es la columna */
  .card-board {
    position: static !important;
  }

  /* barra móvil y backdrop 100% ocultos en escritorio */
  .mobile-toolbar,
  .offcanvas-backdrop,
  #price-floating {
    display: none !important;
  }

  body.offcanvas-open {
    overflow: auto;
  }
}

/* ==========================================
   2) MÓVIL / TABLET  (346px – 1041px)
   - layout "normal"
   - barra móvil SIEMPRE visible (sticky)
   - precio flotante visible
========================================== */
@media (max-width: 1041px) and (min-width: 346px) {

  .page-inner {
    position: relative;
    display: block;
  }

  .col-center {
    position: static;      /* aquí NO sticky */
  }

  /* barra móvil fija bajo el header */
  .mobile-toolbar {
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    position: sticky;
    top: 60px;             /* ajusta según el alto del header DITEC BT */
    background: #f8fafc;
    z-index: 1000;
  }

  .mobile-toolbar-btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-weight: 600;
  }

  /* off-canvas lateral como ya tienes */
  .col-left,
  .col-right {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    max-height: 100vh;
    width: 80%;
    max-width: 360px;
    background: #f9fafb;
    z-index: 1700;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.35);
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform .35s cubic-bezier(.18, 1.2, .32, 1),
      opacity   .22s ease-out;
  }

  .col-right {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }

  .col-left.is-open,
  .col-right.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .offcanvas-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    z-index: 1600;
    transition: opacity 0.2s ease;
  }

  .offcanvas-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  body.offcanvas-open {
    overflow: hidden;
  }

  /* precio flotante solo en móvil */
  #price-floating {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 2000;
    user-select: none;
    pointer-events: auto;
    cursor: pointer;
    display: none; /* tu JS lo pone en block cuando hay precio */
  }
}

/* ==========================================
   3) MÓVIL MUY PEQUEÑO (≤ 345px)
   - tu formulario simple
========================================== */
@media (max-width: 345px) {
  #desktop-config { display: none !important; }
  #mobile-config  { display: block !important; }
}


