/* FRIJOLES 栄養成分・アレルギー情報
   ブランドトークン(色・タイポ)は社内デザイン規定に準拠。
   モノクロ(スミ#161616)+クラフトベージュ#F7F3EA+アクセントはコーンイエロー#E8A33D 1色。
   コーンは1画面1箇所(下部kcalトレイ)に限定。意味色は彩度を抑えた
   ●含む=ブリック / △コンタミ=琥珀(corn-700) / ベジ系=グリーン。 */
:root {
  --ink: #161616;
  --body-text: #2A2721;
  --paper: #ffffff;          /* カード面 */
  --page: #F7F3EA;           /* ページ地(クラフトベージュ) */
  --wash: #EFE8D6;
  --line: #D8D2C4;
  --muted: #6E6A60;
  --faint: #928D81;
  --red: #9E3B32;
  --red-wash: #F1E0DD;
  --amber: #B77A22;
  --amber-wash: #F7E6CD;
  --green: #4E7A52;
  --green-wash: #E5EDE2;
  --corn: #E8A33D;
  --corn-press: #CE8B2C;
  --corn-tint: #FBEED2;
  --radius: 12px;
  --shadow-md: 0 6px 18px rgba(22, 22, 22, 0.08);
  --shadow-lg: 0 18px 44px rgba(22, 22, 22, 0.10);
  --sans: "Noto Sans JP", "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --num: "Roboto", "Helvetica Neue", Arial, var(--sans);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--body-text);
  background: var(--page);
  line-height: 1.65;
  font-size: 15.5px;
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 96px; /* trayぶん */
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.num, .tray-kcal b, .step-num, table.nutri td { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ---------- ヘッダー(スミの黒バー+ワードマーク実データ) ---------- */
.draft-banner {
  background: var(--amber-wash); color: #8A5A20;
  font-size: 12px; font-weight: 600; text-align: center; padding: 6px 12px;
}
.site-head {
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
}
.brand { display: flex; flex-direction: column; gap: 6px; }
.logo-img { display: block; height: 44px; width: auto; }
.brand-sub { font-size: 10px; letter-spacing: 0.14em; color: #D8D2C4; }
.lang-btn {
  border: 1px solid #fff; border-radius: 999px; color: #fff;
  padding: 6px 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
}
.lang-btn:active { background: #fff; color: var(--ink); transform: scale(0.97); }
.head-actions { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.print-btn {
  border: 1px solid #fff; border-radius: 999px; color: #fff;
  padding: 6px 14px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.print-btn:active { background: #fff; color: var(--ink); transform: scale(0.97); }

/* ---------- タブ ---------- */
.tabs {
  display: flex; border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; background: var(--page); z-index: 20;
}
.tab {
  flex: 1; padding: 12px 4px; font-size: 13px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.view { padding: 16px; }

/* ---------- 黒セクションバー(紙メニュー踏襲) ---------- */
.section-bar {
  background: var(--ink); color: #fff;
  padding: 7px 12px; border-radius: 4px;
  display: flex; align-items: baseline; gap: 10px;
  margin: 22px 0 12px;
}
.section-bar:first-child { margin-top: 4px; }
.section-bar .en { font-size: 10px; letter-spacing: 0.28em; color: #cfccc6; text-transform: uppercase; font-family: var(--num); }
.section-bar h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }

/* STEP見出し(紙メニューのSTEP数字) */
.step-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.step-head:first-child { margin-top: 4px; }
.step-num { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.step-label { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.step-head .step-title { font-size: 14px; font-weight: 700; display: block; color: var(--ink); }

/* ---------- チップ・カード選択 ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; background: var(--paper);
  transition: background 0.15s cubic-bezier(.4,0,.2,1);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.small { padding: 5px 10px; font-size: 12px; font-weight: 500; }
.chip:disabled { opacity: 0.35; cursor: default; }
.chip:active:not(:disabled) { transform: scale(0.97); }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.select-card {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px; text-align: left; background: var(--paper);
}
.select-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.select-card b { display: block; font-size: 14px; color: var(--ink); }
.select-card .sub { font-size: 11px; color: var(--muted); }

.hint { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }

/* ---------- トッピング行+ステッパー ---------- */
.top-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.top-row .name { flex: 1; font-size: 13.5px; }
.top-row .name .g { color: var(--muted); font-size: 11px; margin-left: 6px; font-family: var(--num); }
.top-row .badges { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: 1px; }
.top-row.off .name { color: var(--faint); text-decoration: line-through; }

.stepper { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.stepper button { width: 34px; height: 30px; font-size: 17px; font-weight: 600; color: var(--ink); }
.stepper button:disabled { color: var(--line); cursor: default; }
.stepper .count { min-width: 42px; text-align: center; font-size: 12px; font-weight: 700; font-family: var(--num); }
.stepper .count small { display: block; font-size: 9px; color: var(--muted); font-weight: 500; line-height: 1; font-family: var(--sans); }

/* ---------- バッジ ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px;
  border: 1px solid currentColor; line-height: 1.5;
}
.badge.vegan { color: var(--green); background: var(--green-wash); }
.badge.bacon { color: var(--red); background: var(--red-wash); }
.badge.gf { color: var(--amber); background: var(--amber-wash); }
.badge.spicy { color: var(--red); border: none; padding: 0; font-size: 11px; }
.badge.preg { color: var(--amber); background: var(--amber-wash); }

/* アレルゲンチップ(●/△) */
.al-chip {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-size: 11.5px; border-radius: 5px; padding: 2px 7px; font-weight: 600;
}
.al-chip.c { background: var(--red-wash); color: var(--red); }
.al-chip.t { background: var(--amber-wash); color: var(--amber); }
.al-chip sup { font-size: 8px; }
.al-none { font-size: 12px; color: var(--muted); }

/* ---------- 商品一覧(白カード化) ---------- */
.cat-tabs { display: flex; gap: 8px; margin-bottom: 4px; position: sticky; top: 44px; background: var(--page); padding: 8px 0; z-index: 10; }
.group {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; padding: 0 12px;
}
.group summary {
  list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 2px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink);
}
.group summary::-webkit-details-marker { display: none; }
.group summary .caret { margin-left: auto; color: var(--muted); transition: transform 0.15s; font-size: 11px; }
.group[open] summary .caret { transform: rotate(180deg); }
.group .kcal-hint { color: var(--muted); font-weight: 500; font-size: 12px; font-family: var(--num); }
.group-body { padding: 0 2px 14px; }

table.nutri { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
table.nutri th, table.nutri td { padding: 5px 8px; border-bottom: 1px solid var(--wash); text-align: right; }
table.nutri th { font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap; font-family: var(--sans); }
table.nutri thead th { text-align: right; font-size: 11px; padding-bottom: 2px; }
table.nutri .unit { font-size: 10px; color: var(--muted); margin-left: 1px; }
.al-line { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.al-label { font-size: 11px; color: var(--muted); margin-right: 2px; }

/* ---------- アレルギー検索 ---------- */
.al-grid { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.al-select {
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; background: var(--paper);
}
.al-select[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.al-divider { width: 100%; font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; margin-top: 4px; }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 10px 0; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--ink); }
.result-count { font-size: 13px; font-weight: 700; margin: 12px 0 4px; color: var(--ink); }

/* ---------- 結果トレイ(コーンイエロー=この画面唯一のアクセント) ---------- */
.tray {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 640px; margin: 0 auto; padding: 0 10px 10px;
  pointer-events: none;
}
.tray-bar, .tray-detail { pointer-events: auto; }
.tray-bar {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--corn); color: var(--ink);
  border-radius: 14px; padding: 13px 18px;
  box-shadow: var(--shadow-lg);
}
.tray-bar:active { background: var(--corn-press); }
.tray-kcal { font-size: 13px; font-weight: 600; }
.tray-kcal b { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin-right: 2px; }
.tray-summary { flex: 1; text-align: left; font-size: 11px; color: rgba(22, 22, 22, 0.72); line-height: 1.3; }
.tray-toggle { font-size: 12px; }
.tray[data-open="true"] .tray-toggle { transform: rotate(180deg); }
.tray-detail {
  background: var(--paper); border: 1.5px solid var(--ink);
  border-radius: 14px; margin-bottom: 8px; padding: 14px 16px;
  max-height: 55vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.tray { display: flex; flex-direction: column-reverse; }
.flag-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

/* ---------- フッター ---------- */
.site-foot { padding: 26px 16px 40px; border-top: 2px solid var(--ink); margin-top: 30px; }
.brand-line { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); margin-bottom: 10px; }
.notice { font-size: 11px; color: var(--muted); }
.footnotes { margin-top: 10px; font-size: 11px; color: var(--muted); }
.footnotes summary { cursor: pointer; font-weight: 600; }
.footnotes ol { padding-left: 1.4em; margin-top: 6px; }
.footnotes li { margin-bottom: 4px; }
.base-date { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ---------- 印刷 / PDF（beforeprint と ?print=1 が同じクラスを付ける） ---------- */
.print-sheet { display: none; }

body.print-view {
  max-width: none; width: 277mm; min-height: 190mm;
  margin: 0 auto; padding: 0;
  color: #000; background: #fff;
  font-family: "Yu Gothic", YuGothic, "Hiragino Sans", Meiryo, sans-serif;
  font-size: 7pt; line-height: 1.25;
}
body.print-view > .draft-banner,
body.print-view > .site-head,
body.print-view > .tabs,
body.print-view > .view,
body.print-view > .tray,
body.print-view > .site-foot { display: none !important; }
body.print-view > .print-sheet { display: block; width: 100%; }

.print-head { margin: 0 0 3mm; border-bottom: .35mm solid #000; padding-bottom: 2mm; }
.print-store { font-size: 8pt; font-weight: 800; letter-spacing: .18em; }
.print-head h1 { font-size: 14pt; line-height: 1.15; margin: .5mm 0 1mm; }
.print-meta, .print-filter { font-size: 7pt; margin-top: .6mm; }
.print-filter { font-weight: 700; }

.print-product-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-size: 5.5pt; line-height: 1.08; color: #000;
}
.print-product-table thead { display: table-header-group; }
.print-product-table tfoot { display: table-footer-group; }
.print-product-table tr { break-inside: avoid; page-break-inside: avoid; }
.print-product-table th, .print-product-table td {
  border: .15mm solid #555; padding: .6mm .35mm; overflow-wrap: anywhere;
}
.print-product-table thead th {
  background: #eee; text-align: center; vertical-align: bottom; font-weight: 700;
}
.print-product-table tbody th { text-align: left; font-weight: 600; }
.print-product-table td { text-align: right; font-variant-numeric: tabular-nums; }
.print-product-table th:first-child { width: 42mm; }
.print-product-table th:nth-child(2) { width: 16mm; }
.print-product-table th:nth-child(n+3):nth-child(-n+8) { width: 9.5mm; }
.print-product-table .print-allergen-head {
  width: 5.8mm; height: 25mm; padding: .8mm .25mm;
  writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap;
}
.print-product-table .print-mark { text-align: center; font-size: 6.2pt; font-weight: 700; }
.print-unit { display: block; font-size: 4.7pt; font-weight: 400; }
.print-builder-total th, .print-builder-total td {
  border-top: .45mm double #000; background: #eee; font-weight: 800;
}
.print-notes {
  break-before: page; page-break-before: always;
  padding-top: 2mm; font-size: 8.5pt; line-height: 1.45;
}
.print-notes h2 { font-size: 12pt; margin-bottom: 2mm; }
.print-notes ol { padding-left: 1.8em; }
.print-notes li { margin-bottom: 1.2mm; break-inside: avoid; page-break-inside: avoid; }
.print-notice { border-top: .3mm solid #000; margin-top: 3mm; padding-top: 2mm; font-weight: 700; }

@page { size: A4 landscape; margin: 10mm; }

@media (max-width: 380px) {
  .card-grid { grid-template-columns: 1fr; }
  body { font-size: 14.5px; }
  .logo-img { height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.contact { margin: .6rem 0 0; text-align: center; }
.contact-link { color: inherit; font-size: .82rem; opacity: .85; text-underline-offset: 3px; }
.contact-link:hover, .contact-link:focus-visible { opacity: 1; }
