/* ============================================================
   SUMMARY MODAL — Panel lateral de resumen / lista de materiales
   Figma: "Resumen" (panel derecho, ~340px)
   ============================================================ */

.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}

.summary-modal--visible {
  pointer-events: auto;
}

.summary-modal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

/* ── Panel deslizante ── */
.summary-modal__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--c-bg-app);
  border-left: 1px solid var(--c-border);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-modal--visible .summary-modal__panel {
  transform: translateX(0);
}

/* ── Cabecera ── */
.summary-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.summary-modal__title {
  font-size: var(--text-h6);
  font-weight: var(--fw-regular);
  color: var(--c-text-dark);
}

.summary-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  color: var(--c-text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.summary-modal__close:hover {
  background: var(--c-bg-subtle);
  color: var(--c-text-dark);
}

/* ── Cuerpo con scroll ── */
.summary-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.summary-modal__body::-webkit-scrollbar { width: 3px; }
.summary-modal__body::-webkit-scrollbar-track { background: transparent; }
.summary-modal__body::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }

/* ── Subtítulo "LISTADO DE ELEMENTOS DEL SISTEMA" ── */
.summary-modal__subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-body3);
  font-weight: var(--fw-regular);
  text-transform: uppercase;
  color: var(--c-text-overlay);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-4);
}

/* ── Lista de elementos ── */
.summary-modal__list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

/* ── Fila de elemento ── */
.summary-modal__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border-soft);
  font-size: var(--text-body2);
  color: var(--c-text-body);
  line-height: var(--lh-normal);
}

.summary-modal__row:last-child {
  border-bottom: none;
}

.summary-modal__name {
  color: var(--c-text-body);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-modal__ref {
  color: var(--c-text-muted);
  font-size: var(--text-body3);
  white-space: nowrap;
}

.summary-modal__qty {
  color: var(--c-text-muted);
  font-size: var(--text-body3);
  white-space: nowrap;
  text-align: right;
}

/* ── Estado vacío ── */
.summary-modal__empty {
  padding: var(--sp-5) 0;
  font-size: var(--text-body2);
  color: var(--c-text-muted);
  text-align: center;
}
