:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #15171a;
  --muted: #68707c;
  --line: #dde2ea;
  --accent: #1668e3;
  --accent-strong: #0c4eb2;
  --green: #16875d;
  --orange: #d86614;
  --shadow: 0 18px 45px rgba(23, 32, 49, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef5ff 0, rgba(238, 245, 255, 0) 340px),
    var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.shopping-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.top-panel {
  background: var(--panel);
  border: 1px solid rgba(22, 104, 227, 0.13);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
}

.intro {
  max-width: 720px;
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.count-pill {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid #c8d7f4;
  border-radius: 999px;
  color: var(--accent-strong);
  background: #f4f8ff;
  font-size: 13px;
  font-weight: 800;
}

.search-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

#product-search {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cbd4e0;
  border-radius: 8px;
  padding: 0 18px;
  background: #fbfcfe;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

#product-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 104, 227, 0.14);
}

#clear-search,
.filter-button {
  min-height: 44px;
  border: 1px solid #ccd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #344052;
  cursor: pointer;
  font-weight: 700;
}

#clear-search {
  min-height: 54px;
  padding: 0 16px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.filter-button {
  padding: 0 14px;
}

.filter-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.notice-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0 28px;
  padding: 14px 16px;
  border: 1px solid #f0d9aa;
  border-radius: 8px;
  background: #fff8e8;
  color: #5d4321;
  line-height: 1.5;
}

.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.results-head h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.results-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(20, 31, 49, 0.07);
}

.shorts-preview {
  margin: -6px -6px 16px;
}

.preview-frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 9 / 12;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #101318;
  text-decoration: none;
}

.preview-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.preview-frame:hover img {
  transform: scale(1.035);
}

.preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 12, 18, 0.04), rgba(9, 12, 18, 0.34));
  pointer-events: none;
}

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.92);
  color: #111418;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.preview-frame.is-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(22, 104, 227, 0.22), rgba(22, 135, 93, 0.20)),
    #141820;
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.product-id {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.category-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #25518d;
  font-size: 12px;
  font-weight: 800;
}

.product-card h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.32;
}

.description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.56;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 16px;
  padding-top: 10px;
}

.keyword-row span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f3f6;
  color: #59616d;
  font-size: 12px;
  font-weight: 700;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.link-row.has-one-market,
.link-row.has-no-market {
  grid-template-columns: 1fr 2fr;
}

.link-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.shorts-link {
  background: #121417;
  color: #ffffff;
}

.coupang-link {
  background: var(--orange);
  color: #ffffff;
}

.ali-link {
  background: var(--green);
  color: #ffffff;
}

.link-button.is-disabled {
  pointer-events: none;
  background: #e4e8ee;
  color: #8a93a0;
}

.link-button.is-hidden {
  display: none;
}

.empty-state {
  border: 1px dashed #b8c3d2;
  border-radius: 8px;
  background: #ffffff;
  padding: 36px 20px;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.stats-footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  color: #747d89;
  font-size: 13px;
}

.stats-footer span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid #dce3ec;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 12px;
}

.stats-footer strong {
  color: var(--text);
  font-weight: 900;
}

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

@media (max-width: 860px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shopping-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
    padding-bottom: 34px;
  }

  .top-panel {
    padding: 20px;
  }

  .brand-row,
  .results-head,
  .notice-strip {
    display: block;
  }

  .count-pill {
    display: inline-block;
    margin-top: 16px;
  }

  .search-wrap {
    grid-template-columns: 1fr;
  }

  .results-head p {
    margin-top: 6px;
    text-align: left;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-card {
    min-height: 0;
    padding: 16px;
  }

  .shorts-preview {
    display: none;
  }

  .card-topline {
    margin-bottom: 10px;
  }

  .product-card h3 {
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.34;
  }

  .description {
    font-size: 13px;
    line-height: 1.5;
  }

  .keyword-row {
    margin: 8px 0 12px;
    padding-top: 0;
  }

  .keyword-row span {
    font-size: 11px;
  }

  .link-button {
    min-height: 44px;
  }

  .stats-footer {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}
