/* 17차-0 펀딩 두 가지 · 선물 바구니 · 펀딩 상세 (회장님 참고 디자인_회장님/장바구니/01_상품목록 · 02_카트 · 03_상품상세)
   색·글꼴·모서리는 우리 규칙 변수 그대로 (style.css · themes.css [data-ptheme]): --card --soft --text --sub --accent --on-accent --accent-ink --accent-soft --radius --track */

/* ---------- 격자 카드 (creator-page.js wishCardHtml) ---------- */
.cp-w-ph { position: relative; }
.cp-w-ph.sq { aspect-ratio: 1 / 1; }
.cp-w-go { display: block; width: 100%; height: 100%; }
.cp-w-go:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.cp-stock { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; font-size: 12px; font-weight: 800; line-height: 1.5; border-radius: 999px; background-color: #FFFFFF; color: #111111; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); pointer-events: none; }
.cp-w.out .cp-stock { background-color: #111111; color: #FFFFFF; }
.cp-w.out .cp-w-ph img { opacity: .55; }
.cp-w-n { margin: 4px 12px 0; font-size: 13px; line-height: 1.45; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-w-pr { margin: 6px 12px 0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cp-w.fixed { padding-bottom: 0; }
.cp-w .cp-wcart { margin: auto 12px 12px; margin-top: 10px; }
:root main.creator-page .cp-w .cp-wcart, :root .wd .cp-wcart { height: 44px; font-size: 13px; font-weight: 800; border-radius: 999px; }
:root main.creator-page .cp-w .cp-wcart.in, :root .wd .cp-wcart.in { background-color: var(--soft); color: var(--text); }
.cp-give { margin: 10px 12px 12px; display: grid; gap: 6px; }
.cp-lf { position: relative; display: block; }
.cp-lf > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; }
:root .cp-lf .cp-leaf { width: 100%; height: 40px; padding: 0 10px 0 32px; font-size: 14px; font-weight: 700; border-radius: var(--radius); font-variant-numeric: tabular-nums; }
:root main.creator-page .cp-give .cp-wpay { width: 100%; margin: 0; height: 40px; }
/* 본인: 사진 위 아이콘 (수정 · 삭제 · … 왼쪽 / 순서 이동 오른쪽) */
.cp-own { position: absolute; inset: 8px 8px auto 8px; display: flex; gap: 6px; }
.cp-ic { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background-color: rgba(255, 255, 255, .86); color: #111111; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.cp-ic:hover { background-color: #FFFFFF; }
.cp-ic-move { margin-left: auto; }
/* 본인: 맨 앞 점선 카드 "+ 펀딩 추가" */
.cp-w-add { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 12px; border: 2px dashed var(--accent); background-color: transparent; color: var(--text); text-decoration: none; }
.cp-w-plus { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; font-size: 30px; line-height: 1; background-color: var(--accent); color: var(--on-accent); }
.cp-w-add b { font-size: 16px; }
/* 펀딩 머리줄: 선물 바구니 버튼 */
.cp-hrow { align-items: center; }
.cp-hrow .cp-h { margin-right: auto; }
.cp-cartbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 800; background-color: var(--soft); color: var(--text); cursor: pointer; }
.cp-cartn { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 12px; background-color: var(--accent); color: var(--on-accent); font-variant-numeric: tabular-nums; }

/* ---------- 선물 바구니 서랍 (PC 오른쪽 · 폰 아래 시트) ---------- */
.cart-bg { position: fixed; inset: 0; z-index: 90; background-color: rgba(0, 0, 0, .38); animation: cartFade .2s ease both; }
.cart { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background-color: var(--bg, var(--card)); color: var(--text); box-shadow: -8px 0 32px rgba(0, 0, 0, .18); animation: cartIn .24s cubic-bezier(.2, .8, .2, 1) both; outline: none; overflow: hidden; }
.cart-bg.out { animation: cartFade .2s ease reverse both; }
.cart-bg.out .cart { animation: cartIn .2s ease reverse both; }
@keyframes cartIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes cartFade { from { opacity: 0; } to { opacity: 1; } }
body.cart-open { overflow: hidden; }
.cart-grab { display: none; }
.cart-head { display: flex; align-items: center; gap: 10px; padding: 24px 24px 4px; }
.cart-head h2 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; }
.cart-n { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background-color: var(--accent); color: var(--on-accent); }
.cart-x { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background-color: var(--soft); color: var(--text); font-size: 16px; cursor: pointer; }
.cart-to { margin: 4px 24px 12px; font-size: 16px; color: var(--sub); }
.cart-list { list-style: none; margin: 0; padding: 0 24px; overflow-y: auto; flex: 1; }
.cart-it { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line, rgba(127, 127, 127, .2)); }
.cart-ph { width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; background-color: var(--soft); }
.cart-b { min-width: 0; display: grid; gap: 4px; align-content: start; }
.cart-r { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cart-t { font-size: 16px; line-height: 1.35; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-p { flex: none; font-size: 16px; font-variant-numeric: tabular-nums; }
.cart-d { margin: 0; font-size: 13px; line-height: 1.45; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-rm { padding: 4px 0; border: 0; background: none; font-size: 14px; font-weight: 800; color: var(--accent-ink); cursor: pointer; }
.cart-k { font-size: 13px; color: var(--sub); }
.cart-empty { flex: 1; display: grid; place-content: center; text-align: center; gap: 6px; padding: 32px 24px; color: var(--sub); }
.cart-empty b { color: var(--text); font-size: 16px; }
.cart-empty p { margin: 0; font-size: 14px; }
.cart-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line, rgba(127, 127, 127, .2)); display: grid; gap: 14px; }
.cart-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; font-weight: 800; }
.cart-sum b { font-variant-numeric: tabular-nums; }
:root .cart-go { height: 56px; font-size: 18px; font-weight: 800; border-radius: 999px; }
.cart-err { margin: 0; min-height: 0; font-size: 13px; color: var(--danger, #D33); }
.cart-err:empty { display: none; }
@media (max-width: 768px) {
  .cart { top: auto; left: 0; width: 100%; max-height: 86vh; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 32px rgba(0, 0, 0, .2); animation-name: cartUp; padding-bottom: env(safe-area-inset-bottom); }
  .cart-bg.out .cart { animation-name: cartUp; }
  @keyframes cartUp { from { transform: translateY(100%); } to { transform: none; } }
  .cart-grab { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background-color: var(--track, rgba(127, 127, 127, .4)); }
  .cart-head { padding: 12px 16px 2px; }
  .cart-head h2 { font-size: 22px; }
  .cart-to { margin: 2px 16px 8px; }
  .cart-list { padding: 0 16px; }
  .cart-foot { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .cart, .cart-bg, .cart-bg.out, .cart-bg.out .cart { animation: none; } }

/* ---------- 펀딩 상세 /p/w/:id (PC 왼쪽 큰 사진 · 오른쪽 정보 / 폰 사진 위 · 정보 아래) ---------- */
.wd { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 16px; }
.wd-ph { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background-color: var(--soft); }
.wd-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wd-ph .cp-stock { left: 14px; bottom: 14px; font-size: 13px; }
.wd-info { display: grid; gap: 12px; align-content: start; }
.wd-who { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--sub); text-decoration: none; }
.wd-t { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 800; }
.wd-pr { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wd-kind { padding: 3px 12px; font-size: 13px; font-weight: 800; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--accent-ink); }
.wd-dh { margin: 4px 0 0; font-size: 15px; font-weight: 800; }
.wd-d { margin: 0; font-size: 16px; line-height: 1.55; font-style: italic; color: var(--sub); }
.wd-own { display: flex; gap: 8px; }
:root .wd-own .btn { height: 40px; padding: 0 14px; font-size: 14px; font-weight: 800; background-color: var(--soft); color: var(--text); border-radius: 999px; }
:root .wd .cp-wcart, :root .wd .cp-wpay, :root .wd .wd-buy { width: 100%; height: 52px; font-size: 16px; font-weight: 800; border-radius: 999px; }
:root .wd .wd-buy { background-color: var(--soft); color: var(--text); }
.wd .cp-give { margin: 0; grid-template-columns: minmax(0, 1fr) auto; }
:root .wd .cp-give .cp-wpay { width: auto; padding: 0 24px; height: 48px; }
:root .wd .cp-lf .cp-leaf { height: 48px; font-size: 16px; }
.wd .cp-bar { height: 8px; }
.wd-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--sub); font-variant-numeric: tabular-nums; }
.wd-share { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 4px; font-size: 14px; font-weight: 700; color: var(--sub); }
:root .wd-share .btn { height: 40px; padding: 0 14px; font-size: 14px; font-weight: 800; border-radius: 999px; }
.wd-back { font-size: 14px; font-weight: 800; color: var(--accent-ink); text-decoration: none; }
.wd-cart { margin-left: auto; }
@media (min-width: 1024px) { :root main.creator-page .cp-w .cp-wcart { font-size: 16px; } }
@media (min-width: 900px) {
  .wd { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; padding-top: 24px; }
  .wd-t { font-size: 34px; }
}

/* ---------- 펀딩 탭(app.js renderWish) 정해진 금액 카드 · 모으기 직접 입력 ---------- */
.wish.fixed .pic { aspect-ratio: 1 / 1; }
.wish .wnote { font-size: 13px; line-height: 1.45; color: var(--sub); font-style: italic; }
.wish .wprice { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wish .wleaf { width: 100%; }
.wish .fx-act { display: grid; gap: 6px; margin-top: 8px; }
.wish .fx-act .btn { width: 100%; }

/* ---------- 스튜디오 펀딩 폼: 유형 고르기 ---------- */
.wk-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wk-pick label { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius); background-color: var(--soft); cursor: pointer; border: 2px solid transparent; }
.wk-pick label:has(input:checked) { border-color: var(--accent); background-color: var(--accent-soft); }
.wk-pick input { position: absolute; opacity: 0; pointer-events: none; }
.wk-pick b { font-size: 15px; }
.wk-pick span { font-size: 12px; color: var(--sub); }
.wk-fixed-only[hidden] { display: none; }

/* ---------- 설정: 화면 모드 ---------- */
.tm-pick { display: grid; gap: 8px; }
.tm-pick label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: var(--radius); background-color: var(--soft); cursor: pointer; font-weight: 700; }
.tm-pick label:has(input:checked) { outline: 2px solid var(--accent); background-color: var(--accent-soft); }
