/* superposiciones.css - ventana modal (elemento dialog) y avisos emergentes (toast).
   En celular el modal sube desde abajo como hoja; en pantalla ancha queda centrado. */

.modal {
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0; width: 100%; max-width: 100%;
  max-height: 92dvh; border: 0; border-radius: 24px 24px 0 0; background: #fff; color: var(--texto);
  box-shadow: var(--sombra-2); overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; animation: subir .24s ease-out; }
.modal::backdrop { background: rgb(0 20 40 / 55%); }
@keyframes subir { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__cab { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--borde-suave); min-height: 64px; }
.modal__titulo { flex: 1; font-size: 18px; font-weight: 700; color: var(--secundario); line-height: 1.3; }
.modal__cuerpo { padding: 20px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; }
.modal__pie { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--borde-suave); background: #fff; }
.modal__pie .btn { flex: 1 1 140px; }
@media (min-width: 768px) {
  .modal { inset: 0; margin: auto; width: min(560px, calc(100% - 48px)); height: fit-content; border-radius: 24px; }
}

.toasts {
  position: fixed; z-index: 400; left: 0; right: 0; bottom: calc(16px + var(--safe-b));
  display: grid; gap: 8px; justify-items: center; padding-inline: var(--gutter); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px;
  min-height: var(--tactil); padding: 8px 8px 8px 16px; border-radius: var(--r-input);
  background: var(--secundario); color: #fff; box-shadow: var(--sombra-2); font-size: 15px; font-weight: 500;
  animation: subir .2s ease-out;
}
.toast__texto { flex: 1; overflow-wrap: anywhere; }
.toast--error { background: #8f1d14; }
.toast--ok { background: #17542d; }
.toast .btn--texto { color: #fff; }
.toast .btn--texto:hover { background: rgb(255 255 255 / 15%); }
