/* Bottom drawer using <dialog> element */
dialog.bottom-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

dialog.bottom-drawer::backdrop {
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 300ms ease;
}

dialog.bottom-drawer[data-open]::backdrop {
  opacity: 1;
}

.bottom-drawer-panel {
  background: white;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

dialog.bottom-drawer[data-open] .bottom-drawer-panel {
  transform: translateY(0);
}

/* Safe area padding for devices with home indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-drawer-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .bottom-drawer-panel {
    background: #1e293b; /* slate-800 */
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  }
}
