:root {
  --primary: #ff9900;
  --primary-dark: #e88a00;
  --bg: #fafafa;
  --card-bg: #fff;
  --text: #232f3e;
  --text-light: #555;
  --border: #ddd;
  --badge-red: #cc0c39;
  --badge-green: #067d62;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ── Header ── */
header {
  background: var(--text);
  color: #fff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
header .container { display: flex; align-items: center; justify-content: space-between; }
header h1 { font-size: 18px; font-weight: 700; }
header h1 span { color: var(--primary); }
header nav a { color: #ccc; margin-left: 20px; font-size: 13px; }
header nav a:hover { color: #fff; text-decoration: none; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
  color: #fff;
  padding: 32px 0;
  text-align: center;
}
.hero h2 { font-size: 22px; margin-bottom: 8px; }
.hero p { font-size: 14px; color: #adb5bd; }
.hero .update-time { color: var(--primary); font-weight: 700; font-size: 13px; margin-top: 8px; }
.hero .notice { color: #adb5bd; font-size: 11px; margin-top: 4px; }

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  justify-content: space-around;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.stat { text-align: center; }
.stat-num { display: block; font-size: 24px; font-weight: 700; color: var(--primary-dark); }
.stat-label { font-size: 12px; color: var(--text-light); }

/* ── Category Nav ── */
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  justify-content: center;
}
.cat-nav a {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.cat-nav a:hover, .cat-nav a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-group label { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.filter-group select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
}
#filter-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ── Product Cards ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }

.card-top {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.card-img {
  width: 80px;
  height: 110px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: #f5f5f5;
}
.card-info { flex: 1; min-width: 0; }

.product-card .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  width: fit-content;
}
.badge-discount { background: var(--badge-red); }
.badge-discount-high { background: #7c0a02; animation: pulse 2s infinite; }
.badge-lowest { background: #059669; animation: pulse 2s infinite; }
.badge-category { font-weight: 400; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .8; }
}

.product-card .title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .author {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.price-current { font-size: 20px; font-weight: 700; color: var(--badge-red); }
.price-original { font-size: 13px; color: #999; text-decoration: line-through; }
.price-save {
  font-size: 11px;
  color: #059669;
  font-weight: 600;
  background: #ecfdf5;
  padding: 1px 6px;
  border-radius: 3px;
}

.product-card .meta {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 10px;
}
.meta .stars { color: var(--primary); }

.product-card .cta {
  display: block;
  text-align: center;
  background: var(--primary);
  color: #fff;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-top: auto;
}
.product-card .cta:hover { background: var(--primary-dark); text-decoration: none; }

/* ── Section ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 8px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 8px;
}
.section-header h2 { font-size: 18px; }
.section-header .count { font-size: 13px; color: var(--text-light); }

/* ── Footer ── */
footer {
  background: var(--text);
  color: #adb5bd;
  text-align: center;
  padding: 24px 0;
  margin-top: 40px;
  font-size: 12px;
}
footer a { color: var(--primary); }
.footer-nav { margin-top: 8px; }
.footer-nav a { margin: 0 8px; }

/* ── Page Content ── */
.page-content { padding: 32px 16px; }
.page-content h2 { margin-bottom: 16px; }
.page-content h3 { margin: 20px 0 8px; font-size: 16px; }
.page-content p { margin-bottom: 8px; }

/* ── Header link ── */
header h1 a { color: #fff; text-decoration: none; }
header h1 a:hover { text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .product-grid { grid-template-columns: 1fr; }
  header h1 { font-size: 15px; }
  .hero h2 { font-size: 18px; }
  .stats-bar { flex-wrap: wrap; gap: 8px; }
  .stat { flex: 1; min-width: 70px; }
  .stat-num { font-size: 20px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  #filter-count { margin-left: 0; text-align: right; }
  .card-img { width: 60px; height: 85px; }
}

/* ── Category Intro ── */
.cat-intro {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

/* ── Utility ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
