/* ==========================================================================
   base.css — 세 몰이 공유하는 구조 스타일. 색·서체·모양은 각 몰의 site.css 가 CSS 변수로 결정한다.
   ========================================================================== */
:root {
  --font-body: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink: #1b1b1f; --ink-2: #4b4b55; --ink-3: #7d7d8a; --line: #e6e6ec; --line-2: #f0f0f4;
  --paper: #fff; --paper-2: #f7f7fa; --paper-3: #efeff4;
  --accent: #2f6df6; --accent-ink: #fff; --accent-soft: #e9f0ff; --accent-2: #ffb020;
  --ok: #1f9d55; --ok-soft: #e4f6ec; --warn: #d97706; --warn-soft: #fff4e0; --danger: #d64545; --danger-soft: #fdecec; --info: #2563eb; --info-soft: #e8f0fe;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 20px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, .05); --shadow: 0 8px 24px rgba(20, 20, 30, .08); --shadow-lg: 0 20px 50px rgba(20, 20, 30, .14);
  --container: 1200px; --gutter: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; font-family: var(--font-display); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.medium { max-width: 960px; }

/* ---------- 텍스트 유틸 ---------- */
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.mono { font-family: var(--font-mono); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; } .mt-5 { margin-top: 64px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }
.flex { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: grid; gap: 12px; }
.hide-mobile { }
@media (max-width: 720px) { .hide-mobile { display: none !important; } }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px; border: 1px solid transparent; background: var(--paper-3); color: var(--ink); transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(.94); }
.btn-outline { background: transparent; border-color: var(--line); }
.btn-outline:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--paper-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f9d9d9; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--radius-pill); }

/* ---------- 폼 ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237d7d8a' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input::placeholder, .textarea::placeholder { color: #a9a9b5; }
.input[readonly] { background: var(--paper-2); color: var(--ink-2); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; line-height: 1.5; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; height: 42px; }
.qty button { width: 40px; height: 100%; font-size: 18px; color: var(--ink-2); }
.qty button:hover { background: var(--paper-2); }
.qty input { width: 52px; height: 100%; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- 알림 ---------- */
.flash { display: grid; gap: 8px; margin: 16px 0; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--ok-soft); color: #14653a; border-color: #c6ebd5; }
.alert-error { background: var(--danger-soft); color: #9f2a2a; border-color: #f3c2c2; }
.alert-info { background: var(--info-soft); color: #1e40af; border-color: #c7d7fb; }
.alert-warn { background: var(--warn-soft); color: #92400e; border-color: #f8dcae; }
.alert ul { padding-left: 16px; list-style: disc; }

/* ---------- 카드 / 패널 ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dt { margin-top: 8px; font-size: 12.5px; } }

/* ---------- 배지 / 상태 ---------- */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--paper-3); color: var(--ink-2); letter-spacing: 0; white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--paper-3); color: var(--ink-3); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--ok); } .status-warn { color: var(--warn); } .status-info { color: var(--info); } .status-muted { color: var(--ink-3); }

