:root {
  --text: #222222;
  --muted: #777777;
  --faint: #aaaaaa;
  --line: #e9e7e3;
  --bg: #ffffff;
  --beige: #f5f3ef;
  --point: #222222;
  --red: #c0392b;
  --hd-h: 60px;
  --wrap: 1240px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
input, select, textarea { font: inherit; color: inherit; }
main { min-height: calc(100vh - var(--hd-h) - 200px); outline: none; }

/* ---------- Header ---------- */
.hd {
  position: sticky; top: 0; z-index: 40;
  height: var(--hd-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  transition: background .25s, color .25s, border-color .25s;
}
body.is-home .hd {
  position: fixed; left: 0; right: 0;
  background: transparent; color: #fff; border-bottom-color: rgba(255,255,255,.25);
}
body.is-home.scrolled .hd { background: #fff; color: var(--text); border-bottom-color: var(--line); }
.hd-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border: 0; background: none;
}
.logo {
  font-size: 22px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.hd-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.hd-auth { display: flex; gap: 14px; margin-right: 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.hd-auth a, .hd-auth button { border: 0; background: none; padding: 0; font-size: 11px; font-weight: 600; }
.badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--point); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}
body.is-home:not(.scrolled) .badge { background: #fff; color: var(--text); }

.search-bar { position: sticky; top: var(--hd-h); z-index: 35; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; }
body.is-home .search-bar { position: fixed; left: 0; right: 0; }
.search-bar form { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.search-bar input { flex: 1; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; }
.search-bar button { height: 42px; padding: 0 20px; border: 0; border-radius: 4px; background: var(--point); color: #fff; }

/* ---------- Drawer ---------- */
.dim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 61;
  width: min(320px, 86vw); overflow-y: auto;
  background: #fff; padding: 56px 28px 40px;
  transform: translateX(-100%); transition: transform .25s ease;
}
.drawer.open { transform: none; }
.drawer-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 30px; line-height: 1; padding: 4px; }
.drawer-auth { display: flex; gap: 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.drawer-auth button { border: 0; background: none; padding: 0; font-weight: 600; }
.drawer-menu details { border-bottom: 1px solid var(--line); }
.drawer-menu summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; font-size: 16px; font-weight: 600; cursor: pointer;
}
.drawer-menu summary::-webkit-details-marker { display: none; }
.drawer-menu summary::after { content: "+"; font-weight: 300; font-size: 20px; color: var(--muted); }
.drawer-menu details[open] summary::after { content: "−"; }
.drawer-menu ul { list-style: none; margin: 0 0 14px; padding: 0; }
.drawer-menu li a { display: block; padding: 7px 0 7px 4px; color: var(--muted); font-size: 14px; }
.drawer-menu li a:hover, .drawer-menu li a.active { color: var(--text); }

/* ---------- Home ---------- */
.hero { position: relative; height: 100vh; min-height: 520px; background: var(--beige); overflow: hidden; }
.hero picture, .hero img { width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: center; }

/* ---------- Page shell ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.page-title { text-align: center; font-size: 24px; font-weight: 600; margin: 56px 0 24px; letter-spacing: .01em; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 36px; }
.tabs a {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--muted); background: #fff;
}
.tabs a.active { background: var(--point); border-color: var(--point); color: #fff; }
.list-meta { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.list-meta b { color: var(--text); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 20px; padding-bottom: 100px; }
.card { display: block; }
.card .thumb { position: relative; aspect-ratio: 3 / 4; background: var(--beige); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .name { margin: 12px 0 4px; font-size: 14px; }
.card .price { font-weight: 600; }
.card .price s { color: var(--faint); font-weight: 400; margin-left: 6px; font-size: 13px; }
.sale-tag { font-style: normal; color: #d64545; font-weight: 700; margin-left: 4px; }
.soldout-tag { position: absolute; left: 10px; top: 10px; padding: 2px 8px; background: rgba(34,34,34,.8); color: #fff; font-size: 11px; }
.ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #c9c3b8; font-weight: 700; letter-spacing: .05em; background: var(--beige);
}
.empty { padding: 90px 0 120px; text-align: center; color: var(--muted); }
.loading { padding: 90px 0; text-align: center; color: var(--faint); }

/* ---------- Product detail ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; padding: 48px 0 40px; }
.pd-main { aspect-ratio: 1 / 1; background: var(--beige); overflow: hidden; }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.pd-thumbs button { flex: 0 0 72px; height: 72px; padding: 0; border: 1px solid transparent; background: var(--beige); }
.pd-thumbs button.active { border-color: var(--text); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-cat { font-size: 12px; color: var(--muted); }
.pd-name { font-size: 22px; font-weight: 600; margin: 6px 0 12px; line-height: 1.4; }
.pd-sum { color: var(--muted); margin: 0 0 16px; }
.pd-price { font-size: 20px; font-weight: 700; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pd-price s { font-size: 14px; color: var(--faint); font-weight: 400; margin-left: 8px; }
.pd-rows { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pd-rows div { display: flex; padding: 4px 0; }
.pd-rows dt { width: 80px; color: var(--muted); }
.pd-rows dd { margin: 0; }
.opt { margin: 16px 0 0; }
.opt label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.opt select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.qty button { width: 36px; height: 36px; border: 0; background: #fff; font-size: 16px; }
.qty input { width: 44px; height: 36px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; }
.pd-total { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 18px; font-size: 13px; }
.pd-total strong { font-size: 22px; }
.btn-row { display: flex; gap: 8px; }
.btn {
  flex: 1; height: 52px; border-radius: 4px; border: 1px solid var(--point);
  background: #fff; color: var(--point); font-size: 15px; font-weight: 600;
}
.btn.solid { background: var(--point); color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.pd-tabs { display: flex; position: sticky; top: var(--hd-h); z-index: 5; background: #fff; border-bottom: 1px solid var(--line); margin-top: 40px; }
.pd-tabs button { flex: 1; height: 50px; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; }
.pd-tabs button.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.pd-panel { padding: 40px 0 100px; max-width: 860px; margin: 0 auto; }
.pd-gallery img { width: 100%; margin: 0 auto 16px; }

.prose p { margin: 0 0 12px; }
.prose strong { font-weight: 700; }

/* ---------- Cart / checkout ---------- */
.cart-line { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line .thumb { width: 90px; aspect-ratio: 3 / 4; background: var(--beige); overflow: hidden; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .opt-text { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.cart-line .right { text-align: right; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }
.summary { margin: 28px 0; padding: 22px; background: var(--beige); border-radius: 4px; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; }
.summary .grand { margin-top: 8px; padding-top: 12px; border-top: 1px solid #e2ddd4; font-size: 17px; font-weight: 700; }
.narrow { max-width: 760px; margin: 0 auto; padding-bottom: 100px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-row input, .form-row textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.form-row textarea { height: 140px; padding: 10px 12px; resize: vertical; }
.form-row input[readonly] { background: #fafafa; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.inline .btn { flex: 0 0 auto; padding: 0 18px; height: 44px; font-size: 14px; }
.postcode-layer { display: none; position: relative; height: 420px; border: 1px solid var(--line); margin: 8px 0 14px; }
.sec-title { font-size: 16px; font-weight: 600; margin: 32px 0 14px; }
.hint { font-size: 12px; color: var(--muted); }
.notice-test { margin: 12px 0 0; padding: 10px 12px; background: #fdf1ef; color: var(--red); font-size: 12px; border-radius: 4px; }

/* ---------- Board ---------- */
.board { border-top: 2px solid var(--text); margin-bottom: 100px; }
.board a.row, .board div.row { display: flex; justify-content: space-between; gap: 16px; padding: 16px 6px; border-bottom: 1px solid var(--line); }
.board .row .t { flex: 1; }
.board .row .d { color: var(--faint); font-size: 12px; white-space: nowrap; }
.pin { display: inline-block; margin-right: 8px; padding: 0 6px; background: var(--point); color: #fff; font-size: 11px; border-radius: 2px; }
.article h2 { font-size: 20px; margin: 0 0 6px; }
.article .meta { color: var(--faint); font-size: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.qna-item { border-bottom: 1px solid var(--line); padding: 18px 6px; }
.qna-item h3 { font-size: 15px; margin: 0 0 4px; }
.qna-answer { margin-top: 12px; padding: 14px; background: var(--beige); border-radius: 4px; }
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.status.done { border-color: var(--point); color: var(--text); }

/* ---------- My page: order history ---------- */
.order-card { border: 1px solid var(--line); margin-bottom: 20px; background: #fff; }
.order-hd { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--beige); border-bottom: 1px solid var(--line); font-size: 14px; }
.order-hd > span:first-child { flex: 1; min-width: 0; }
.order-hd .order-no { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; word-break: break-all; }
.order-status { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--text); }
.order-line { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); align-items: center; }
.order-line .thumb { display: block; width: 84px; aspect-ratio: 1 / 1; background: var(--beige); overflow: hidden; }
.order-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-line .thumb .ph { height: 100%; font-size: 11px; }
.order-line .name { display: block; font-size: 15px; font-weight: 600; line-height: 1.4; }
.order-line .opt { color: var(--muted); font-size: 13px; margin-top: 4px; }
.order-line .pq { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; }
.order-line .pq .bar { width: 1px; height: 12px; background: var(--line); }
.order-sum { padding: 14px 18px; font-size: 13px; color: var(--muted); }
.order-sum > div { display: flex; justify-content: space-between; padding: 3px 0; }
.order-sum .grand { color: var(--text); font-weight: 600; font-size: 14px; }
.order-act { padding: 0 18px 18px; text-align: right; }
.order-act .btn { display: inline-flex; width: auto; padding: 0 18px; height: 38px; align-items: center; font-size: 13px; }
.order-card.is-canceled .order-status { color: var(--red); }
.order-card.is-canceled .order-line .thumb img { opacity: .55; }

/* ---------- Login ---------- */
.login-box { max-width: 380px; margin: 80px auto 140px; text-align: center; }
.login-box h1 { font-size: 22px; margin: 0 0 8px; }
.login-box p { color: var(--muted); margin: 0 0 28px; }
.kakao-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px;
  border: 0; border-radius: 6px; background: #fee500; color: rgba(0,0,0,.85); font-size: 15px; font-weight: 600;
}

/* ---------- Footer ---------- */
.ft { border-top: 1px solid var(--line); padding: 48px 20px 60px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.9; }
.ft .ft-logo { color: var(--text); font-size: 18px; font-weight: 700; }
.ft .ft-tag { margin: 2px 0 18px; }
.ft .ft-links { display: flex; justify-content: center; gap: 18px; margin-top: 16px; color: var(--text); font-weight: 600; }
.ft .sep { margin: 0 6px; color: #d6d2cb; }
.ft .ft-legal { margin-top: 10px; }
.ft .ft-legal a { color: var(--text); }

/* ---------- Privacy policy ---------- */
.policy { font-size: 14px; line-height: 1.8; color: var(--text); padding-bottom: 40px; word-break: keep-all; }
.policy h2 { font-size: 16px; margin: 36px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.policy p, .policy ul, .policy ol { margin: 8px 0; }
.policy ul, .policy ol { padding-left: 20px; }
.policy table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.policy th, .policy td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy th { background: #faf8f5; }
.policy hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------- Popup / toast ---------- */
.popup-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: none; }
.popup { pointer-events: auto; }
.popup { width: min(400px, 100%); background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.popup img { width: 100%; max-height: 72vh; object-fit: contain; }
.popup-btns { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.popup-btns button { height: 46px; border: 0; background: #fff; font-size: 13px; }
.popup-btns button + button { border-left: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 40px; z-index: 90; transform: translateX(-50%); padding: 12px 20px; background: rgba(34,34,34,.92); color: #fff; border-radius: 6px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pd { grid-template-columns: 1fr; gap: 28px; padding-top: 0; }
  .pd-main { margin: 0 -20px; }
}
@media (max-width: 768px) {
  :root { --hd-h: 54px; }
  .hd { padding: 0 8px; }
  .logo { font-size: 19px; }
  .hd-auth { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .page-title { margin: 36px 0 18px; font-size: 20px; }
  .tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 28px; padding: 0 20px; }
  .tabs a { flex: 0 0 auto; }
  .cart-line { grid-template-columns: 72px 1fr; }
  .cart-line .thumb { width: 72px; }
  .cart-line .right { grid-column: 2; text-align: left; }
  .popup { width: min(300px, 80vw); }
  .popup img { max-height: 60vh; }
  .popup-btns button { height: 42px; font-size: 12px; }
}
