/* bottom-sheet.css — Base styles for all bottom sheets
   Colors come from the central palette in /styles.css (--vv-*). */

.vv-bs-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  bottom: var(--vv-bottom-nav-height, 64px); /* don't cover the bottom nav */
  background: rgba(0, 0, 0, 0.35);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.vv-bs-backdrop.open {
  display: block;
  opacity: 1;
}

.vv-bs-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--vv-bottom-nav-height, 64px); /* sit above the bottom nav */
  z-index: 45;
  background: var(--vv-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.14);
  transform: translateY(110%);
  /* transform: open/close slide; max-height: smooth peek ↔ full expansion */
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  /* Peek height: shows header + first content without covering the map.
     Drag up to expand (vv-bs-full). */
  max-height: calc(52vh - var(--vv-bottom-nav-height, 64px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vv-bs-sheet.open {
  transform: translateY(0);
}

/* Expanded: covers the bottom nav (drag the handle down to return to peek).
   Always leaves a gap at the top — dvh tracks the real visible viewport on
   mobile (vh ignores the browser's collapsing address bar and overflows). */
.vv-bs-sheet.vv-bs-full {
  bottom: 0;
  z-index: 60; /* above the bottom nav (50) */
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - max(56px, env(safe-area-inset-top, 0px) + 32px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-reduced-motion: reduce) {
  .vv-bs-sheet { transition: none; }
  .vv-bs-backdrop { transition: none; }
}

.vv-bs-handle-bar {
  width: 40px;
  height: 4px;
  background: var(--vv-muted);
  border-radius: 2px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.vv-bs-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

/* Collapsed: tiny strip showing only the panel title; backdrop removed */
.vv-bs-sheet.vv-bs-collapsed {
  height: 72px;
  max-height: 72px;
  cursor: pointer;
}

.vv-bs-sheet.vv-bs-collapsed .vv-bs-body {
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .vv-bs-sheet {
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  }
}
