/* 심플 이즈 베스트: 흰 바탕, 검은 글자, 얇은 선, 사진이 주인공 */
: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 { display: flex; align-items: center; font-size: 19px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.brand img { height: 40px; width: auto; }
@media (max-width: 600px) { .brand img { height: 32px; } }
.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; }

/* 메인 배너 */
.hero-banner { position: relative; background: var(--soft); overflow: hidden; }
.hero-banner .slide { display: none; }
.hero-banner .slide.on { display: block; }
.hero-banner img { width: 100%; height: auto; max-height: 640px; object-fit: cover; margin: 0 auto; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.8); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.slide-nav.prev { left: 16px; }
.slide-nav.next { right: 16px; }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer; }
.dot.on { background: #fff; width: 22px; border-radius: 4px; }

/* 메인 섹션·카테고리·정렬 */
.home-section { padding-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { font-size: 22px; }
.section-head .more { color: var(--muted); font-size: 14px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 24px; }
.cat-chips a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; white-space: nowrap; }
.cat-chips a:hover { text-decoration: none; border-color: var(--ink); }
.cat-chips a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.list-title { font-size: 24px; }
.sort-bar { display: flex; gap: 16px; flex-wrap: wrap; margin: 20px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.sort-bar a.on { color: var(--ink); font-weight: 600; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 48px; }
.pager a { min-width: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; font-size: 14px; }
.pager a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.card .price .off { margin-right: 2px; }

/* 관리자: 일괄 작업 줄, 배너 */
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.bulk-bar select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; }
.bulk-bar .sep { width: 1px; height: 20px; background: var(--line); }
.banner-row { display: flex; gap: 16px; align-items: flex-start; }
.banner-preview { width: 240px; max-height: 120px; object-fit: cover; border: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
.nowrap form { display: inline-flex; margin: 0 0 4px; }
@media (max-width: 900px) {
  .banner-row { flex-direction: column; }
  .banner-preview { width: 100%; }
  .slide-nav { display: none; }
}

/* 인스타그램 후기 */
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.review a { display: block; text-decoration: none; }
.review .thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-caption { margin-top: 12px; font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.review-meta { margin-top: 6px; }
.review-admin { margin: 0; padding: 0; list-style: none; }
.review-admin li { display: flex; gap: 16px; align-items: flex-start; }
.review-admin li + li { margin-top: 12px; }
.review-admin img { width: 120px; height: 120px; object-fit: cover; }
.review-admin .clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.author-input { width: 160px; min-height: 34px; padding: 4px 8px; font-size: 13px; }
@media (max-width: 900px) {
  .review-grid { grid-template-columns: 1fr; gap: 28px; }
  .review-admin li { flex-direction: column; }
}

/* 헤더 카테고리 메뉴(스마트스토어처럼) */
.menu-bar { border-top: 1px solid var(--line); }
.menu { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 auto; list-style: none; }
.menu::-webkit-scrollbar { display: none; }
.menu > li { position: relative; flex: 0 0 auto; }
.menu > li > a { display: flex; align-items: center; gap: 4px; padding: 12px 14px; font-size: 15px; white-space: nowrap; }
.menu > li > a:hover { text-decoration: none; }
.menu > li.on > a { font-weight: 700; box-shadow: inset 0 -2px 0 var(--ink); }
.menu .caret { font-size: 12px; color: var(--muted); }
.menu .sub { display: none; position: absolute; left: 0; top: 100%; z-index: 20; min-width: 180px; margin: 0; padding: 8px 0; list-style: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.menu .sub a { display: block; padding: 8px 16px; font-size: 14px; white-space: nowrap; }
.menu .has-sub:hover .sub, .menu .has-sub:focus-within .sub { display: block; }
.crumb { margin-bottom: 6px; color: var(--muted); }
/* 관리자: 상품 지정 목록 */
.pick-list { margin: 0; padding: 0; list-style: none; max-height: 70vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pick-list li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pick-list li:last-child { border-bottom: 0; }
.pick-list img { width: 44px; height: 44px; object-fit: cover; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; }
.sub-row td:first-child { padding-left: 28px; }
@media (max-width: 900px) {
  /* 휴대폰: 메뉴는 옆으로 밀어 보고, 하위 메뉴는 카테고리 화면의 버튼으로 고른다 */
  .menu { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .menu .sub { display: none !important; }
}

/* 유튜브 */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.video-thumb, .video-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: var(--soft); cursor: pointer; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play { position: absolute; left: 50%; top: 50%; width: 56px; height: 40px; margin: -20px 0 0 -28px; border-radius: 10px; background: rgba(0,0,0,.72); }
.video-thumb .play::after { content: ""; position: absolute; left: 23px; top: 12px; border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff; }
.video-thumb:hover .play { background: #ff0033; }
.video-title { display: -webkit-box; margin-top: 10px; font-size: 14px; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.youtube { padding-bottom: 32px; }
@media (max-width: 900px) { .video-grid { grid-template-columns: 1fr; } }
.otp-qr { width: 220px; height: 220px; border: 1px solid var(--line); }
.big-code { font-size: 18px; padding: 4px 10px; letter-spacing: .05em; }
