/* Reusable bottom-sheet primitive.
 *
 * Markup:
 *   .v-bs                      fixed full-viewport container, pointer-events
 *                              gated by .is-open
 *     .v-bs-backdrop           dimmed background, click closes
 *     .v-bs-sheet              bottom-anchored sheet, slides up
 *       .v-bs-handle-wrap      drag affordance (also a click-to-close hit area)
 *         .v-bs-handle
 *       .v-bs-close            top-right close button
 *       .v-bs-body             scrollable content slot (id="<sheetId>-body")
 *
 * Hooks:
 *   .v-bs.is-open              applied while open (drives transitions)
 *   body.v-bs-locked           toggled to lock background scroll
 */

body.v-bs-locked {
  overflow: hidden;
}

.v-bs {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  isolation: isolate;
}
.v-bs.is-open {
  pointer-events: auto;
}

.v-bs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--black-color-rgb), 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.v-bs.is-open .v-bs-backdrop {
  opacity: 1;
}

.v-bs-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--white-color);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  box-shadow: 0 -16px 40px rgba(var(--black-color-rgb), 0.18);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.v-bs.is-open .v-bs-sheet {
  transform: translateY(0);
}

.v-bs-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 0.65rem 0 0.4rem;
  cursor: grab;
  flex-shrink: 0;
}
.v-bs-handle {
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: rgba(var(--black-color-rgb), 0.18);
}

/* Bottom-sheet close X — positioned absolute in the sheet's top-right.
   Visuals come from ActionButton (.v-action-btn--secondary, --icon-only). */
.v-bs-close.v-action-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  width: 36px;
  height: 36px;
  z-index: 2;
}

.v-bs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2rem 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
/* Push the first child away from the absolute close button so the X never
   crowds the first row of content. Consumers that want their card / header
   to occupy the full width can opt out via `.v-bs-body--flush` on a child. */
.v-bs-body > :first-child {
  padding-right: 2.75rem;
}
