/* ============================================================================
 * bottom-sheet.css — PR 4
 * Contrato 02 §8. Painel deslizante de baixo. Snap points + drag.
 * ========================================================================== */

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-bottom-sheet);
  font-family: var(--font-body);
}

.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 20, 0.55);
  animation: mp-bs-backdrop-in var(--transition-base) ease forwards;
}

.bottom-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-elev);
  color: var(--text-primary);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  height: var(--bs-height, 90%);
  padding-bottom: var(--safe-bottom);
  transform: translateY(0);
  transition: height var(--transition-base);
  will-change: transform, height;
  touch-action: none;
}

.bottom-sheet__panel--dragging {
  transition: none;
}

.bottom-sheet__panel--entering {
  animation: mp-bs-panel-in var(--transition-slow) cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.bottom-sheet__handle-row {
  display: flex;
  justify-content: center;
  padding: var(--space-2) 0 var(--space-1);
  cursor: grab;
  flex: 0 0 auto;
}

.bottom-sheet__handle-row:active {
  cursor: grabbing;
}

.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-default);
}

.bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5) var(--space-3);
  flex: 0 0 auto;
}

.bottom-sheet__title {
  font-family: var(--font-title);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-lg);
  margin: 0;
}

.bottom-sheet__close {
  appearance: none;
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--fs-md);
}
.bottom-sheet__close:hover { background: var(--bg-muted); color: var(--text-primary); }
.bottom-sheet__close:focus { outline: none; }
.bottom-sheet__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bottom-sheet__body {
  padding: 0 var(--space-5) var(--space-4);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}

.bottom-sheet__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg);
  flex: 0 0 auto;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .bottom-sheet__panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 560px;
    border-radius: var(--radius-xl);
    bottom: var(--space-6);
  }
}

@keyframes mp-bs-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mp-bs-panel-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

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