/* Center the existing cart on every screen without changing its contents. */
.bottom-drawer {
  top: 50%;
  top: 50dvh;
  bottom: auto;
  left: 50%;
  width: min(560px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  border-radius: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

/* JavaScript already updates aria-hidden for every open and close action. */
.bottom-drawer[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bottom-drawer .drawer-header {
  flex: 0 0 auto;
}

.bottom-drawer .drawer-body {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
  .bottom-drawer {
    transition: none;
  }
}