/* ---------- 표 ---------- */
.table { font-size: 14px; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; border-bottom-color: var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 페이지 공통 ---------- */
.page { padding: 40px 0 80px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 28px; }
.page-head .lead { color: var(--ink-3); margin-top: 6px; }
.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 12px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; color: var(--line); }
.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .icon { font-size: 36px; margin-bottom: 10px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.pagination a:hover { background: var(--paper-2); }
.pagination .current { background: var(--ink); color: var(--paper); font-weight: 700; }
.pagination .disabled { color: var(--line); }

/* ---------- 법적 문서 ---------- */
.legal-doc { font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }
.legal-doc h2 { font-size: 16.5px; color: var(--ink); margin: 32px 0 10px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h3, .legal-doc h4 { font-size: 15px; margin: 20px 0 8px; color: var(--ink); }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { list-style: disc; padding-left: 20px; margin: 0 0 12px; }
.legal-doc ul ul { list-style: circle; margin-top: 6px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc strong { color: var(--ink); }
.legal-scroll { max-height: 220px; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.legal-scroll h2 { font-size: 13.5px; margin: 14px 0 6px; } .legal-scroll h2:first-child { margin-top: 0; }
.legal-scroll ul { padding-left: 16px; list-style: disc; }

/* ---------- 마이페이지 레이아웃 ---------- */
.my-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.my-nav { position: sticky; top: 90px; display: grid; gap: 2px; }
.my-nav a { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14.5px; color: var(--ink-2); display: flex; justify-content: space-between; }
.my-nav a:hover { background: var(--paper-2); color: var(--ink); }
.my-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.my-nav .group { font-size: 12px; color: var(--ink-3); padding: 14px 14px 4px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 860px) { .my-layout { grid-template-columns: 1fr; } .my-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 8px; } .my-nav .group { display: none; } .my-nav a { white-space: nowrap; } }

/* ---------- 주문 아이템 ---------- */
.order-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.order-item:last-child { border-bottom: 0; }
.order-item .thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-2); border: 1px solid var(--line-2); }
.order-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-item .name { font-weight: 600; font-size: 14.5px; }
.order-item .opt { font-size: 13px; color: var(--ink-3); }
.order-item .price { font-weight: 700; white-space: nowrap; }
.timeline { display: grid; gap: 10px; font-size: 13.5px; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.timeline .t { color: var(--ink-3); font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- 요약 박스 ---------- */
.summary { background: var(--paper-2); border-radius: var(--radius); padding: 20px; }
.summary .row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.summary .total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 18px; font-weight: 800; }
.summary .total span:last-child { color: var(--accent); }

/* ---------- PIN ---------- */
.pin-box { display: grid; gap: 10px; }
.pin { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font-family: var(--font-mono); font-size: 16px; letter-spacing: .04em; }
.pin .meta { font-family: var(--font-body); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0; }

/* ---------- FAQ 아코디언 ---------- */
.faq-list { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .q { color: var(--accent); font-weight: 800; flex: none; }
.faq-item summary::after { content: '+'; margin-left: auto; color: var(--ink-3); font-size: 18px; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .a { padding: 0 18px 18px 44px; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
.faq-item .a p { margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 500; background: var(--paper); }
.chip:hover { border-color: var(--ink-3); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 게시판 ---------- */
.board-list li { border-bottom: 1px solid var(--line); }
.board-list a { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 4px; align-items: center; }
.board-list a:hover .title { color: var(--accent); }
.board-list .title { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.board-list .date { color: var(--ink-3); font-size: 13px; font-family: var(--font-mono); }
.post-body { font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.post-body p { margin-bottom: 12px; }
.post-body h2, .post-body h3, .post-body h4 { color: var(--ink); margin: 20px 0 8px; }
.post-body ul { list-style: disc; padding-left: 20px; margin-bottom: 12px; }

/* ---------- 상품 상세 공통 ---------- */
.spec-table td, .spec-table th { padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.spec-table th { width: 120px; color: var(--ink-3); font-weight: 500; text-align: left; background: var(--paper-2); }
.desc-body { font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.desc-body p { margin-bottom: 12px; }
.desc-body h2, .desc-body h3 { color: var(--ink); margin: 24px 0 10px; font-size: 18px; }
.desc-body ul { list-style: disc; padding-left: 20px; margin-bottom: 12px; }
.notice-box { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--warn-soft); color: #7c4a03; font-size: 13.5px; line-height: 1.7; }
.notice-box strong { display: block; margin-bottom: 4px; color: #92400e; }
.notice-box ul { list-style: disc; padding-left: 18px; }

/* ---------- 모바일 하단 고정바 ---------- */
.sticky-bar { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px var(--gutter); display: none; gap: 10px; z-index: 20; }
@media (max-width: 860px) { .sticky-bar { display: flex; } }

/* ---------- 토스트 ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: var(--radius-pill); font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transition: .25s var(--ease); z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 가로 넘침 방지: 그리드 자식의 min-width:auto 로 인한 확장 차단 ---------- */
.listing > *, .my-layout > *, .cart-layout > *, .checkout-layout > *, .home-bottom > *, .product-top > *, .hero-grid > * { min-width: 0; }

/* ---------- 수량별 단가 · 상세 이미지 (스크래핑 상품) ---------- */
.tier-box { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm, 10px); background: var(--paper-2, #faf9f7); }
.tier-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.tier-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tier-table { border-collapse: collapse; font-size: 13px; white-space: nowrap; min-width: 100%; }
.tier-table th, .tier-table td { padding: 6px 10px; text-align: center; border: 1px solid var(--line); }
.tier-table thead th { background: var(--paper-3, #f1efeb); font-weight: 600; color: var(--ink-2); }
.tier-table tbody th { background: var(--paper-3, #f1efeb); font-weight: 600; }
.tier-table td.is-active { background: var(--accent-soft, #fdebe4); color: var(--accent-text, var(--accent)); font-weight: 700; }
.tier-note { margin: 8px 0 0; }
.detail-images { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 18px; }
.detail-images img { max-width: 100%; height: auto; display: block; }
.pcard-unit { font-size: 12px; color: var(--ink-3); margin-left: 4px; font-weight: 400; }

/* ---------- 법정 문서 번호 표기 · 계약 확인서 ---------- */
@counter-style circled-decimal { system: fixed; symbols: "①" "②" "③" "④" "⑤" "⑥" "⑦" "⑧" "⑨" "⑩" "⑪" "⑫" "⑬" "⑭" "⑮"; suffix: " "; }
ol.hang { list-style: circled-decimal; padding-left: 1.7em; margin: 8px 0; }
ol.ho { list-style: decimal; padding-left: 1.7em; margin: 8px 0; }
ol.hang > li, ol.ho > li { margin: 6px 0; }
ol.hang ul { margin: 6px 0 6px 0; padding-left: 1.2em; list-style: disc; }
.order-contract dl.kv dd { line-height: 1.6; }
