/* =========================
   QUICK ITEM DETAIL
========================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  position: relative;

  min-height: 100vh;

  margin: 0;

  background-color: #f5f5f5;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  overflow: hidden;
}

/* =========================
   뒤쪽 어두운 화면

   브라우저 전체가 아니라
   모바일 화면 영역만 어둡게
========================= */

.detail-backdrop {
  position: fixed;

  top: 0;
  bottom: 0;

  left: 50%;

  width: 100%;
  max-width: 390px;

  transform: translateX(-50%);

  background-color: rgba(0, 0, 0, 0.45);

  z-index: 1;
}

/* =========================
   Bottom Sheet
========================= */

.item-detail-sheet {
  position: fixed;

  left: 50%;
  bottom: 0;

  width: 100%;
  max-width: 390px;

  /* 피그마처럼 위쪽에 배경이 조금 보이게 */
  height: calc(100vh - 72px);

  transform: translateX(-50%);

  background-color: #ffffff;

  border-radius: 20px 20px 0 0;

  z-index: 10;

  overflow-y: auto;
  overflow-x: hidden;

  transition: transform 0.25s ease;

  -webkit-overflow-scrolling: touch;
}

/* =========================
   드래그 핸들 영역
========================= */

.sheet-handle-area {
  width: 100%;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  cursor: grab;

  touch-action: none;
}

.sheet-handle-area:active {
  cursor: grabbing;
}

/* 실제 회색 막대 */

.sheet-handle {
  width: 48px;
  height: 4px;

  border-radius: 999px;

  background-color: #d9d9d9;
}

/* =========================
   항목 제목
========================= */

.item-summary {
  padding: 4px 24px 22px;

  text-align: center;
}

/* 밥 / 떡볶이 */

.item-summary h1 {
  margin: 0;

  color: #111111;

  font-size: 24px;
  font-weight: 700;

  line-height: 1.35;
}

/* quick 모드의 총 금액 */

.detail-total-amount {
  margin: 16px 0 0;

  color: #111111;

  font-size: 14px;
  font-weight: 600;
}

.detail-total-amount.hidden {
  display: none;
}

/* =========================
   결제자

   together 모드에서만 보임
========================= */

.payer-row {
  width: auto;

  display: flex;
  align-items: center;

  margin: 4px 24px 22px;
}

.payer-row.hidden {
  display: none;
}

/* 결제자 프로필 */

.payer-profile {
  width: 30px;
  height: 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  margin-right: 12px;
}

.payer-profile img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: contain;
}

/* 결제자 이름 */

.payer-name {
  flex: 1;

  color: #222222;

  font-size: 14px;
  font-weight: 500;
}

/* 결제자가 실제 결제한 총 금액 */

.payer-amount {
  margin-left: 12px;

  color: #111111;

  font-size: 14px;
  font-weight: 600;

  white-space: nowrap;
}

/* =========================
   참여자 카드
========================= */

.participant-detail-card {
  margin: 0 16px;

  padding: 18px 16px 20px;

  border: 1px solid #dddddd;
  border-radius: 10px;

  background-color: #ffffff;
}

/* 참여자 (4명) */

.participant-detail-card h2 {
  margin: 0 0 18px;

  color: #222222;

  font-size: 14px;
  font-weight: 600;
}

/* =========================
   참여자 목록
========================= */

.detail-participant-list {
  display: flex;
  flex-direction: column;

  gap: 15px;
}

/* 참여자 한 줄 */

.detail-participant-item {
  width: 100%;

  display: flex;
  align-items: center;

  min-height: 30px;
}

/* 참여자 프로필 */

.detail-participant-avatar {
  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  margin-right: 12px;
}

.detail-participant-avatar img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: contain;
}

/* 이름 */

.detail-participant-name {
  flex: 1;

  color: #333333;

  font-size: 13px;
  font-weight: 400;
}

/* 각자 부담 금액 */

.detail-participant-amount {
  margin-left: 12px;

  color: #222222;

  font-size: 13px;
  font-weight: 500;

  white-space: nowrap;
}

/* =========================
   작은 화면 대응
========================= */

@media (max-width: 390px) {
  .detail-backdrop,
  .item-detail-sheet {
    max-width: 100%;
  }
}
