/* KoreaCart — 자체 디자인 스타일시트 */
:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --accent: #d6455f;
  --accent-dark: #b3364c;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 10px;
  --max: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-size: 15px;
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---- header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.logo { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.logo small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: 0.08em; }

.search-form { flex: 1; max-width: 420px; display: flex; }
.search-form input {
  flex: 1; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius);
  outline: none; font-family: inherit;
}
.search-form input:focus { border-color: var(--accent); }
.search-form button {
  padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
  font-family: inherit; font-size: 14px;
}

.header-nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.header-nav a:hover { color: var(--accent); }

/* ---- category bar ---- */
.cat-bar { border-bottom: 1px solid var(--border); background: var(--surface); }
.cat-bar ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 11px 0; overflow-x: auto; font-size: 14px; }
.cat-bar a { white-space: nowrap; color: var(--muted); }
.cat-bar a:hover { color: var(--text); }

/* ---- hero ---- */
.hero {
  background: linear-gradient(135deg, #fdf2f4 0%, #f6f0ff 100%);
  border-radius: var(--radius); padding: 36px 28px; margin: 24px 0;
}
.hero h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 14px; }
.hero .badges { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; font-size: 12px; color: var(--muted);
}

/* ---- sections ---- */
.section { margin: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; margin: 0; }
.section-head a { font-size: 13px; color: var(--muted); }

/* ---- product grid ---- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.08); }
.card .thumb { aspect-ratio: 1; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.card .thumb.placeholder { color: #c4c4cc; font-size: 12px; }
.card .body { padding: 11px 12px 13px; }
.card .brand { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.card .name { font-size: 13px; line-height: 1.45; height: 2.9em; overflow: hidden; margin-bottom: 7px; }
.card .price { font-weight: 700; font-size: 15px; }
.card .price small { font-weight: 400; font-size: 11px; color: var(--muted); }
.card .oos { color: var(--warn); font-size: 12px; font-weight: 600; }

/* ---- product detail ---- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin: 28px 0; }
@media (max-width: 780px) { .detail { grid-template-columns: 1fr; gap: 20px; } }
.detail .gallery { background: var(--surface); border-radius: var(--radius); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: #c4c4cc; }
.detail h1 { font-size: 21px; margin: 4px 0 10px; letter-spacing: -0.01em; }
.detail .brand-link { font-size: 13px; color: var(--accent); }
.price-box { background: var(--surface); border-radius: var(--radius); padding: 18px; margin: 18px 0; }
.price-box .main { font-size: 27px; font-weight: 700; }
.price-box .main small { font-size: 13px; font-weight: 400; color: var(--muted); }
.price-box .note { font-size: 12px; color: var(--muted); margin-top: 7px; }
.stock { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.stock.in { background: #dcfce7; color: var(--ok); }
.stock.low { background: #fef3c7; color: var(--warn); }
.stock.out { background: #f4f4f5; color: var(--muted); }

.btn {
  display: block; width: 100%; text-align: center; padding: 13px;
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #d4d4d8; cursor: not-allowed; }

.spec { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 18px; }
.spec th, .spec td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec th { width: 110px; color: var(--muted); font-weight: 400; }

.prose { font-size: 14px; line-height: 1.85; color: #3f3f46; }
.prose h2 { font-size: 17px; margin: 28px 0 10px; color: var(--text); }
.prose ul { padding-left: 20px; }

/* ---- misc ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; list-style: none; padding: 0; font-size: 14px; }
.pagination a, .pagination span { padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.pagination .active span { background: var(--accent); border-color: var(--accent); color: #fff; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.toolbar select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 13px; }

.empty { text-align: center; padding: 64px 16px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 32px 0 44px; background: var(--surface); font-size: 13px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; gap: 18px; } }
.site-footer h3 { font-size: 13px; color: var(--text); margin: 0 0 9px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 5px; }
.site-footer a:hover { color: var(--accent); }
.legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.75; }

/* ---- 매입처(ショップ) 선택 탭 ---- */
.shop-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; }
.shop-tab {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.shop-tab:hover { border-color: #c9c9cf; }
.shop-tab.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); font-weight: 600; }
.shop-tab .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.shop-tab .mark { width: 18px; height: 18px; border-radius: 4px; flex: none; object-fit: contain; }
.shop-tab .count { color: var(--muted); font-size: 12px; font-weight: 400; }
.shop-tab.all .dot { background: linear-gradient(135deg, #d6455f, #7c5cd6); }

.shop-note {
  font-size: 12px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin: 12px 0 0;
}

/* ---- 썸네일 위 매입처 뱃지 ---- */
.card .thumb { position: relative; }
.src-badge {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  display: flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  background: rgba(255,255,255,.94); border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.16);
  font-size: 10px; font-weight: 600; letter-spacing: .01em;
  color: var(--text); line-height: 1; white-space: nowrap;
}
.src-badge .mark { width: 13px; height: 13px; border-radius: 3px; object-fit: contain; flex: none; }
.src-badge .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* 상세 페이지의 매입처 표시 */
.src-line { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.src-line .dot { width: 8px; height: 8px; border-radius: 50%; }
.src-line .mark { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }

/* 상세 페이지 추가 이미지 */
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.thumbs img { aspect-ratio: 1; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
