/* Notiworks EC。BASE・Shopify の流れに合わせた白黒のストア。
   トークンは saiq-portal src/styles/notiworks.css と同じ値。規約は saiq-ui（白固定・OSフォント・820px・44px・入力16px） */
:root {
  color-scheme: light;
  --bg: #ffffff; --bg-alt: #f7f7f5; --fg: #191919; --fg-muted: #66645f; --fg-soft: #8a877f;
  --line: #e6e5e1; --line2: #d6d4ce; --accent: #191919; --accent-soft: #f1f1ef;
  --err-soft: #f7e7e4; --err-fg: #8f2a23; --err-line: #e8c7c2;
  --radius: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial,
          "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, "Yu Gothic Medium", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.7 var(--sans); }
h1, h2, h3, .lead { word-break: auto-phrase; text-wrap: balance; }
h1 { font-size: clamp(22px, 3vw, 28px); line-height: 1.4; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; }
a { color: var(--fg); }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }
.small, .hint { font-size: 14px; color: var(--fg-muted); }
.hint { margin: 0 0 10px; }
.lead { color: var(--fg-muted); margin: 0 0 20px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 960px; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; }
.skip:focus { left: 12px; top: 12px; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ヘッダー・フッター */
.demo-bar { margin: 0; background: var(--fg); color: #fff; font-size: 13px; text-align: center; padding: 8px 16px; line-height: 1.5; }
.hd { border-bottom: 1px solid var(--line); background: var(--bg); }
.hd-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.logo { font-weight: 700; font-size: 18px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; min-width: 0; }
.hd nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; text-decoration: none; font-size: 15px; white-space: nowrap; }
.ft { border-top: 1px solid var(--line); margin-top: 72px; padding: 24px 0; padding-bottom: max(32px, env(safe-area-inset-bottom)); font-size: 13px; color: var(--fg-muted); }
.ft nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.ft a { min-height: 44px; display: inline-flex; align-items: center; color: var(--fg-muted); }
.ft p { margin: 4px 0; }

/* 一覧 */
.intro { text-align: center; padding: 40px 0 28px; }
.intro p { color: var(--fg-muted); margin: 0 auto; max-width: 36em; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.card-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--bg-alt); margin-bottom: 6px; transition: opacity .15s; }
.card:hover .card-img { opacity: .88; }
.card-name { font-size: 15px; line-height: 1.5; }
.card-price { font-size: 15px; font-weight: 700; }
.ph { display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border: 1px solid var(--line); color: #b9b5ad; }
.ph span { font-size: clamp(32px, 6vw, 56px); font-weight: 700; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; line-height: 1; padding: 4px 6px; border: 1px solid var(--line2); border-radius: 4px; color: var(--fg-muted); }
.empty { text-align: center; color: var(--fg-muted); padding: 40px 0; }

/* 図①：ご注文の流れ */
.howto { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.howto h2 { text-align: center; }
.howto-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.howto-steps li { background: var(--bg-alt); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.howto-steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.howto-steps span:last-child { font-size: 14px; color: var(--fg-muted); }

/* 商品ページ */
.crumb { font-size: 13px; color: var(--fg-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 0; }
.crumb a { color: var(--fg-muted); min-height: 44px; display: inline-flex; align-items: center; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.pdp-media { position: sticky; top: 16px; }
.pdp-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.pdp-price { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.tax { font-size: 13px; font-weight: 400; color: var(--fg-muted); margin-left: 6px; }
.pdp-desc { margin: 16px 0 24px; white-space: pre-line; }
.opt { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.opt legend { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 8px; }
.opt-val { font-weight: 400; color: var(--fg-muted); margin-left: 8px; }
.opt-val::before { content: "："; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 16px; border: 1px solid var(--line2); border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1.35; background: #fff; }
.pill small { font-size: 12px; color: var(--fg-muted); }
.pill:hover span { border-color: var(--fg-soft); }
.pill input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { margin: 0 0 18px; }
.field > label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.opt-tag { font-weight: 400; font-size: 12px; color: var(--fg-muted); border: 1px solid var(--line2); border-radius: 4px; padding: 0 5px; margin-left: 8px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: #fff; border: 1px solid var(--line2); border-radius: 8px; padding: 11px 12px; min-height: 48px; }
input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
textarea { resize: vertical; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--fg-muted); padding-bottom: 2px; }
.day { position: relative; border: 1px solid var(--line2); border-radius: 8px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; cursor: pointer; background: #fff; }
.day input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.day .d { font-size: 14px; font-weight: 700; }
.day .s { font-size: 11px; color: var(--fg-muted); }
.day.off { border-color: transparent; background: var(--bg-alt); color: #b3afa7; cursor: default; }
.day.off .s { color: #a29e96; }
.day:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.day:has(input:checked) .s { color: #fff; }
.day:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.day.pad { visibility: hidden; }

.buybar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.buybar-total { display: flex; flex-direction: column; line-height: 1.3; }
.buybar-total .hint { margin: 0; font-size: 12px; }
.buybar-total strong { font-size: 20px; }
.buybar .btn { flex: 1; max-width: 300px; }
.note { font-size: 13px; color: var(--fg-muted); margin: 8px 0 0; }
.more { margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.more summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-size: 14px; font-weight: 700; }
.more dl { margin: 0 0 14px; font-size: 14px; }
.more dt { color: var(--fg-muted); margin-top: 8px; }
.more dd { margin: 0; }

.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; font-size: 16px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 0 24px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #333; }
.btn-lg { min-height: 54px; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--fg); border-color: var(--line2); font-weight: 400; }
.btn-ghost:hover { background: var(--bg-alt); }
.alert { background: var(--err-soft); color: var(--err-fg); border: 1px solid var(--err-line); border-radius: 8px; padding: 10px 12px; font-size: 15px; margin: 0 0 18px; }
.alert.soft { background: var(--bg-alt); color: var(--fg); border-color: var(--line); }

/* 手続き */
.stepper { list-style: none; padding: 0; margin: 20px 0 28px; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--fg-soft); }
.stepper li { display: flex; align-items: center; gap: 8px; white-space: nowrap; margin: 0; padding: 0; }
.stepper li + li::before { content: "›"; color: var(--line2); }
.stepper .is-done { color: var(--fg-muted); }
.stepper .is-now { color: var(--fg); font-weight: 700; }
.co { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 40px; align-items: start; }
.co-main { grid-column: 1; grid-row: 1; }
.co-side { grid-column: 2; grid-row: 1; background: var(--bg-alt); border-radius: var(--radius); padding: 20px; }
.co-h { font-size: 18px; margin: 0 0 14px; }
.consent { margin: 4px 0 18px; }
.consent label { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; font-size: 15px; }
.consent input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--accent); padding: 0; }
.sum-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.sum-img { width: 64px; height: 64px; flex: none; border-radius: 8px; object-fit: cover; }
.sum-img.ph span { font-size: 22px; }
.sum-name { font-weight: 700; margin: 0; }
.sum-rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.sum-rows dt { color: var(--fg-muted); }
.sum-rows dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line2); margin-top: 14px; padding-top: 14px; }
.sum-total strong { font-size: 20px; }

/* 完了・注文確認 */
.done { max-width: 640px; margin: 0 auto; padding-top: 16px; }
.done h1 { margin-bottom: 6px; }
.check { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); position: relative; margin-bottom: 16px; }
.check::after { content: ""; position: absolute; left: 20px; top: 14px; width: 12px; height: 22px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.done-no { margin: 0 0 4px; font-size: 14px; color: var(--fg-muted); }
.done .sum { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.sum-rows.extra { margin: 14px 0 24px; padding: 0 16px; }
.progress { list-style: none; padding: 0; margin: 4px 0 28px; display: grid; grid-template-columns: repeat(4, 1fr); }
.progress li { position: relative; text-align: center; font-size: 13px; color: var(--fg-soft); padding-top: 22px; }
.progress li span { position: absolute; top: 0; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--line2); z-index: 1; }
.progress li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line2); }
.progress li:first-child::before { display: none; }
.progress li.is-done, .progress li.is-now { color: var(--fg); }
.progress li.is-done span, .progress li.is-now span { background: var(--accent); border-color: var(--accent); }
.progress li.is-done::before, .progress li.is-now::before { background: var(--accent); }
.progress li.is-now { font-weight: 700; }
.keep { background: var(--bg-alt); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.keep p { margin: 0 0 10px; font-size: 14px; }
.url { font-size: 14px !important; min-height: 44px; }

/* 店舗の情報 */
.doc { padding-top: 32px; }
.doc h2 { margin-top: 28px; font-size: 16px; }
.table { display: grid; grid-template-columns: 12em 1fr; border-top: 1px solid var(--line); margin: 16px 0; }
.table dt, .table dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.table dt { color: var(--fg-muted); font-size: 14px; padding-right: 16px; }

/* カテゴリ（一覧の絞り込み） */
.cats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 28px; }
.cats a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid var(--line2); border-radius: 999px; text-decoration: none; font-size: 14px; }
.cats a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.qty select { width: 120px; }
.field.short input { max-width: 200px; }
.co-h.sub { font-size: 16px; margin-top: 28px; }
.ship { border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 24px; }
.ship-h { font-weight: 700; margin: 0 0 8px; }
.ft-safety { color: var(--fg); font-size: 13px; }

@media (max-width: 820px) {
  input, select, textarea { font-size: 16px !important; }
  .wrap { padding: 0 16px; }
  .logo { font-size: 16px; }
  .intro { padding: 28px 0 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .howto-steps { grid-template-columns: 1fr; }
  .pdp { grid-template-columns: 1fr; gap: 16px; }
  .pdp-media { position: static; margin: 0 -16px; }
  .pdp-img { border-radius: 0; }
  .cal { gap: 3px; }
  .cats { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; margin: 0 -16px 20px; padding: 0 16px; }
  .cats a { flex: none; min-height: 44px; }
  .day .d { font-size: 13px; }
  /* 購入ボタンは画面下に固定（BASE・Shopify のスマホと同じ） */
  .buybar { position: sticky; bottom: 0; z-index: 5; background: var(--bg); margin: 8px -16px 0; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line); border-top: 0; }
  .buybar .btn { max-width: none; }
  .co { grid-template-columns: 1fr; gap: 20px; }
  .co-side { grid-column: 1; grid-row: 1; }
  .co-main { grid-row: 2; }
  .table { grid-template-columns: 1fr; }
  .table dt { border-bottom: 0; padding-bottom: 0; }
  .ft { margin-top: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
