/*
  PickMe 전용 스타일.
  - 레이아웃/모달/좌측 패널: pay.css 재사용 (pickme.html에서 함께 link).
  - 결과 표시(주문 요약 / 배지 / 주문 카드): pick.css에서 복사 (Pick 원본 미수정).
    pick.css의 :root 토큰을 동일 값으로 여기서 재정의 — pay.css 미정의분 보충.
*/

:root {
  --color-background-secondary: #f3f5f7;
  --color-border-tertiary: #e5e7eb;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
}

/* ─── 방송 선택 (인라인) ──────────────────────────── */
.pickme-select-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

/* ─── PickMe 좌측 방송 바 ─────────────────────────── */
.pickme-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.pickme-session-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pickme-session-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.pickme-session-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  word-break: break-all;
}
.pickme-session-bar .btn { flex-shrink: 0; }

.pickme-list-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 0 2px 2px;
}

/* ─── 오타 보정 추천 (검색 0건일 때) ─────────────── */
.pickme-suggest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--color-bg-accent-soft);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-md);
}
.pickme-suggest-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 2px;
}

/* 모바일에서도 우측 상세 노출 (pay는 mobile에서 우측 패널 숨김 — PickMe는 표시) */
@media (max-width: 767px) {
  .pay-pane-right { display: block !important; }
}

/* ─── 상세 헤더 (닉네임 + 캡처 버튼) ──────────────── */
.detail-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.capture-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.capture-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.capture-btn:active { background: var(--color-bg-pressed); }
@media (hover: hover) and (pointer: fine) {
  .capture-btn:hover {
    background: var(--color-bg-accent-soft);
    border-color: var(--color-accent);
  }
}

/* ─── 주문 요약 박스 (pick.css 복사) ─────────────── */
.payment-summary {
  background: #042C53;
  color: #fff;
  border-radius: var(--border-radius-lg);
  padding: 14px 12px;
  margin-bottom: 14px;
}
.payment-summary-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ps-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ps-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.ps-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-value-emphasis {
  background: #fff;
  color: #042C53;
}
.payment-summary-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 14px;
  padding-top: 12px;
}
.payment-summary-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* ─── 배지 (pick.css 복사) ───────────────────────── */
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.badge-sm {
  font-size: 12px;
  padding: 3px 8px;
}
.badge-combined { background: #d4edda; color: #155724; }
.badge-new      { background: #ffe5b4; color: #8a4a00; }
.badge-free     { background: #d1ecf1; color: #0c5460; }
.badge-card     { background: #e2d4f1; color: #4a1d72; }
.badge-gift     { background: #FBEAF0; color: #4B1528; }
.pickme-badge-cancel { background: #f1d4d4; color: #721c24; }

/* ─── 결제 정보 박스 (pick.css 복사) ─────────────── */
.payment-info {
  background: #042C53;
  color: #fff;
  border-radius: var(--border-radius-lg);
  padding: 14px 12px;
  margin-bottom: 14px;
}
.payment-info-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.payment-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 4px;
}
.pi-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pi-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.pi-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 6px;
  background: #fff;
  color: #042C53;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pi-value-account {
  gap: 6px;
  padding: 0 6px;
  font-size: 12px;
}
.pi-value-account span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
}
.copy-btn:active { transform: scale(0.9); }

/* Toast (pick.css 복사) */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 24px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.toast.toast-show { opacity: 1; }

/* ─── 주문 내역 컨테이너 (pick.css 복사) ─────────── */
.orders-container {
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-lg);
  padding: 14px 12px;
}
.orders-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.orders-header {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}
.orders-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.orders-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.orders-tab {
  flex: 1;
  padding: 8px 4px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  background: #fff;
  border: 0.5px solid var(--color-border-tertiary);
  color: var(--color-text-secondary);
  transition: background 0.12s;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .orders-tab:hover { background: #f3f5f7; }
  .orders-tab-active:hover {
    background: #042C53;
    color: #fff;
    border-color: #042C53;
  }
}
.orders-tab:focus { outline: none; }
.orders-tab-active {
  background: #042C53;
  color: #fff;
  border-color: #042C53;
}
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.orders-list::-webkit-scrollbar { width: 4px; }
.orders-list::-webkit-scrollbar-track { background: transparent; }
.orders-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}

/* ─── 주문 카드 (pick.css 복사) ──────────────────── */
.order-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
}
.order-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e9ecef;
  color: #4a4a4a;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-body {
  flex: 1;
  min-width: 0;
}
.order-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.4;
  margin-bottom: 2px;
}
.order-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.order-options {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.order-amount {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: right;
}

/* ─── PC 환경 최적화 (PickMe는 PC 우선 / Pick은 모바일 그대로) ───
   pickme.css는 PickMe 페이지에만 link → pay.css 공유 규칙을 여기서만 덮어씀. */
@media (min-width: 1024px) {
  /* 컨테이너 넓힘 (기본 960 → 1180) */
  .shipping-wrap { max-width: 1180px; }

  /* 좌 고정폭 + 우 넓게. 우측 주문 내역을 한눈에. */
  .pay-split { grid-template-columns: 340px 1fr; gap: 24px; }

  /* 우측 패널 — 화면 높이 활용 */
  .pay-pane-right { top: 80px; max-height: calc(100vh - 48px); }

  /* 주문 6건 정도는 한눈에, 많으면 스크롤 */
  .orders-list { max-height: 56vh; }

  /* PC 기준 폰트/카드 살짝 키움 */
  .order-card { padding: 12px 14px; }
  .order-name { font-size: 15px; }
  .order-amount { font-size: 15px; }
  .order-options { font-size: 13px; }
  .nickname-card-name { font-size: 16px; }

  /* 좌측 닉네임 목록 — 화면 높이 활용 */
  .nickname-list { max-height: calc(100vh - 280px); }
}
