/* =====================================================================
   MiesApp — SHEET (panel deslizable desde abajo)
   Componente aislado y reutilizable. Ver js/sheet.js.
   ===================================================================== */

.sheet-bd {
  position: fixed;
  inset: 0;
  z-index: 1500;                 /* por encima de header (100), cal (90), toast (99) */
  background: rgba(0, 0, 0, .42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.sheet-bd.abierto { opacity: 1; visibility: visible; }

.sheet {
  width: 100%;
  max-width: var(--app-max, 480px);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-bd.abierto .sheet { transform: translateY(0); }

.sheet-grab {
  width: 40px; height: 4px;
  margin: 10px auto 2px;
  border-radius: 2px;
  background: var(--border2);
  flex-shrink: 0;
  cursor: grab;
}
.sheet-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-title { font-size: 17px; font-weight: 600; margin: 0; }
.sheet-x {
  flex-shrink: 0;
  border: none; background: none; padding: 4px;
  color: var(--sec); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sheet-body {
  overflow-y: auto;
  /* El safe-area del home indicator ya lo pone .sheet (padding-bottom); acá no
     lo repetimos para no dejar un hueco doble debajo del contenido/botón. */
  padding: 16px 18px 18px;
}

/* Con el sheet abierto, el fondo no scrollea. */
body.sheet-open { overflow: hidden; }
