/* ── 리턴즈 RETURNS 디자인 시스템 ─────────────────────────────
   소재: 영수증 종이 · 검수 도장 · CU 계산대
   디스플레이 Gmarket Sans / 본문 Pretendard / 코드 IBM Plex Mono */

@font-face {
  font-family: 'GmarketSans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'GmarketSans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
  font-weight: 700; font-display: swap;
}
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  --ink: #141714; --ink-2: #4a524b; --ink-3: #7c867d;
  --paper: #f7f8f5; --card: #ffffff; --line: #e3e7e1;
  --pine: #0b5c3f; --pine-deep: #07422d; --pine-tint: #e7f1eb; --pine-bright: #19a66b;
  --flame: #e0492b; --flame-tint: #fdeeea;
  --g-s: #0b5c3f; --g-a: #2e7d5b; --g-b: #9a7b1e; --g-c: #96522b;
  --r: 14px;
  --disp: 'GmarketSans', 'Pretendard Variable', sans-serif;
  --body: 'Pretendard Variable', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  /* 구 팔레트 별칭 (어드민/데모 허브 공용) */
  --bg: var(--paper); --sub: var(--ink-3); --brand: var(--pine); --brand-ink: #fff;
  --green: #16a34a; --amber: #b45309; --blue: #1d4ed8; --red: var(--flame);
  --purple: #6d28d9; --teal: #0f766e; --gray: var(--ink-3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); line-height: 1.55;
  font-feature-settings: 'tnum';
}

/* ── 공통 헤더 ── */
header.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 20px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
header.topbar h1 { font-size: 17px; margin: 0; font-family: var(--disp); font-weight: 700; letter-spacing: -.01em; }
header.topbar .tag { font-size: 12px; color: var(--ink-3); }
header.topbar nav { margin-left: auto; display: flex; gap: 14px; font-size: 14px; align-items: center; }
header.topbar a { color: var(--ink-2); text-decoration: none; }
header.topbar a:hover { color: var(--ink); }

/* 리턴즈 워드마크 */
.wordmark { display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none; color: var(--ink); }
.wordmark .logo {
  font-family: var(--disp); font-weight: 700; font-size: 19px; letter-spacing: .02em;
  color: var(--pine);
}
.wordmark .logo .arrow { display: inline-block; transform: scaleX(-1); margin-right: 1px; }
.wordmark .ko { font-size: 12.5px; color: var(--ink-3); letter-spacing: .18em; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 72px; }
main.narrow { max-width: 500px; }

/* ── 고객: 카탈로그 히어로 ── */
.hero { padding: 30px 2px 22px; }
.hero .eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em;
  color: var(--pine); text-transform: uppercase;
}
.hero h2 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(23px, 5.4vw, 34px);
  line-height: 1.28; letter-spacing: -.015em; margin: 10px 0 8px;
}
.hero h2 em { font-style: normal; color: var(--pine); }
.hero p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* ── 상품 카드 ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; } }
.item-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: inherit; display: block; position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.item-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(11, 92, 63, .10); }
.item-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--pine-tint); display: block; }
.item-card .body { padding: 12px 13px 14px; }
.item-card .title {
  font-size: 14px; font-weight: 600; margin: 7px 0 9px; line-height: 1.4; min-height: 2.8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 검수 등급 스탬프 — 시그니처 */
.stamp {
  position: absolute; top: 10px; left: 10px; width: 46px; height: 46px;
  border: 2.5px solid var(--g-a); border-radius: 10px; background: rgba(255, 255, 255, .93);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-5deg); color: var(--g-a);
}
.stamp b { font-family: var(--disp); font-weight: 700; font-size: 19px; line-height: 1; }
.stamp small { font-size: 8.5px; letter-spacing: .2em; margin-top: 1px; }
.stamp.g-S { border-color: var(--g-s); color: var(--g-s); }
.stamp.g-A { border-color: var(--g-a); color: var(--g-a); }
.stamp.g-B { border-color: var(--g-b); color: var(--g-b); }
.stamp.g-C { border-color: var(--g-c); color: var(--g-c); }
.stamp.inline { position: static; transform: rotate(-4deg); flex: none; }

