/* ============================================================
   Bottom sheets
   ============================================================ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 20, 40, 0);
  transition: background .3s ease;
  touch-action: none;
}
.sheet-backdrop.is-open { background: rgba(30, 20, 40, .45); }

.sheet {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(92dvh - var(--safe-top));
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--cream);
  box-shadow: 0 -8px 40px rgba(60, 30, 20, .25);
  transform: translateY(105%);
  transition: transform .42s var(--ease-spring);
  touch-action: auto;
  padding-bottom: var(--kb);
}
.sheet-backdrop.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }
.sheet-tall { height: calc(86dvh - var(--safe-top)); }
.sheet-full { height: 100dvh; max-height: none; max-width: none; border-radius: 0; padding-top: var(--safe-top); }
.sheet-full .sheet-grabber { visibility: hidden; }
.sheet-full .loc-map { height: min(58dvh, 640px); }

.sheet-center { margin: auto 12px; border-radius: var(--r-xl); max-width: 420px; }
.sheet-backdrop:has(.sheet-center) { align-items: center; }
.sheet-backdrop.is-open .sheet-center { transform: none; }
.sheet-center { transform: scale(.9); opacity: 0; transition: transform .3s var(--ease-spring), opacity .2s; }
.sheet-backdrop.is-open .sheet-center { opacity: 1; }

.sheet-header { flex-shrink: 0; padding: 8px 16px 10px; touch-action: none; cursor: grab; }
.sheet.is-locked .sheet-header { cursor: default; }
.sheet-grabber { width: 40px; height: 5px; border-radius: 3px; background: #e2d6ca; margin: 0 auto 8px; }
.sheet-center .sheet-grabber, .sheet.is-locked .sheet-grabber { visibility: hidden; }
.sheet-header-row { display: flex; align-items: center; gap: 10px; }
.sheet-icon { font-size: 26px; }
.sheet-back { flex: none; padding: 6px 10px 6px 6px; margin-left: -6px; border: 0; border-radius: var(--r-pill, 99px);
  background: transparent; color: var(--accent, #e11d48); font-size: var(--fs-sm); font-weight: 800; cursor: pointer; }
.sheet-back:active { background: rgba(0, 0, 0, .05); }
.sheet-title-text { flex: 1; min-width: 0; }
.sheet-title-text h2 { font-size: var(--fs-lg); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-subtitle { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; margin-top: 1px; }

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 2px 16px 16px;
}
.sheet-footer {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 10px 16px max(12px, var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 248, 238, .96);
}
.sheet-footer .btn { flex: 1; }
.sheet-center .sheet-footer { border-radius: 0 0 var(--r-xl) var(--r-xl); padding-bottom: 14px; }
.sheet:not(.sheet-center) .sheet-body:last-of-type { padding-bottom: max(16px, var(--safe-bottom)); }

body.has-sheet .stage { pointer-events: none; }

@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: var(--r-xl); transform: translateY(40px) scale(.97); opacity: 0; transition: transform .35s var(--ease-spring), opacity .2s; }
  .sheet-backdrop.is-open .sheet { transform: none; opacity: 1; }
  .sheet-tall { height: min(80dvh, 760px); }
  .sheet-full { border-radius: 0; height: 100dvh; }
}
