/* 参考: マイベスト（記事風の見出し・PR枠・下線タブ・成分表・購入ボタン）、nosh（カテゴリボタン・写真付き2列カード） */
:root {
  --text: #333;
  --sub: #777;
  --line: #e5e5e5;
  --bg-gray: #f5f5f5;
  --green: #1f9d55;
  --green-dark: #167a41;
  --orange: #f08300;
  --rakuten: #bf0000;
  --rakuten-dark: #8c0000;
  --amazon: #ff9900;
  --amazon-dark: #c77700;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.gnav { border-bottom: 1px solid var(--line); background: #fff; }
.gnav-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: .02em; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0;
}
.logo-sub { font-size: 11px; color: var(--sub); line-height: 1.3; }

/* パンくず・見出し */
.crumb { display: flex; flex-wrap: wrap; list-style: none; margin: 10px 0 0; padding: 0; font-size: 12px; color: var(--sub); }
.crumb li + li::before { content: "›"; margin: 0 6px; }
.crumb a { text-decoration: none; }
.title { margin: 14px 0 2px; font-size: 21px; line-height: 1.45; font-weight: 700; }
.updated { margin: 0; font-size: 12px; color: var(--sub); }
.intro { margin: 14px 0 10px; }
.pr-box { margin: 0 0 20px; padding: 10px 12px; background: var(--bg-gray); font-size: 12px; color: #555; line-height: 1.6; }

.sec { margin: 22px 0 8px; font-size: 15px; font-weight: 700; padding-left: 8px; border-left: 4px solid var(--green); line-height: 1.3; }
.n { margin-left: 4px; font-size: 11px; font-weight: normal; opacity: .75; }

/* 目的別タブ（下線・はみ出したら横スクロール） */
.tabs { display: flex; border-bottom: 2px solid var(--orange); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.purpose-note { margin: 6px 0 0; font-size: 12px; color: var(--sub); }
.tab {
  flex: none;
  margin-right: 4px; padding: 10px 14px;
  white-space: nowrap;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0;
  background: var(--bg-gray); color: #666;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tab.is-active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* カテゴリ（横スクロール） */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 16px;
  border: 0; border-radius: 999px;
  background: #eee; color: #555;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.chip.is-active { background: var(--green); color: #fff; }
.chip.is-zero { color: #bbb; }
.chips { padding-top: 0; }

/* 並び替え・絞り込み・検索 */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.tool { display: flex; align-items: center; gap: 4px; color: #555; }
.tool svg, .search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tool select { border: 0; background: none; font: inherit; color: inherit; padding: 4px 0; cursor: pointer; }
.tool-btn { flex: none; white-space: nowrap; border: 1px solid #ccc; border-radius: 4px; background: #fff; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.tool-btn[aria-expanded="true"] { border-color: var(--green); color: var(--green-dark); }
.filter-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; }
.filter-n[hidden] { display: none; }

/* 詳しく絞り込むパネル */
.filter { margin-top: 10px; border: 1px solid var(--line); background: #fafafa; font-size: 13px; }
.filter fieldset { margin: 0; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 16px; }
.filter legend { float: left; width: 100%; margin-bottom: 4px; font-weight: 700; font-size: 13px; }
.filter label { display: flex; align-items: center; gap: 6px; color: #555; }
.filter select { padding: 5px 6px; border: 1px solid #ccc; border-radius: 4px; background: #fff; font: inherit; }
.filter .cb input { margin: 0; accent-color: var(--green); width: 16px; height: 16px; }
.filter .hint { width: 100%; margin: 0; font-size: 11px; color: var(--sub); }
.filter-actions { display: flex; gap: 8px; padding: 12px 14px; }
.btn-sub, .btn-main { flex: 1; padding: 10px 0; border-radius: 4px; font: inherit; font-weight: 700; cursor: pointer; }
.btn-sub { border: 1px solid #ccc; background: #fff; color: #555; }
.btn-main { border: 0; background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }

/* 選択中の条件 */
.active { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.active:empty { display: none; }
.cond { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border: 1px solid var(--green); border-radius: 999px; background: #fff; color: var(--green-dark); font: inherit; font-size: 12px; cursor: pointer; }
.cond span { font-size: 13px; color: var(--sub); }
.cond-clear { border: 0; background: none; color: var(--sub); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.search { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 0 10px; border: 1px solid #ccc; border-radius: 4px; color: #999; }
.search input { flex: 1; min-width: 0; border: 0; padding: 9px 0; font: inherit; font-size: 14px; outline: none; }
.count { margin: 14px 0 8px; font-size: 13px; color: var(--sub); }
.count b { color: var(--text); font-size: 16px; }

/* 商品カード */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 28px 18px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.item { display: flex; flex-direction: column; min-width: 0; }
.thumb { position: relative; aspect-ratio: 1; background: var(--bg-gray); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb-empty { display: grid; place-items: center; height: 100%; color: #bbb; font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.badges { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.badge {
  padding: 2px 8px;
  background: var(--green-dark); color: #fff;
  font-size: 11px; font-weight: 700;
}
.badge.b-脂質オフ { background: #2b6cb0; }
.badge.b-高たんぱく { background: #c05621; }
.badge.b-低カロリー { background: #6b46c1; }
.badge.b-塩分控えめ { background: #2c7a7b; }
.badge.b-食物繊維 { background: #8a6d1d; }
.badge.b-常温保存 { background: #555; }
.price { margin: 2px 0 0; font-size: 12px; color: var(--sub); }
.price b { color: #c53030; font-size: 15px; }
.maker { display: flex; justify-content: space-between; gap: 6px; margin: 8px 0 0; font-size: 11px; color: var(--sub); font-weight: 700; letter-spacing: .03em; }
.genre { font-weight: normal; white-space: nowrap; }
.name { margin: 2px 0 6px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.key { display: flex; gap: 12px; margin: 0; font-size: 12px; color: var(--sub); }
.key b { color: var(--text); font-size: 17px; margin-left: 3px; }
.key small { font-size: 11px; color: var(--text); }
.per { margin: 0; font-size: 11px; color: var(--sub); }

/* 成分の詳細（項目名｜値 の表） */
.spec { margin-top: 8px; border-top: 1px solid var(--line); font-size: 12px; }
.spec summary { padding: 6px 0; color: var(--green-dark); font-weight: 700; cursor: pointer; list-style: none; }
.spec summary::-webkit-details-marker { display: none; }
.spec summary::after { content: "＋"; float: right; }
.spec[open] summary::after { content: "－"; }
.spec table { width: 100%; border-collapse: collapse; }
.spec th, .spec td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { width: 42%; background: var(--bg-gray); color: #555; font-weight: normal; }
.spec .src { margin: 6px 0 0; color: var(--sub); font-size: 11px; line-height: 1.5; }

/* 購入ボタン */
.buy-list { display: grid; gap: 6px; margin-top: auto; padding-top: 10px; }
.buy {
  display: block; padding: 9px 4px;
  border-radius: 4px;
  color: #fff; text-align: center; text-decoration: none;
  font-size: 13px; font-weight: 700;
}
.buy.rakuten { background: var(--rakuten); box-shadow: 0 3px 0 var(--rakuten-dark); }
.buy.amazon { background: var(--amazon); box-shadow: 0 3px 0 var(--amazon-dark); color: #111; }
.buy:active { transform: translateY(2px); box-shadow: none; }
.empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--sub); }

/* ページ送り */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 28px 0 8px; }
.pager button {
  min-width: 38px; height: 38px;
  border: 1px solid #ccc; border-radius: 4px;
  background: #fff; font: inherit; cursor: pointer;
}
.pager button.is-active { background: var(--text); border-color: var(--text); color: #fff; }

/* 成分表示について */
.notes { margin: 32px 0 40px; padding: 16px; background: var(--bg-gray); font-size: 12px; color: #555; }
.notes h2 { margin: 0 0 8px; font-size: 14px; color: var(--text); }
.notes dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; }
.notes dt { font-weight: 700; }
.notes dd { margin: 0; }
.notes p { margin: 6px 0 0; }

/* フッター */
.foot { background: #333; color: #ccc; padding: 24px 0 32px; font-size: 12px; }
.foot-logo { margin: 0 0 8px; color: #fff; font-weight: 800; font-size: 15px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0 0 12px; padding: 0; }

/* お酒の注意書き */
.alc { margin: 0 0 4px; font-size: 10px; color: #c53030; }
.alc-note { margin: 0 0 12px; padding: 8px 10px; border: 1px solid #f5c2c2; background: #fff5f5; color: #9b2c2c; font-size: 12px; line-height: 1.6; }
.alc-note[hidden] { display: none; }
.rprice { margin: 0; font-size: 10px; color: var(--sub); line-height: 1.4; }
.credit { margin: 0 0 10px; font-size: 11px; }
.credit a { color: #ccc; }
