/* 심플 이즈 베스트: 흰 바탕, 검은 글자, 얇은 선, 사진이 주인공 */
:root {
  --ink: #111111;
  --muted: #767676;
  --line: #ececec;
  --bg: #ffffff;
  --soft: #f6f6f6;
  --accent: #111111;
  --on-accent: #ffffff;
  --danger: #c0392b;
  --warn: #9a6200;
  --ok: #1e7b45;
  --radius: 4px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Hiragino Sans", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 26px; line-height: 1.3; }
h2 { font-size: 18px; line-height: 1.4; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
code { background: var(--soft); padding: 1px 6px; border-radius: 3px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1280px; }
.narrow { max-width: 420px; }
.mid { max-width: 720px; }
.page-pad { padding-top: 40px; padding-bottom: 80px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-line; }
.lead { color: var(--muted); font-size: 17px; }
.empty { padding: 64px 0; text-align: center; color: var(--muted); }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .error-text { color: var(--danger); }

/* 상단 */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.nav { display: flex; gap: 20px; font-size: 14px; overflow-x: auto; white-space: nowrap; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 24px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .88; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.kakao { background: #fee500; border-color: #fee500; color: #191919; }
.btn.google { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.linkish { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.linkish.danger { color: var(--danger); }

/* 폼 */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field.inline { flex-direction: row; align-items: center; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d4d4d4; border-radius: var(--radius);
  background: #fff; color: var(--ink); font: inherit; font-weight: 400;
}
textarea { min-height: 0; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--ink); }
input[type=file] { border-style: dashed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
.qty { width: 72px; }
.choice { display: flex; align-items: center; gap: 8px; font-size: 15px; }
fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding: 0 6px; font-weight: 600; }
.field-static { font-size: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.flashes { padding-top: 16px; }
.flash { padding: 12px 16px; border-radius: var(--radius); background: var(--soft); font-size: 14px; }
.flash + .flash { margin-top: 8px; }
.flash.error { background: #fdf1f0; color: var(--danger); }
.flash.ok { background: #eef7f1; color: var(--ok); }
.notice { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); font-size: 14px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }

/* 메인 */
.hero { padding-top: 72px; padding-bottom: 24px; }
.hero h1 { font-size: 40px; letter-spacing: -0.04em; }
.hero .lead { margin-top: 8px; }
.section-title { margin-bottom: 24px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 20px; margin: 0; padding: 0; list-style: none; }
.card a { display: block; text-decoration: none; }
.thumb { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card a:hover .thumb img { transform: scale(1.03); }
.tag { position: absolute; left: 10px; top: 10px; padding: 2px 8px; background: #fff; font-size: 12px; }
.card .name { margin-top: 12px; font-size: 14px; }
.card .price { margin-top: 2px; font-size: 14px; }
s { font-weight: 400; }

/* 상품 상세 */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.gallery-main { aspect-ratio: 1; background: var(--soft); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumb-btn { flex: 0 0 64px; height: 64px; padding: 0; border: 1px solid transparent; background: var(--soft); cursor: pointer; }
.thumb-btn.on { border-color: var(--ink); }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.buy { position: sticky; top: 84px; }
.buy > * + * { margin-top: 14px; }
.price.big { font-size: 22px; }
.off { color: var(--danger); font-weight: 600; }
.soldout { padding: 14px; background: var(--soft); text-align: center; color: var(--muted); }
.detail { max-width: 860px; padding-bottom: 96px; }
.detail .desc { padding: 48px 0; border-top: 1px solid var(--line); white-space: pre-line; font-size: 15px; line-height: 1.9; }
.detail img { margin: 0 auto; }

/* 장바구니·주문 */
.lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.line { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.lines.compact .line { padding: 10px 0; }
.line-img { flex: 0 0 72px; height: 72px; background: var(--soft); }
.line-img img { width: 72px; height: 72px; object-fit: cover; }
.line-body { flex: 1; min-width: 0; }
.line-body > * + * { margin-top: 6px; }
.line-price { text-align: right; white-space: nowrap; font-weight: 600; }
.summary { width: 100%; border-collapse: collapse; font-size: 15px; }
.summary th { padding: 8px 0; text-align: left; font-weight: 400; color: var(--muted); vertical-align: top; width: 34%; }
.summary td { padding: 8px 0; text-align: right; }
.summary tr.total th, .summary tr.total td { padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-size: 18px; font-weight: 700; }
.status { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; white-space: nowrap; }
.s-paid, .s-preparing, .s-published { border-color: var(--ok); color: var(--ok); }
.s-shipped, .s-delivered { border-color: var(--ink); }
.s-pending, .s-approving, .s-refund_requested, .s-draft { border-color: var(--warn); color: var(--warn); }
.s-failed, .s-cancelled, .s-expired, .s-refunded, .s-hidden { color: var(--muted); }
.prose h2 { margin-top: 32px; }
.prose p { color: #333; }

.footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer p + p { margin-top: 4px; }
.footer .links { display: flex; gap: 16px; margin-bottom: 12px; font-size: 13px; color: var(--ink); }

/* 관리자 */
body.admin { background: #fafafa; }
body.admin .panel { background: #fff; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; font-size: 13px; }
.seg a { padding: 8px 14px; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--ink); color: #fff; }
.wrap-seg { flex-wrap: wrap; }
.todo { display: flex; gap: 12px; flex-wrap: wrap; }
.todo a { padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 14px; }
.todo strong { margin-left: 6px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.kpi p { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; margin-top: 4px; font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 12px; }
.funnel { margin: 0; padding: 20px; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.funnel li { display: grid; grid-template-columns: 90px 1fr 80px 60px; gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.track { height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; background: var(--ink); }
.funnel .count, .funnel .rate { text-align: right; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th, .data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data thead th { background: #fafafa; color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.data .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data tr:last-child td { border-bottom: 0; }
.thumb-cell img { width: 48px; height: 48px; object-fit: cover; }
.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.form-grid aside { position: sticky; top: 76px; }
.image-list { margin: 0; padding: 0; list-style: none; }
.image-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.image-list img { width: 72px; height: 72px; object-fit: cover; }
.serp { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); font-family: Arial, sans-serif; }
.serp-url { color: #202124; font-size: 12px; }
.serp-title { margin-top: 4px; color: #1a0dab; font-size: 18px; line-height: 1.3; }
.serp-desc { margin-top: 4px; color: #4d5156; font-size: 13px; line-height: 1.5; }
.actions { display: flex; flex-direction: column; gap: 12px; }
.steps { margin: 0; padding-left: 18px; }
.steps li + li { margin-top: 6px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .product { grid-template-columns: 1fr; gap: 24px; }
  .buy { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols, .form-grid { grid-template-columns: 1fr; }
  .form-grid aside { position: static; }
  .row3 { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 30px; }
  .nav { gap: 14px; }
  .funnel li { grid-template-columns: 70px 1fr 56px 48px; gap: 8px; }
}

/* 스마트스토어 상세 형식: 가운데 정렬 글과 이미지가 순서대로 이어진다 */
.naver-detail { max-width: 860px; margin: 0 auto; padding: 40px 0; border-top: 1px solid var(--line); text-align: center; }
.naver-detail p { margin: 24px 0; white-space: pre-line; font-size: 15px; line-height: 1.9; }
.naver-detail img { margin: 0 auto; }
