/* DS §05.14 — Bottom sheet (web) · token-only */

.ds-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.45);
  animation: ds-backdrop-fade var(--dur-normal) var(--ease-inout);
}

@keyframes ds-backdrop-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ds-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-modal);
  background: var(--surface);
  border-radius: var(--rad-xl) var(--rad-xl) 0 0;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: ds-sheet-in var(--dur-normal) var(--ease-organic);
}

@keyframes ds-sheet-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Drag handle */
.ds-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--rad-pill);
  background: var(--border);
  margin: var(--sp-3) auto var(--sp-2);
}

.ds-bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.ds-bottom-sheet-title {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--fg1);
  margin: 0;
}

.ds-bottom-sheet-body {
  padding: var(--sp-5) var(--sp-6);
  font-family: var(--font-sans);
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.ds-bottom-sheet-footer {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
}

/* On desktop, cap width and center */
@media (min-width: 640px) {
  .ds-bottom-sheet {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 480px;
    border-radius: var(--rad-xl);
    bottom: var(--sp-6);
  }
}
