/* ============================================================
   EDIT MODAL — Panel lateral de edición de elementos 3D
   Desliza desde la derecha. El padding horizontal va en el panel
   (igual que configurator__panel → configurator__body), para que
   el breadcrumb y los grupos tengan el mismo layout que al añadir.
   ============================================================ */

/* ── Contenedor raíz (posicionado fixed sobre toda la UI) ── */
.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}

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

/* ── Fondo semitransparente (click para cerrar) ── */
.edit-modal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

/* ── Panel deslizante ── */
.edit-modal__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  /* Mismo ancho que .configurator__panel (flex 35/100 del body disponible) */
  width: calc((100vw - 2 * var(--page-px) - var(--panel-gap)) * 35 / 100);
  max-width: 100vw;
  /* Padding horizontal en el panel (los hijos no lo replican) */
  padding: 0 var(--sp-5);
  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);
}

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

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

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

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

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

/* ── Footer fijo con CTA ── */
.edit-modal__footer {
  padding: var(--sp-4) 0 var(--sp-5);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

/* Mismo estilo pill que el CTA del panel pero full-width */
.edit-modal__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-accent-dark);
  border: 1px solid var(--c-accent-dark);
  border-radius: var(--r-full);
  color: var(--c-white);
  font-family: var(--font);
  font-size: var(--text-body2);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.edit-modal__cta:hover:not(:disabled) { opacity: 0.88; }
.edit-modal__cta:disabled {
  background: var(--c-bg-subtle);
  border-color: var(--c-border);
  color: var(--c-text-muted);
  cursor: not-allowed;
  opacity: 1;
}
