/*
Theme Name: Mosa
Description: 상품 카탈로그 전용 테마 — 토스 무드(Pretendard·라운드·블루), 카드 그리드, 가격·조회수 배지, 대형 구매 CTA.
Version: 0.3.0
Author: autofarm
*/

:root {
  --bg: #ffffff; --fg: #191f28; --sub: #4e5968; --muted: #8b95a1;
  --line: #f2f4f6; --fill: #f9fafb; --card: #ffffff;
  --blue: #3182f6; --blue-dark: #1b64da; --sale: #f04452;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17171c; --fg: #e5e8eb; --sub: #b0b8c1; --muted: #6b7684;
          --line: #26262c; --fill: #1e1e24; --card: #1e1e24; }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  letter-spacing: -0.02em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ─────────────────────────────── */
.site-head { position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 100; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 22px; font-weight: 800; }
.logo em { color: var(--blue); font-style: normal; }
.head-note { font-size: 13px; color: var(--muted); font-weight: 500; }
@media (max-width: 480px) { .head-note { display: none; } }

/* ── 상품 그리드 ───────────────────────── */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 10px; padding: 16px 0 48px; }
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { border-radius: 20px; overflow: hidden; padding: 8px; transition: background .15s ease; }
.card:active, .card:hover { background: var(--fill); }
.card .thumb { aspect-ratio: 1/1; background: var(--fill); overflow: hidden; border-radius: 16px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 4px 6px; }
.card h2 { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--sub);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.price-row { margin-top: 7px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price { font-size: 18px; font-weight: 800; color: var(--fg); }
.sale { color: var(--sale); font-size: 16px; font-weight: 800; }
.was { color: var(--muted); font-size: 13px; text-decoration: line-through; }
.views { margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }

/* ── 상세 ─────────────────────────────── */
.post { max-width: 720px; margin: 0 auto; padding: 30px 20px 140px; }
.post h1 { font-size: 25px; font-weight: 800; line-height: 1.4; margin-bottom: 8px; }
.post-meta { color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 22px; }
.post h2 { font-size: 20px; font-weight: 700; margin: 40px 0 14px; }
.post p { margin: 13px 0; color: var(--sub); font-size: 16px; }
.post ul { padding-left: 8px; margin: 14px 0; list-style: none; }
.post li { margin: 9px 0; padding: 14px 16px; background: var(--fill); border-radius: 14px;
  color: var(--sub); font-size: 15px; line-height: 1.55; }
.post img { border-radius: 16px; margin: 16px auto; }
.post a { color: var(--blue); font-weight: 700; }
.post blockquote { color: var(--muted); font-size: 13px; margin: 24px 0; }
.post hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.post table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.post td, .post th { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.post tr:last-child td { border-bottom: 0; }
.post th { background: var(--fill); text-align: left; }

/* 글 안의 구식 인라인 CTA(초기 발행분)는 테마 CTA와 중복이라 숨김 */
#tm-buy { display: none !important; }

/* ── 대형 구매 CTA (토스식 하단 바) ─────── */
.buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); }
.buy-bar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.buy-bar .p { flex: 0 0 auto; line-height: 1.2; }
.buy-bar .p .price { font-size: 18px; }
.buy-bar .p .sale { font-size: 15px; margin-right: 4px; }
.buy-bar a.go { flex: 1; display: flex; align-items: center; justify-content: center;
  height: 54px; border-radius: 16px; background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 700; transition: background .15s ease; }
.buy-bar a.go:active { background: var(--blue-dark); }

/* ── 관련 상품 ────────────────────────── */
.related { padding: 10px 0 40px; }
.related h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }

/* ── 푸터 ─────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 60px; color: var(--muted);
  font-size: 12px; line-height: 1.9; }
.site-foot a { text-decoration: underline; }

.sec-title { font-size: 20px; font-weight: 800; padding: 22px 0 0; }

/* 페이지네이션 */
.pagination { display: flex; gap: 8px; justify-content: center; padding-bottom: 70px; font-size: 14px; font-weight: 600; }
.pagination .page-numbers { padding: 10px 15px; border-radius: 12px; background: var(--fill); color: var(--sub); }
.pagination .current { background: var(--fg); color: var(--bg); }
