/* Anahata v2 — bottom sheet. Figma 1638:3319 (scrim 1638:3551, panel 1638:3844). */

/* The dialog itself is the full-viewport scrim, so the dim colour comes from a
   token on a normal element — ::backdrop does not inherit :root custom
   properties in every browser we support. */
.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--a-scrim-sheet);
  overflow: hidden;
}

.sheet::backdrop {
  background: transparent;
}

.sheet:not([open]) {
  display: none;
}

.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--a-space-5);
  max-height: 85vh;
  padding: 0 var(--a-space-5) calc(var(--a-space-5) + env(safe-area-inset-bottom, 0px));
  background: var(--a-bg);
  border-radius: var(--a-radius) var(--a-radius) 0 0;
  overflow-y: auto;
  animation: sheet-rise 0.22s ease-out;
}

@media screen and (min-width: 750px) {
  .sheet__panel {
    max-width: 402px;
    margin-inline: auto;
  }
}

.sheet__close {
  position: absolute;
  top: var(--a-space-3);
  right: var(--a-space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--a-radius-round);
  background: transparent;
  color: var(--a-ink);
  cursor: pointer;
}

.sheet__close:focus-visible {
  outline: 2px solid var(--a-ink);
  outline-offset: 2px;
}

.sheet__grabber {
  flex: 0 0 auto;
  width: 70px;
  height: 7px;
  border-radius: var(--a-radius);
  background: var(--a-grabber);
}

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

@media (prefers-reduced-motion: reduce) {
  .sheet__panel { animation: none; }
}

/* Centred card variant — Figma `Me (Profile)-1.png` (Gift Card Redeem). Same
   dialog and scrim; the panel floats in the middle instead of rising. */
.sheet--center .sheet__panel {
  background: var(--a-surface);   /* Add Message / Redeem frames: white dialog */
  top: 50%;
  bottom: auto;
  left: var(--a-gutter);
  right: var(--a-gutter);
  transform: translateY(-50%);
  max-height: calc(100vh - (var(--a-space-6) * 2));
  padding: var(--a-space-6) var(--a-space-5);
  border-radius: var(--a-radius);
  animation: sheet-fade 0.18s ease-out;
}

@media screen and (min-width: 750px) {
  .sheet--center .sheet__panel {
    left: 0;
    right: 0;
  }
}

@keyframes sheet-fade {
  from { opacity: 0; transform: translateY(-50%) scale(0.96); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}
