/*
Theme Name: Product Damoa
Description: 쿠팡파트너스 상품 허브(디렉토리) 테마. 상품 1개 = 글 1개로 관리하며, 글 편집 화면의 "상품 정보" 입력칸에 가격·링크만 넣으면 상품 카드와 상세 페이지가 자동 생성됩니다. 플러그인 불필요.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: productdamoa
*/

:root {
  --ink: #17202c;
  --ink-soft: #4b5563;
  --ink-muted: #8b95a1;
  --line: #e6e9ef;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --price: #e03131;
  --cta: #2b5ce6;
  --cta-dark: #1e46bd;
  --good-bg: #eef7ee;
  --good-text: #23662b;
  --bad-bg: #fdeeee;
  --bad-text: #9c2b2b;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 62px;
}
.site-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 18px; letter-spacing: -.01em;
  min-width: 0; flex-shrink: 0;
}
.site-logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-logo img { width: 28px; height: 28px; flex-shrink: 0; border-radius: 7px; }

.header-search { flex: 1; max-width: 420px; }
.header-search form { display: flex; }
.header-search input[type="search"] {
  flex: 1; min-width: 0;
  font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-right: none;
  border-radius: 999px 0 0 999px;
  padding: 9px 18px; outline: none; background: var(--bg-alt);
}
.header-search input[type="search"]:focus { border-color: var(--cta); background: #fff; }
.header-search button {
  font: inherit; font-size: 14px; font-weight: 600; color: #fff;
  background: var(--cta); border: none; cursor: pointer;
  padding: 0 18px; border-radius: 0 999px 999px 0;
}
.header-search button:hover { background: var(--cta-dark); }

/* ---------- home hero ---------- */
.home-hero { padding: 44px 0 10px; text-align: center; }
.home-hero h1 { font-size: 30px; letter-spacing: -.02em; }
.home-hero p { margin-top: 8px; font-size: 16px; color: var(--ink-soft); }

.cat-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 22px 0 6px;
}
.cat-chips a {
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; background: #fff;
  transition: all .12s ease;
}
.cat-chips a:hover, .cat-chips a.active {
  border-color: var(--cta); color: var(--cta); background: #eaf0fe;
}

/* ---------- product grid ---------- */
.archive-title { padding: 34px 0 0; font-size: 22px; }
.grid-section { padding: 26px 0 50px; }
.product-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.product-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff;
  transition: box-shadow .15s ease, transform .15s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(23,32,44,.08); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 1 / 1; background: var(--bg-alt); position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 12px; font-weight: 700; color: var(--cta);
  background: #eaf0fe; padding: 3px 10px; border-radius: 999px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-cat { font-size: 12px; color: var(--ink-muted); }
.card-title {
  font-size: 15px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-rating { font-size: 13px; color: var(--ink-soft); }
.card-rating .stars { color: #f5a623; }
.card-price { margin-top: auto; padding-top: 6px; font-size: 17px; font-weight: 800; color: var(--price); }
.card-price small { font-size: 13px; font-weight: 600; }
.card-price .dc { color: var(--price); margin-right: 4px; }

.no-posts { padding: 60px 0; text-align: center; color: var(--ink-soft); }

/* pagination */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 6px 0 20px; }
.pagination .page-numbers {
  min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; padding: 0 10px;
}
.pagination .page-numbers.current { background: var(--cta); border-color: var(--cta); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--cta); color: var(--cta); }

