/* 특가일지 — 멀티소스 특가 그리드 */
:root {
  --bg: #f6f4ee;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #757575;
  --faint: #a8a8a8;
  --line: #e9e2d4;
  --accent: #0e7a52;
  --accent-soft: #e7f3ec;
  --cta: #1f66e0;
  --cta-dark: #1857c2;
  --warn: #c0392b;
  --star: #f5a623;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(28, 28, 28, 0.06);
  --header-h: 56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.6;
  word-break: keep-all;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }

/* 헤더 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; text-decoration: none;
}
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.updated-at { font-size: 12.5px; color: var(--muted); }

/* 툴바 (검색 + 필터) */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(246, 244, 238, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
#searchInput {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-size: 15px; background: #fff; color: var(--ink);
}
#searchInput:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
#sortSelect {
  flex: none;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0 10px; font-size: 14px; font-weight: 700;
  background: #fff; color: var(--ink);
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips--source { margin-top: 6px; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 7px 14px;
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  cursor: pointer; white-space: nowrap;
}
.chip .n { font-weight: 400; color: var(--faint); margin-left: 4px; font-size: 12px; }
.chip[aria-selected="true"] {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.chip[aria-selected="true"] .n { color: #cfcfcf; }
.chips--source .chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); }

/* 섹션 */
.section-title { font-size: 20px; margin: 22px 0 14px; letter-spacing: -0.01em; }
.section-title .count {
  font-size: 13px; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 2px 10px; vertical-align: middle; margin-left: 6px;
}
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* 그리드 */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}

/* 카드 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid #f0ebdd;
  display: flex; flex-direction: column;
}
.card-media { position: relative; background: #f4f1e8; }
.card-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card-img--ph {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #e9f3ec, #d9e9df);
}
.card-img--ph span { font-size: 40px; font-weight: 800; color: var(--accent); opacity: 0.55; }
.card.is-soldout .card-img, .card.is-soldout .card-img--ph { filter: grayscale(60%); opacity: 0.75; }
.card-ends {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(28, 28, 28, 0.88); color: #fff;
  font-size: 11.5px; font-weight: 800;
  border-radius: 999px; padding: 4px 10px;
}
.card-soldout-tag {
  position: absolute; left: 10px; top: 10px;
  background: rgba(28, 28, 28, 0.88); color: #fff;
  font-size: 12px; font-weight: 800;
  border-radius: 8px; padding: 4px 10px;
}
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.promo-badge {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--warn);
  border-radius: 6px; padding: 2px 8px;
}
.discount-badge {
  font-size: 11px; font-weight: 800; color: var(--warn);
  background: #fdeeee; border-radius: 6px; padding: 2px 8px;
}
.ad-chip {
  font-size: 11px; font-weight: 800; color: var(--warn);
  border: 1px solid var(--warn); border-radius: 6px; padding: 1px 7px;
}
.source-chip {
  margin-left: auto; font-size: 11px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px;
}
.ship-tag {
  font-size: 11px; font-weight: 700; color: #1f66e0;
  background: #e8f0fd; border-radius: 6px; padding: 2px 8px;
}
.card-title { font-size: 15px; margin: 0; letter-spacing: -0.01em; line-height: 1.45; }
.card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.card-price strong { font-size: 21px; letter-spacing: -0.02em; }
.card-price .list { font-size: 13px; color: var(--faint); text-decoration: line-through; }
.card-price .no-price { font-size: 14px; color: var(--muted); }
.card-meta { font-size: 12.5px; color: var(--muted); margin: 0; }
.card-meta .star { color: var(--star); font-weight: 800; }
.card-cta {
  margin-top: auto; display: block; text-align: center; text-decoration: none;
  background: var(--cta); color: #fff; font-weight: 800; font-size: 15px;
  border-radius: 12px; padding: 12px;
}
.card-cta:active { background: var(--cta-dark); }
.card-cta.is-disabled {
  background: #f1ede2; color: var(--muted); cursor: default; font-weight: 700;
}

/* 끝난 딜 */
.ended { margin: 26px 0 10px; }
.ended summary {
  cursor: pointer; font-size: 16px; font-weight: 800;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; list-style: none;
}
.ended summary::-webkit-details-marker { display: none; }
.ended summary .count {
  font-size: 12px; color: #fff; background: var(--faint);
  border-radius: 999px; padding: 2px 10px; margin-left: 6px; vertical-align: middle;
}
.ended-list { list-style: none; margin: 10px 0 0; padding: 0; }
.ended-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.ended-name { font-size: 14px; color: var(--muted); }
.ended-badge {
  flex: none; font-size: 11px; font-weight: 800; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
  background: #f4f1e8;
}

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 34px;
  padding: 26px 0 60px;
}
.disclosure {
  font-size: 12.5px; color: var(--muted);
  background: #f3efe4; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px;
}
.site-footer .seller-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 8px; }
.site-footer .biz { font-size: 12.5px; color: var(--muted); margin: 0; }
.site-footer .biz a { color: var(--muted); }

/* 반응형 */
@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 380px) {
  .card-body { padding: 12px 12px 14px; }
  .card-price strong { font-size: 19px; }
}