/* 가격 블록 */
.price { line-height: 1.2; }
.price .cut { display: block; color: var(--ink-3); text-decoration: line-through; font-size: 12px; margin-bottom: 3px; }
.price .now { font-family: var(--disp); font-weight: 700; font-size: 17.5px; letter-spacing: -.01em; }
.price .pct { color: var(--flame); font-weight: 700; font-size: 14px; margin-right: 5px; }
.price .orig { color: var(--sub); text-decoration: line-through; font-weight: 400; font-size: 12px; margin-right: 6px; }

/* ── 상품 상세 ── */
.detail-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); background: var(--pine-tint); display: block; }
.detail-head { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; }
.detail-head h2 { font-family: var(--disp); font-weight: 700; font-size: 20px; line-height: 1.35; margin: 0; letter-spacing: -.01em; flex: 1; }

/* 검수 리포트 패널 */
.report {
  margin-top: 14px; background: var(--pine-tint); border-radius: var(--r);
  padding: 13px 15px; font-size: 13.5px; color: var(--pine-deep);
}
.report .rt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; margin-bottom: 4px; color: var(--pine); }

/* 폼 */
label { font-size: 12.5px; color: var(--ink-2); display: block; margin: 12px 0 5px; font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 15px; padding: 11px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--card); width: 100%; color: var(--ink);
  transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: var(--pine); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  transition: filter .12s, transform .05s;
}
button:hover { filter: brightness(.97); }
button:active { transform: translateY(1px); }
button.primary { background: var(--pine); border-color: var(--pine); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.cta { width: 100%; padding: 15px; font-size: 16px; font-family: var(--disp); font-weight: 700; border-radius: 13px; }
button.small { font-size: 12.5px; padding: 5px 11px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2.5px solid var(--pine-bright); outline-offset: 1px; }

/* ── 티켓 (결제 바코드) — 시그니처 ── */
.ticket { filter: drop-shadow(0 8px 22px rgba(20, 23, 20, .10)); margin-top: 16px; }
.ticket .t-top {
  background: var(--card); border-radius: var(--r) var(--r) 0 0; padding: 18px 20px 14px;
}
.ticket .t-perf {
  background: var(--card); height: 26px; position: relative;
  -webkit-mask: radial-gradient(circle 13px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 13px at 100% 50%, transparent 98%, #000) right / 50% 100% no-repeat;
          mask: radial-gradient(circle 13px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 13px at 100% 50%, transparent 98%, #000) right / 50% 100% no-repeat;
}
.ticket .t-perf::after {
  content: ''; position: absolute; left: 22px; right: 22px; top: 50%;
  border-top: 2px dashed var(--line);
}
.ticket .t-bottom {
  background: var(--card); border-radius: 0 0 var(--r) var(--r); padding: 14px 20px 22px; text-align: center;
}
.ticket .t-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket .t-name { font-family: var(--disp); font-weight: 700; font-size: 16px; line-height: 1.35; }
.ticket .t-row { color: var(--ink-2); font-size: 13px; margin-top: 6px; }
#barcode-wrap { padding: 6px 0 2px; }
#barcode { max-width: 100%; }
.code-text { font-family: var(--mono); letter-spacing: .22em; color: var(--ink-2); font-size: 13px; }

/* 배송 단계 타임라인 */
.steps { display: flex; margin: 20px 2px 6px; }
.steps .st { flex: 1; text-align: center; position: relative; }
.steps .st::before {
  content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 2.5px;
  background: var(--line);
}
.steps .st:first-child::before { display: none; }
.steps .st .dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--card);
  border: 2.5px solid var(--line); margin: 0 auto; position: relative; z-index: 1;
}
.steps .st .lb { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.steps .st.done::before, .steps .st.now::before { background: var(--pine); }
.steps .st.done .dot { background: var(--pine); border-color: var(--pine); }
.steps .st.now .dot { border-color: var(--pine); background: var(--pine-tint); }
.steps .st.now .lb, .steps .st.done .lb { color: var(--pine-deep); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .steps .st.now .dot { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(11, 92, 63, .14); } }
}

.statusline { font-size: 14.5px; padding: 13px 15px; border-radius: 11px; background: #eef0ec; }
.statusline.ok { background: var(--pine-tint); color: var(--pine-deep); }
.statusline.warn { background: #fdf3e0; color: #7c5a12; }
.statusline.info { background: #e8eefc; color: #1e3a8a; }

/* ── POS 단말 (CU 파트너) ── */
body.pos { background: #20261f; color: #e8ece7; }
body.pos header.topbar { background: #1a1f19; border-color: #313a30; }
body.pos header.topbar h1, body.pos header.topbar a { color: #e8ece7; }
body.pos .tag { color: #8d998c; }
.pos-panel {
  background: #2a322a; border: 1px solid #3a453a; border-radius: var(--r);
  padding: 20px; margin-bottom: 16px;
}
body.pos label { color: #aab6a8; }
body.pos input, body.pos select {
  background: #1e241d; border-color: #3a453a; color: #e8ece7;
}
body.pos input:focus, body.pos select:focus { border-color: var(--pine-bright); }
body.pos input[readonly] { background: #242b23; color: #8d998c; font-family: var(--mono); }
.pos-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
@media (min-width: 560px) { .pos-actions { grid-template-columns: 1.3fr 1fr 1fr; } }
.pos-actions button { padding: 15px 12px; font-size: 15px; border-radius: 12px; font-family: var(--disp); font-weight: 700; }
.pb-approve { background: var(--pine-bright); border-color: var(--pine-bright); color: #0c130c; }
.pb-capture { background: #e8ece7; border-color: #e8ece7; color: #16341f; }
.pb-void { background: transparent; border-color: #6b4438; color: #f0a08c; }
.pos-log {
  background: #f4f2ea; color: #2c2f2a; font-family: var(--mono); font-size: 12.5px;
  border-radius: 10px; padding: 15px 16px; white-space: pre-wrap; max-height: 330px;
  overflow: auto; line-height: 1.75; border-top: 6px solid var(--pine);
}

/* ── 어드민/데모 공용 (레거시 클래스 유지) ── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; margin-bottom: 16px;
}
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; color: #fff; vertical-align: middle;
}
.badge.grade { background: var(--ink); }
.b-REGISTERED, .b-EXPIRED, .b-DELISTED { background: var(--gray); }
.b-LISTED { background: var(--green); }
.b-HELD, .b-HOLD { background: var(--amber); }
.b-SOLD, .b-CONFIRMED { background: var(--blue); }
.b-SHIPPED { background: var(--purple); }
.b-ARRIVED { background: var(--teal); }
.b-PICKED_UP, .b-DELIVERED { background: #374151; }
.b-CANCELLED { background: var(--red); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 600; font-size: 12px; white-space: nowrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border-radius: 999px; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.muted { color: var(--ink-3); font-size: 13px; }
.log {
  background: #10140f; color: #cfe8d2; font-family: var(--mono);
  font-size: 12px; border-radius: 10px; padding: 14px; white-space: pre-wrap;
  max-height: 320px; overflow: auto;
}
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.hub a.card { text-decoration: none; color: inherit; margin: 0; transition: transform .15s, box-shadow .15s; }
.hub a.card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11, 92, 63, .10); }
.hub .emoji { font-size: 30px; }
.hub h3 { margin: 8px 0 4px; font-family: var(--disp); }
.flow {
  background: #10140f; color: #dbe4da; font-family: var(--mono);
  font-size: 12.5px; border-radius: 12px; padding: 18px; overflow-x: auto; line-height: 1.7;
}