/* ---------- single product ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 22px 0 0; font-size: 14px; color: var(--ink-soft);
}
.back-link:hover { color: var(--cta); }

.product-top {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
  padding: 24px 0 40px; align-items: start;
}
.pt-figure {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: sticky; top: 82px;
}
.pt-figure img { width: 100%; height: 100%; object-fit: contain; }

.pt-info .badge {
  display: inline-block; font-size: 13px; font-weight: 700;
  color: var(--cta); background: #eaf0fe;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.pt-info h1 { font-size: 26px; line-height: 1.35; letter-spacing: -.02em; }
.pt-info .subtitle { margin-top: 6px; font-size: 16px; color: var(--ink-soft); }
.pt-info .rating { margin-top: 14px; font-size: 15px; color: var(--ink-soft); }
.pt-info .rating .stars { color: #f5a623; letter-spacing: 2px; margin-right: 6px; }
.pt-info .rating strong { color: var(--ink); }

.price-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.price-original { font-size: 14px; color: var(--ink-muted); text-decoration: line-through; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.discount { font-size: 22px; font-weight: 800; color: var(--price); }
.price-label { font-size: 14px; color: var(--ink-soft); }
.price { font-size: 32px; font-weight: 800; color: var(--price); letter-spacing: -.02em; }
.price small { font-size: 19px; font-weight: 700; }

.cta-btn {
  display: block; margin-top: 20px;
  background: var(--cta); color: #fff; text-align: center;
  font-size: 17px; font-weight: 700; padding: 16px 20px;
  border-radius: var(--radius);
  transition: background .15s ease, transform .1s ease;
}
.cta-btn:hover { background: var(--cta-dark); }
.cta-btn:active { transform: scale(.985); }
.cta-disclosure { margin-top: 16px; font-size: 13px; color: var(--ink-soft); line-height: 1.8; }
.cta-note { margin-top: 8px; font-size: 13px; color: var(--ink-muted); line-height: 1.8; }

.satellite-btn {
  display: block; margin-top: 12px; text-align: center;
  font-size: 15px; font-weight: 600; color: var(--cta);
  border: 1px solid var(--cta); border-radius: var(--radius);
  padding: 13px 20px; transition: background .12s ease;
}
.satellite-btn:hover { background: #eaf0fe; }

/* ---------- single sections ---------- */
.section { padding: 36px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }
.section h2 {
  font-size: 20px; letter-spacing: -.01em; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.section h2::before {
  content: ""; width: 4px; height: 17px; border-radius: 2px; background: var(--cta);
}

.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table th {
  text-align: left; font-weight: 500; color: var(--ink-soft);
  padding: 11px 8px; width: 30%; white-space: nowrap;
}
.spec-table td { padding: 11px 8px; font-weight: 600; }

.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc-card { border-radius: var(--radius); padding: 20px; font-size: 15px; }
.pc-card.good { background: var(--good-bg); }
.pc-card.bad { background: var(--bad-bg); }
.pc-card h3 { font-size: 15px; margin-bottom: 12px; }
.pc-card.good h3 { color: var(--good-text); }
.pc-card.bad h3 { color: var(--bad-text); }
.pc-card ul { list-style: none; }
.pc-card li { padding: 4px 0 4px 22px; position: relative; }
.pc-card.good li::before { content: "✓"; position: absolute; left: 0; color: var(--good-text); font-weight: 700; }
.pc-card.bad li::before { content: "✕"; position: absolute; left: 0; color: var(--bad-text); font-weight: 700; }

.review-body { font-size: 16px; color: #2c3540; }
.review-body p { margin-bottom: 1.1em; }
.review-body h2, .review-body h3 { margin: 1.6em 0 .6em; }
.review-body h2 { font-size: 20px; }
.review-body h3 { font-size: 18px; }
.review-body img { border-radius: 12px; margin: 1em 0; }
.review-body ul, .review-body ol { padding-left: 1.4em; margin-bottom: 1.1em; }

.final-cta { text-align: center; padding: 44px 0 52px; }
.final-cta p.lead { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.final-cta p.sub { font-size: 15px; color: var(--ink-soft); margin-bottom: 4px; }
.final-cta .cta-btn { max-width: 480px; margin-left: auto; margin-right: auto; }

/* generic page */
.page-body { padding: 40px 0 60px; }
.page-body h1 { font-size: 26px; margin-bottom: 20px; }
.page-content { font-size: 16px; }
.page-content p { margin-bottom: 1.1em; }
.page-content h2 { font-size: 20px; margin: 1.6em 0 .6em; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-alt);
  padding: 30px 0; text-align: center;
}
.footer-menu { display: flex; gap: 18px; justify-content: center; margin-bottom: 14px; font-size: 14px; color: var(--ink-soft); }
.footer-menu a:hover { color: var(--cta); }
.disclosure {
  font-size: 13px; color: var(--ink-soft); background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; display: inline-block; margin-bottom: 14px;
}
.copyright { font-size: 12px; color: var(--ink-muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-top { grid-template-columns: 1fr; gap: 22px; padding-top: 16px; }
  .pt-figure { position: static; max-width: 440px; margin: 0 auto; width: 100%; }
  .home-hero h1 { font-size: 24px; }
  .header-search { display: none; }
  .mobile-search { display: block; padding: 14px 0 0; }
  .pc-grid { grid-template-columns: 1fr; }
}
@media (min-width: 721px) {
  .mobile-search { display: none; }
}
@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-card, .cta-btn { transition: none; }
}
