/* O.JAPAN 店頭取り寄せ（仮）モック 共通CSS（外部フォント・外部画像なし） */

/* --- モバイル：横100%固定・バウンス禁止（全社必須） --- */
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  overscroll-behavior: none;
  overflow-wrap: break-word;
}
img, video, iframe { max-width: 100%; height: auto; }
table { max-width: 100%; }
input, textarea, select { max-width: 100%; box-sizing: border-box; }
pre, code { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }

/* --- 基本 --- */
:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1f2328;
  --sub: #5d6470;
  --line: #e2e0da;
  --brand: #b3261e;
  --brand-ink: #ffffff;
  --accent: #1f5f99;
  --ok: #1e7b45;
  --warn: #9a6200;
  --ng: #b3261e;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--accent); }
button { font: inherit; }
.hidden { display: none !important; }

.demo-banner {
  background: #2b2b2b;
  color: #ffe08a;
  text-align: center;
  font-size: 13px;
  padding: 6px 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 800; font-size: 18px; color: var(--brand); text-decoration: none; white-space: nowrap; }
.brand small { color: var(--sub); font-weight: 600; font-size: 12px; margin-left: 6px; }
.topbar .spacer { flex: 1; }
.topbar .btn { white-space: nowrap; }
.mode-badge { font-size: 12px; background: #eef4fb; color: var(--accent); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.blue { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ng { background: #fff; color: var(--ng); border-color: var(--ng); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.cart-btn { position: relative; }
.cart-count { background: var(--brand); color: #fff; border-radius: 999px; font-size: 12px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

main { max-width: 1180px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 6px 0 14px; }
h2 { font-size: 18px; margin: 18px 0 10px; }
.muted { color: var(--sub); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.notice.ng { background: #fdecea; border-color: #f2b8b5; }
.notice.ok { background: #e9f6ee; border-color: #a8d8b9; }
.error-msg { color: var(--ng); font-weight: 700; }

/* タブ・チップ */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tab, .chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-pressed="true"], .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip { min-height: 40px; padding: 6px 14px; font-weight: 600; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.filters { display: grid; gap: 10px; margin: 12px 0 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row .label { font-size: 13px; color: var(--sub); min-width: 64px; }
.search { flex: 1 1 100%; min-height: 48px; font-size: 17px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
select.sort { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 6px 10px; font: inherit; background: #fff; }

/* 商品グリッド */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.p-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; cursor: pointer; text-align: left; padding: 0; color: inherit; }
.p-card:disabled, .p-card.soldout { cursor: not-allowed; opacity: .55; }
.p-thumb { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.p-thumb svg { width: 56%; height: auto; }
.p-body { padding: 10px 12px 14px; display: grid; gap: 4px; min-width: 0; }
.p-source { font-size: 12px; font-weight: 700; color: var(--accent); }
.p-name { font-weight: 700; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.p-price { font-size: 20px; font-weight: 800; }
.p-price small { font-size: 12px; font-weight: 600; color: var(--sub); }
.p-meta { font-size: 12px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #f1efe9; color: var(--sub); }
.tag.ng { background: #fdecea; color: var(--ng); }
.tag.single { background: #fff1d6; color: var(--warn); }

/* 詳細 */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.detail .p-thumb { border-radius: var(--radius); }
.price-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.price-table td { padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.price-table td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.price-table tr.total td { border-bottom: none; font-size: 20px; font-weight: 800; padding-top: 12px; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 22px; font-weight: 800; cursor: pointer; }
.qty button:disabled { opacity: .4; }
.qty output { min-width: 36px; text-align: center; font-size: 20px; font-weight: 800; }
.variant-group { margin: 10px 0; }
.variant-group .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* かご */
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .p-thumb { width: 72px; border-radius: 10px; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; margin-bottom: 8px; background: #fff; }
.radio-card:has(input:checked) { border-color: var(--brand); background: #fff6f5; }
.radio-card input { width: 22px; height: 22px; margin-top: 2px; }

/* 受付票 */
.ticket { max-width: 560px; margin: 0 auto; }
.ref-big { font-size: 56px; font-weight: 900; letter-spacing: .08em; text-align: center; margin: 4px 0; }
.qr-box { display: flex; justify-content: center; }
.qr-box svg { width: 180px; height: 180px; }
.countdown { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: #222; color: #fff; border-radius: 14px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; z-index: 50; width: min(520px, calc(100% - 24px)); flex-wrap: wrap; justify-content: center; }
.countdown .btn { min-height: 40px; }

/* 照会 */
.status-big { font-size: 30px; font-weight: 900; text-align: center; padding: 18px; }
.code-input { font-size: 22px; letter-spacing: .1em; text-transform: uppercase; text-align: center; width: 100%; min-height: 56px; border: 1px solid var(--line); border-radius: 12px; }

/* ダイアログ（確認用） */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.dialog { background: #fff; border-radius: 16px; padding: 20px; width: min(440px, calc(100% - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.footer-note { text-align: center; color: var(--sub); font-size: 12px; padding: 24px 12px 40px; }

/* 縦長スマホ */
@media (max-width: 760px) {
  .detail, .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .p-price { font-size: 17px; }
  .ref-big { font-size: 44px; }
  .brand small { display: none; }
  .topbar { flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; }
  .topbar .spacer { flex: 1 1 100%; height: 0; }
  .topbar .brand { font-size: 16px; }
  main { padding: 12px; }
}

/* 印刷：受付票・引換券だけを出す */
@media print {
  .demo-banner, .topbar, .no-print, .countdown, .overlay { display: none !important; }
  body { background: #fff; }
  .card { border: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---- ご利用の流れ（ポップアップ） ---- */
.dialog.guide { width: min(860px, calc(100% - 16px)); padding: 16px 20px 12px; display: grid; gap: 12px; }
.guide-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.guide-badge { font-size: 13px; font-weight: 800; color: var(--brand); letter-spacing: .06em; }
.guide-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.guide-steps button { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: none; background: none; cursor: pointer; color: var(--sub); font: inherit; border-top: 4px solid var(--line); }
.guide-steps button span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--line); color: var(--ink); font-weight: 800; font-size: 13px; }
.guide-steps button em { font-style: normal; font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; min-width: 0; overflow-wrap: anywhere; }
.guide-steps button.done { border-top-color: #e6a29d; }
.guide-steps button.done span { background: #f3cdca; }
.guide-steps button[aria-current="step"] { border-top-color: var(--brand); color: var(--ink); }
.guide-steps button[aria-current="step"] span { background: var(--brand); color: #fff; }
.guide-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 22px; align-items: center; min-height: 260px; }
.guide-art { background: #f6f3ec; border-radius: 14px; padding: 10px; }
.guide-art svg { display: block; width: 100%; height: auto; }
.guide-text { display: grid; gap: 8px; min-width: 0; }
.guide-text h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.guide-text h2 span { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.guide-lead { margin: 0; font-size: 16px; font-weight: 700; }
.guide-text ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; color: var(--sub); font-size: 14.5px; }
.guide-fee { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.guide-fee .f-item { display: inline-grid; background: #fff6f5; border: 1px solid #f2c4c0; border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: 13.5px; text-align: center; }
.guide-fee .f-item small { font-weight: 600; font-size: 11px; color: var(--sub); }
.guide-fee .f-opt { background: #f4f4f2; border-style: dashed; border-color: var(--line); }
.guide-fee .f-op { font-weight: 900; color: var(--sub); }
.guide-ex { margin: 0; font-size: 13px; color: var(--sub); }
.guide-ex b { color: var(--ink); }
.guide-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.guide-count { color: var(--sub); font-size: 14px; font-variant-numeric: tabular-nums; }
.guide-demo { margin: 0; text-align: center; font-size: 12px; color: var(--sub); }
@media (max-width: 760px) {
  .dialog.guide { padding: 12px 14px 10px; gap: 10px; }
  .guide-body { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 10px; }
  .guide-steps button em { font-size: 10.5px; }
  .guide-text h2 { font-size: 19px; }
  .guide-lead { font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-art svg { animation: guide-in .25s ease-out backwards; }
  @keyframes guide-in { from { opacity: 0; } }
}

/* 言語切り替え */
.lang-select { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; max-width: 120px; }

/* 受付票：日本語以外の時に添える日本語（店員が読む用） */
.ja-sub { display: block; font-size: 12px; font-weight: 400; color: var(--sub, #5d6470); }
