/* Backdrop y sheet (modal centrado en escritorio). */

/* --- Backdrop y sheet --- */
.backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-ios);
  z-index: 40;
}
.backdrop[data-abierto="true"] { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  z-index: 50;
  background: var(--bg-grupo);
  display: flex;
  flex-direction: column;
  /* Movil primero: el sheet nace anclado abajo. */
  left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--sh-lg);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-ios);
}
.sheet[data-abierto="true"] { transform: translateY(0); }
.sheet__handle {
  width: 36px; height: 5px;
  border-radius: var(--radius-full);
  background: var(--label-tertiary);
  margin: var(--space-2) auto var(--space-1);
  flex: none;
}
.sheet__cabecera {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-height: var(--navbar-h);
  border-bottom: 1px solid var(--border);
  flex: none;
}
.sheet__cuerpo { overflow-y: auto; padding: var(--space-4); }

/* Escritorio: el MISMO markup se vuelve modal centrado. */
@media (min-width: 768px) {
  .sheet {
    left: 50%; right: auto; bottom: auto;
    top: 50%;
    width: min(560px, calc(100vw - 48px));
    max-height: 86vh;
    border-radius: var(--radius-lg);
    transform: translate(-50%, -50%) scale(0.96);
    opacity: 0;
    transition: transform var(--dur-base) var(--ease-ios), opacity var(--dur-base) var(--ease-ios);
  }
  .sheet[data-abierto="true"] { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet__handle { display: none; }
}

