:root {
  --bg: #f7f8f4;
  --text: #18201b;
  --muted: #607067;
  --line: #d9dfd6;
  --panel: #ffffff;
  --accent: #1c7c54;
  --accent-dark: #145f40;
  --gold: #f0b44c;
  --rose: #d85f64;
  --shadow: 0 16px 40px rgba(24, 32, 27, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(247, 248, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--text);
  color: white;
}

.top-nav {
  display: flex;
  gap: clamp(12px, 2vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  min-height: 620px;
  padding: clamp(44px, 8vw, 104px) clamp(18px, 4vw, 56px) 42px;
  background:
    linear-gradient(115deg, rgba(24, 32, 27, 0.83), rgba(24, 32, 27, 0.35)),
    url("assets/hero-marketplace.svg") center / cover no-repeat;
  color: white;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffe2a6;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-search {
  display: flex;
  width: min(100%, 650px);
  min-height: 58px;
  margin-top: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  overflow: hidden;
}

.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0 18px;
  font-size: 1rem;
  color: var(--text);
}

.hero-search button,
.product-link {
  border: 0;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.hero-search button {
  padding: 0 24px;
}

.hero-search button:hover,
.product-link:hover {
  background: var(--accent-dark);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.quick-filter {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.quick-filter.active,
.quick-filter:hover {
  background: white;
  color: var(--text);
}

.affiliate-note {
  margin: 0;
  padding: 14px clamp(18px, 4vw, 56px);
  background: #fff1d3;
  border-bottom: 1px solid #ecd19d;
  color: #553a0c;
  line-height: 1.5;
}

.section {
  padding: clamp(42px, 7vw, 78px) clamp(18px, 4vw, 56px);
}

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

.sort-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

select {
  min-width: 170px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
}

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

.product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #eef2eb;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.83rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7eee9;
  color: var(--accent-dark);
  font-weight: 800;
}

.product-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
}

.product-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.product-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0 16px 16px;
  border-radius: 8px;
  text-decoration: none;
}

.muted-section {
  background: #edf1ea;
}

.category-grid,
.guide-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.category-card,
.guide-columns article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
}

.category-card {
  display: grid;
  gap: 8px;
  min-height: 122px;
  cursor: pointer;
}

.category-card strong {
  font-size: 1.08rem;
}

.category-card span,
.guide-columns p,
.empty-state {
  color: var(--muted);
  line-height: 1.5;
}

.api-state {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.api-state[data-mode="success"] {
  color: var(--accent-dark);
}

.api-state[data-mode="warning"] {
  color: #8a5a08;
}

.product-price {
  margin: 0;
  color: var(--rose);
  font-size: 1.02rem;
  font-weight: 800;
}

.guide-section {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 30px;
  align-items: start;
}

.guide-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 1080px) {
  .hero,
  .guide-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

  .category-grid,
  .guide-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header,
  .section-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-search {
    display: grid;
  }

  .hero-search input,
  .hero-search button {
    min-height: 54px;
  }

  .hero-panel,
  .product-grid,
  .category-grid,
  .guide-columns {
    grid-template-columns: 1fr;
  }
}
