/* ============================================================
   SUMMARY MODAL — Panel lateral de resumen / lista de materiales
   ============================================================ */

.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);
  flex-shrink: 0;
}

.summary-modal__title {
  font-size: var(--text-h6);
  font-weight: 500;
  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);
}

/* ── Acabado ── */
.summary-modal__finish {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-body2);
  color: var(--c-text-body);
  padding: 0 var(--sp-5);
}

.summary-modal__swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  border: 1px solid #828282;
}
.summary-modal__swatch--blanco { background: #fff; }
.summary-modal__swatch--negro  { background: #1a1a1a; }

/* ── Separadores ── */
.summary-modal__divider {
  border: none;
  border-top: 1px solid var(--c-border-soft);
  margin: var(--sp-4) var(--sp-5);
}

/* ── Cuerpo con scroll ── */
.summary-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 var(--sp-4);
  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; }

/* ── Lista de elementos ── */
.summary-modal__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 0 var(--sp-5);
}

/* ── Fila de elemento ── */
.summary-modal__row {
  display: flex;
  align-items: baseline;
  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__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-modal__name {
  color: var(--c-text-dark);
  font-size: var(--text-body3);
  font-weight: 500;
}

.summary-modal__ref {
  color: rgba(67, 66, 64, 0.8);
  font-size: 11px;
}

.summary-modal__qty {
  color: #434240;
  font-size: var(--text-body3);
  white-space: nowrap;
  min-width: 50px;
  text-align: right;
}

.summary-modal__price {
  color: var(--c-text-body);
  font-size: var(--text-body3);
  white-space: nowrap;
  text-align: right;
  min-width: 70px;
}

.summary-modal__action-slot {
  width: 28px;
  flex-shrink: 0;
}

/* ── Footer con total ── */
.summary-modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

.summary-modal__total-label {
  font-size: var(--text-body1);
  font-weight: 700;
  color: var(--c-text-dark);
}

.summary-modal__total-value {
  font-size: var(--text-body1);
  font-weight: 700;
  color: var(--c-text-dark);
}

/* ── Botón editar (lápiz) ── */
.summary-modal__edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  color: var(--c-text-muted);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.summary-modal__edit-btn:hover {
  background: var(--c-bg-subtle);
  color: var(--c-text-dark);
}

/* ── Fila en modo edición ── */
.summary-modal__row--editing {
  align-items: center;
}

.summary-modal__edit-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* ── Contador − / + (pill) ── */
.summary-modal__counter {
  display: flex;
  align-items: center;
  gap: 0;
  background: #F4F2F1;
  border-radius: var(--r-full);
  overflow: hidden;
  flex-shrink: 0;
  height: 32px;
}
.summary-modal__counter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 14px;
  color: var(--c-text-body);
  transition: background 0.15s;
}
.summary-modal__counter-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}
.summary-modal__counter-val {
  font-size: var(--text-body3);
  color: var(--c-text-dark);
  padding: 0 var(--sp-1);
  white-space: nowrap;
  min-width: 36px;
  text-align: center;
}

/* ── Botón eliminar (círculo con borde sutil, icono rojo) ── */
.summary-modal__delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: #F4F2F1;
  color: #dc3545;
  flex-shrink: 0;
  transition: background 0.15s;
}
.summary-modal__delete-btn:hover {
  background: rgba(220, 53, 69, 0.08);
}

.summary-modal__counter-btn--disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Botón cerrar edición (X) ── */
.summary-modal__dismiss-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--c-text-muted);
  flex-shrink: 0;
  transition: color 0.15s;
}
.summary-modal__dismiss-btn:hover {
  color: var(--c-text-dark);
}

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