/* ── Generic mobile bottom sheet — ARKAN UI core ──────────────────
   Sibling to mobile-action-sheet.css but for arbitrary caller-supplied
   content (filter panels, detail previews) rather than a fixed action
   list. Scoped under .mbs* to stay independent of .mas* styling. */

.mobile-bottom-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.mbs__backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface-overlay);
  opacity: 0;
  transition: opacity var(--transition-md);
}

.mbs__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: min(80vh, 640px);
  background: var(--surface-elevated);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform var(--transition-md);
}

.mobile-bottom-sheet-root.mbs--open {
  pointer-events: auto;
}
.mobile-bottom-sheet-root.mbs--open .mbs__backdrop {
  opacity: 1;
}
.mobile-bottom-sheet-root.mbs--open .mbs__sheet {
  transform: translateY(0);
}

.mbs__handle {
  flex-shrink: 0;
  box-sizing: content-box;
  width: 36px;
  height: 4px;
  /* Padding enlarges the actual hit/drag target to 44px without growing
     the visible bar — background-clip keeps the paint confined to the
     36x4 box while the click/touch listeners (bound on this element in
     mobile-bottom-sheet.js) still fire anywhere in the padded area. */
  padding: 20px 40px;
  margin: 0 auto;
  background: var(--border-default);
  background-clip: content-box;
  border-radius: var(--radius-full);
  cursor: grab;
  touch-action: none;
}

.mbs__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.mbs__title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.mbs__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
}

.mbs__body {
  overflow-y: auto;
  padding: 14px 16px;
  color: var(--text-primary);
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
  .mbs__backdrop,
  .mbs__sheet {
    transition: none;
  }
  .mbs__sheet {
    transform: none;
  }
}
