/* ============================================================
   Bottom sheet · véu com desfoque adaptado ao tema
   Carregado depois de styles.css: sobrescreve só o que precisa.
   Uso: qualquer .modal-backdrop (abre com a classe .open) e o
   menu de acesso rápido (#quickMenu), que usa #sheetVeil.
   ============================================================ */

:root {
  --sheet-blur: 16px;
  --sheet-saturate: 115%;
  --sheet-veil: rgba(4, 8, 16, 0.62);
  --sheet-veil-solid: rgba(4, 8, 16, 0.82);
}

html[data-theme="light"] {
  --sheet-blur: 14px;
  --sheet-saturate: 105%;
  --sheet-veil: rgba(14, 28, 22, 0.34);
  --sheet-veil-solid: rgba(14, 28, 22, 0.58);
}

/* Véu + desfoque, nos dois motores (WebKit e padrão) */
.modal-backdrop,
.sheet-veil {
  background: var(--sheet-veil) !important;
  -webkit-backdrop-filter: blur(var(--sheet-blur)) saturate(var(--sheet-saturate)) !important;
  backdrop-filter: blur(var(--sheet-blur)) saturate(var(--sheet-saturate)) !important;
  transition: opacity 0.22s ease, background-color 0.22s ease,
    -webkit-backdrop-filter 0.22s ease, backdrop-filter 0.22s ease;
}

/* Fechado: o efeito é removido por completo, sem resíduo de desfoque */
.modal-backdrop:not(.open),
.sheet-veil:not(.open) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Navegador sem backdrop-filter: véu mais opaco para manter o contraste */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-backdrop,
  .sheet-veil {
    background: var(--sheet-veil-solid) !important;
  }
}

/* O próprio sheet fica sempre nítido */
.modal-backdrop > *,
.quick-menu {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Véu do menu de acesso rápido (o menu fica em z-index 121) */
.sheet-veil {
  position: fixed;
  inset: 0;
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sheet-veil.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .sheet-veil {
    transition: none;
  }
}
