:root {
  --bg: #faf7f5;
  --surface: #ffffff;
  --ink: #1d1a19;
  --muted: #6f6763;
  --line: #ebe4e0;
  --accent: #e8494f;
  --accent-ink: #ffffff;
  --accent-soft: #fdecec;
  --ok: #1f8a5b;
  --ok-soft: #e6f5ee;
  --warn: #a86400;
  --warn-soft: #fff3df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 26, 25, 0.04), 0 6px 24px rgba(29, 26, 25, 0.06);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { line-height: 1.55; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(250, 247, 245, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 18px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* hero */
.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.2; letter-spacing: -0.03em; margin: 0 0 12px; }
.hero p { color: var(--muted); margin: 0; font-size: 17px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 8px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14px; }
.step b { display: block; font-size: 15px; margin-bottom: 2px; }
.step .n { color: var(--accent); font-weight: 800; margin-right: 6px; }

/* products */
.section-title { font-size: 20px; margin: 36px 0 14px; letter-spacing: -0.02em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.card.has-thumb { padding: 0; overflow: hidden; }
.card.has-thumb .card-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.thumb { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: #111; }
.card .price small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.opt-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.opt-tag { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.opt-tag.out { text-decoration: line-through; opacity: .6; }

/* order dialog options */
.o-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.o-head img { border-radius: 12px; object-fit: cover; background: #111; }
.o-head img[src=""], .o-head img:not([src]) { display: none; }
.o-head b { font-size: 17px; letter-spacing: -0.02em; }
fieldset.opts { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.opts legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.opt-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.opt { position: relative; display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt b { font-size: 15px; }
.opt span { font-size: 14px; color: var(--muted); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:checked) span { color: var(--accent); font-weight: 700; }
.opt:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }
.opt.out { cursor: not-allowed; opacity: .5; }
.opt em { font-style: normal; font-size: 12px; color: var(--accent); font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price strong { font-size: 24px; letter-spacing: -0.02em; }
.price s { color: var(--muted); font-size: 14px; }
.stock { font-size: 13px; color: var(--muted); }
.stock.out { color: var(--accent); font-weight: 600; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:hover { filter: brightness(0.96); }
.btn:disabled { background: #d9d2ce; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.ok { background: var(--ok); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0 16px; }
.check input { margin-top: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.narrow { max-width: 520px; margin: 40px auto; }

.notice { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.notice.error { background: var(--accent-soft); color: #a3262b; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.hidden { display: none !important; }

/* dialog */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
dialog::backdrop { background: rgba(29, 26, 25, 0.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 22px; max-height: 75vh; overflow: auto; }
.icon-btn { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

.summary { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 18px; font-size: 14px; }
.summary div { display: flex; justify-content: space-between; padding: 3px 0; }
.summary .total { font-weight: 800; font-size: 16px; }
.bankbox { border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; background: #fff; }
.bankbox .acct { font-size: 18px; font-weight: 800; letter-spacing: 0.02em; }

.code-box { display: flex; gap: 8px; align-items: center; background: var(--ok-soft); border-radius: 10px; padding: 12px; margin-top: 10px; }
.code-box code { flex: 1; font-size: 16px; font-weight: 700; word-break: break-all; }

.order-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 12px; }
.order-item .row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); }
.status.pending { background: var(--warn-soft); color: var(--warn); }
.status.paid { background: #e8f0ff; color: #2a57c9; }
.status.delivered { background: var(--ok-soft); color: var(--ok); }
.status.cancelled { background: #eee; color: #777; }

/* footer */
.site-footer { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.site-footer a { margin-right: 14px; }
.site-footer .biz { margin-top: 10px; }

/* admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.tabs button { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { background: var(--bg); font-weight: 700; color: var(--muted); font-size: 12.5px; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; max-width: 260px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 720px) {
  .steps, .two-col { grid-template-columns: 1fr; }
  .nav { gap: 12px; font-size: 14px; }
  .hero { padding-top: 36px; }
}

/* card links */
.card-link { text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card a.btn { margin-top: auto; }

/* product page */
.back-link { display: inline-block; margin-top: 24px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
.pd-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin: 20px 0 8px; align-items: start; }
.pd-media img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; background: #111; box-shadow: var(--shadow); }
.pd-info { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.pd-info h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.25; letter-spacing: -0.03em; }
.pd-desc { margin: 0; color: var(--muted); }
.pd-info fieldset.opts { margin: 6px 0 0; }
.pd-buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pd-price { font-size: 28px; letter-spacing: -0.02em; }
.pd-buy .btn { min-width: 140px; padding: 14px 22px; font-size: 16px; }
.pd-facts { margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); display: grid; gap: 4px; }
.pd-facts li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }

.pd-detail { max-width: 760px; margin: 48px auto 0; display: grid; gap: 20px; }
.pd-section { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.pd-section h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.pd-section h3 { margin: 18px 0 8px; font-size: 15px; }
.pd-section h2 + h3 { margin-top: 12px; }
.pd-section p { margin: 0 0 12px; color: var(--muted); }
.pd-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.pd-steps li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--bg); font-weight: 600; }
.pd-steps .n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; }
.pd-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.pd-section.warn { background: var(--warn-soft); border-color: #f3dcb2; }
.pd-section.warn h2 { color: var(--warn); }
.pd-section.warn h2::before { content: "※ "; }

.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); transform: translateY(100%); transition: transform .2s ease; }
.buybar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.buybar-info { display: flex; flex-direction: column; min-width: 0; }
.buybar-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar-info span { font-size: 13px; color: var(--muted); }
.buybar .btn { flex: none; min-width: 120px; }
.buybar #bb-talk { min-width: 64px; }
body.buybar-on .buybar { transform: none; }
body.has-buybar .site-footer { padding-bottom: 96px; }

@media (max-width: 720px) {
  .pd-hero { grid-template-columns: 1fr; gap: 20px; }
  .pd-section { padding: 22px 18px; }
  .pd-buy { flex-direction: column; align-items: stretch; }
  .pd-buy .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .buybar { transition: none; } }

/* live chat */
.talk-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; margin-bottom: 14px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.talk-card b { display: block; font-size: 15px; }
.talk-card span { font-size: 13.5px; opacity: .75; }
.talk-card .btn { flex: none; }
.buybar-actions { display: flex; gap: 8px; flex: none; }
.buybar-actions .btn.secondary { min-width: 0; }
