/**
 * Wehome sheet — Premium Craft stagger (motion.md §5)
 * backdrop → panel → focus
 */

.wh-sheet-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: var(--wh-z-overlay, 9000);
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* 닫힘(exit)은 열림(380ms)보다 짧게 — motion §3 */
  transition:
    background var(--wh-motion-base, 260ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity var(--wh-motion-base, 260ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    backdrop-filter var(--wh-motion-base, 260ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    -webkit-backdrop-filter var(--wh-motion-base, 260ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s linear var(--wh-motion-base, 260ms);
}
.wh-sheet-backdrop.wh-sheet-backdrop--open,
.wh-sheet-backdrop.is-open {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    background var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    backdrop-filter var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    -webkit-backdrop-filter var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s;
}

.wh-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  z-index: var(--wh-z-modal, 10000);
  background: var(--wh-card, #fff);
  border-radius: var(--wh-radius-xl, 28px) var(--wh-radius-xl, 28px) 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* 아래 가장자리에서 오가는 바텀 시트 (motion §1d·§5, 2026-10-08). 닫힘은 열림(480ms)보다 짧게(260ms).
     PC 가운데 모달(wh-login-sheet·wh-mkt-sheet)은 각자 CSS가 transform만 덮어쓴다. */
  transform: translateX(-50%) translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--wh-motion-base, 260ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity var(--wh-motion-fast, 180ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}
/* 앱: 네이티브 하단 탭이 웹뷰 위에 떠 있어 시트 아래 버튼·문구를 가린다 — 탭 높이만큼 비운다 (2026-09-29, 광고 알림 동의 시트) */
html.wh-wehome-app.wh-native-tabs .wh-sheet {
  padding-bottom: var(--wh-native-tab-pad);
}
.wh-sheet.wh-sheet--open,
.wh-sheet.is-open {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
  /* 바닥에 붙은 시트라 overshoot 스프링은 아래에 틈을 만든다 — out-smooth로 감속 */
  transition:
    transform var(--wh-motion-sheet, 480ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity var(--wh-motion-fast, 180ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

/* 손잡이: 장식(aria-hidden)이지만 아래로 끌어 닫기의 시작점 — wh-sheet-drag.js (touch-action:none, 눌림 영역만 넓힘) */
.wh-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--wh-tx3, #6B6B6B);
  border-radius: 2px;
  margin: 10px auto 8px;
  position: relative;
  touch-action: none;
}
.wh-sheet__handle::after {
  content: '';
  position: absolute;
  inset: -12px -56px -8px;
}

@media (prefers-reduced-motion: reduce) {
  .wh-sheet-backdrop,
  .wh-sheet {
    transition: none !important;
  }

  .wh-sheet.is-open,
  .wh-sheet.wh-sheet--open {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}
