/* 반품마트 부개점 — 모바일 우선, 심플 */
:root {
  --brand: #e8452c;
  --brand-dark: #c7351f;
  --text: #1f2328;
  --sub: #6b7280;
  --line: #eceef1;
  --bg: #ffffff;
  --soft: #f6f7f9;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: 640px; margin: 0 auto; background: var(--bg); min-height: 100vh; }

/* 시안 안내 줄 */
.notice { background: #fff7d6; color: #7a5b00; font-size: 12px; text-align: center; padding: 6px 12px; }

/* 상단 고정: 로고 + 전화 + 카테고리 */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; }
.logo { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 20px; letter-spacing: -0.5px; color: var(--brand); }
.logo small { font-size: 14px; font-weight: 700; color: var(--text); }
.call {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}
.call:active { background: var(--brand-dark); }
.call svg { width: 16px; height: 16px; fill: currentColor; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto; padding: 10px 10px 11px; font-size: 15px; color: var(--sub);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a.on { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }

/* 섹션 제목 */
.sec { padding: 20px 16px 4px; }
.sec h2 { margin: 0; font-size: 18px; letter-spacing: -0.3px; }
.sec h2 em { font-style: normal; color: var(--brand); }
.sec p { margin: 2px 0 0; color: var(--sub); font-size: 13px; }
.md-sec { background: #fff5f3; padding-bottom: 8px; }
.md-sec .grid { padding-bottom: 12px; }

/* 상품 2칸 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; padding: 12px 16px 24px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.no { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.name { margin-top: 8px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.price { margin-top: 4px; }
.price .was { display: block; font-size: 12px; color: var(--sub); }
.price .was s { color: var(--sub); }
.price .now { display: flex; align-items: baseline; gap: 4px; font-size: 13px; }
.price .now b { font-size: 17px; letter-spacing: -0.3px; }
.price .pct { color: var(--brand); font-weight: 800; font-size: 15px; }
.order {
  margin-top: 8px; height: 36px; border-radius: 8px; border: 1px solid var(--brand);
  color: var(--brand); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.order:active { background: #fff0ed; }
.order svg { width: 14px; height: 14px; fill: currentColor; }

/* 품절: 흐리게 */
.card.sold .thumb img { filter: grayscale(1); opacity: .45; }
.card.sold .name, .card.sold .price { opacity: .5; }
.sold-tag { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sold-tag span { background: rgba(31,35,40,.8); color: #fff; font-weight: 700; padding: 6px 14px; border-radius: 16px; font-size: 14px; }
.card.sold .order { border-color: var(--line); color: var(--sub); background: var(--soft); pointer-events: none; }

.empty { padding: 48px 16px; text-align: center; color: var(--sub); }
.more { height: 1px; }

/* 상세 화면 */
.detail-head { padding: 16px 16px 14px; border-bottom: 8px solid var(--soft); }
.detail-head .meta { font-size: 12px; color: var(--sub); }
.detail-head h1 { margin: 4px 0 2px; font-size: 19px; letter-spacing: -0.3px; line-height: 1.35; }
.detail-head .line { margin: 0 0 10px; color: var(--sub); font-size: 14px; }
.detail-head .price .was { font-size: 13px; }
.detail-head .price .now b { font-size: 22px; }
.detail-head .price .pct { font-size: 20px; }
.detail-head.sold h1, .detail-head.sold .price { opacity: .5; }
.badge-sold { display: inline-block; margin-left: 6px; background: var(--text); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; vertical-align: 2px; }
.detail-imgs img { width: 100%; }
.detail-imgs img + img { margin-top: 0; }
.buybar {
  position: sticky; bottom: 0; z-index: 9; display: flex; gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line);
}
.buybar .share {
  flex: 0 0 52px; height: 50px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--sub);
}
.buybar .big {
  flex: 1; height: 50px; border-radius: 10px; background: var(--brand); color: #fff;
  font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.buybar .big svg { width: 18px; height: 18px; fill: currentColor; }
.buybar .big.off { background: #c9ccd1; pointer-events: none; }

/* 매장 정보 */
.store { background: var(--soft); padding: 24px 16px 40px; font-size: 13px; color: var(--sub); }
.store h3 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.store dl { margin: 0; display: grid; grid-template-columns: 76px 1fr; row-gap: 4px; }
.store dt { color: var(--sub); }
.store dd { margin: 0; color: var(--text); }
.map { margin-top: 14px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #e9ecef; }
.map iframe { display: block; width: 100%; height: 200px; border: 0; }
.maplinks { display: flex; gap: 8px; margin-top: 8px; }
.maplinks a { flex: 1; text-align: center; padding: 9px 0; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.store .copy { margin-top: 16px; font-size: 11px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(31,35,40,.9); color: #fff; padding: 8px 14px; border-radius: 16px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
