@charset "UTF-8";

/* =========================================================
   お客様向け注文画面 (スマートフォン最優先)
   /order/ ・ /order/info/ ・ /order/history/ ・ /order/privacy.html 共通

   見た目の方針 (洋菓子店の店頭に置いても違和感のない清潔感):
     - 白と明るいグレーの2色を土台にし、装飾と濃い色は増やさない
     - 上部 (店舗名・案内) は白、操作エリアはごく薄いグレー、
       商品カードと入力欄は白 … で「読む所」と「触る所」を分ける
     - 主役は商品写真。枠線・影・角丸は控えめにして写真の邪魔をしない
     - 文字は黒ではなく濃いグレー。高齢の方でも読める大きさを優先する

   配色・角丸・余白はすべて下の :root の変数で決まる。
   店舗ごとのテーマを作るときは、この CSS を書き換えず
   後から読み込む CSS で :root の「役割の色」だけを上書きすればよい。
   ========================================================= */

:root {
  /* --- 素材の色 (パレット。ここは直接使わず、下の「役割の色」から参照する) --- */
  --palette-white: #ffffff;
  --palette-gray-50: #f5f6f7; /* 操作エリアの背景 */
  --palette-gray-100: #eef0f2; /* 区切り帯・無効状態 */
  --palette-gray-200: #dfe2e6; /* 罫線 */
  --palette-gray-300: #c9ced4; /* 濃いめの罫線 */
  --palette-gray-350: #9aa1a8; /* 押せない状態の文字 */
  --palette-gray-400: #6e757c; /* プレースホルダー (白地で 4.6:1。薄いが読める濃さ) */
  --palette-gray-500: #63696f; /* 補足説明 */
  --palette-gray-900: #33383d; /* 本文 (黒は使わない) */
  --palette-blue-50: #eaf1fc;
  --palette-blue-600: #1765cf; /* 主要ボタン */
  --palette-blue-700: #114fa6;
  --palette-red-50: #fdecec;
  --palette-red-600: #c62828; /* 必須・エラー */
  --palette-green-50: #e7f6ec;
  --palette-green-700: #1a7f37;
  --palette-amber-50: #fff4e0;
  --palette-amber-500: #e08a00;
  --palette-amber-800: #7a4300; /* 薄いオレンジの上で 7:1 以上 */
  --palette-cream-50: #fffaf0; /* 初めてのお客様の入力の枠 (本文の文字で 11:1・補足の文字で 5:1 以上) */
  --palette-cream-400: #d6c29c; /* 枠の中の区切り線 */
  --palette-cream-700: #a8874d; /* 枠の線 (ページの背景・枠の中の色の両方に 3:1 以上) */

  /* --- 役割の色 (店舗テーマで差し替えるのはここ) --- */
  --color-page-bg: var(--palette-gray-50);
  --color-top-bg: var(--palette-white);
  --color-surface: var(--palette-white);
  --color-surface-muted: var(--palette-gray-100);
  --color-text: var(--palette-gray-900);
  --color-text-strong: #23272b;
  --color-text-muted: var(--palette-gray-500);
  --color-placeholder: var(--palette-gray-400);
  --color-disabled-text: var(--palette-gray-350); /* 押せない状態。読ませる文字ではない */
  --color-border: var(--palette-gray-200);
  --color-border-strong: var(--palette-gray-300);
  --color-primary: var(--palette-blue-600);
  --color-primary-dark: var(--palette-blue-700);
  --color-primary-soft: var(--palette-blue-50);
  --color-on-primary: #ffffff;
  --color-required: var(--palette-red-600);
  --color-ng: var(--palette-red-600);
  --color-ng-soft: var(--palette-red-50);
  --color-ok: var(--palette-green-700);
  --color-ok-soft: var(--palette-green-50);
  --color-notice: var(--palette-amber-800); /* 気づいてほしい案内 (別包装など) */
  --color-notice-soft: var(--palette-amber-50);
  --color-notice-border: var(--palette-amber-500);
  --color-group-bg: var(--palette-cream-50); /* 一部の方だけが入れる項目をまとめる枠 */
  --color-group-border: var(--palette-cream-700);
  --color-group-divider: var(--palette-cream-400);
  --color-focus: #0b57c9;

  /* --- 角丸 (控えめに) --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  /* --- 余白・寸法 --- */
  --space-edge: 16px; /* 画面左右の余白 (端に文字・ボタンを付けない) */
  --control-height: 3.25rem; /* 入力欄・主要ボタンの高さを揃える (文字を大きくすると一緒に育つ) */
  --content-width: 560px;

  --font-ja: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic",
    "Noto Sans JP", "Meiryo", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

/* hidden 属性は display 指定より必ず優先させる */
[hidden] {
  display: none !important;
}

/*
 * 入力欄に入ったときやボタンへ移ったときに、下に固定したバー (合計・確認へ進む) の裏へ隠さない。
 * キーボードで画面が縮む端末 (Android の LINE の中など) では、バーがキーボードのすぐ上に来て、
 * 下の方の欄 (メールアドレス・「確認コードを送信する」) に重なることがある。バーの高さだけ余白を取って止める。
 */
html {
  scroll-padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

body {
  margin: 0;
  background: var(--color-page-bg);
  color: var(--color-text);
  font-family: var(--font-ja);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere; /* 長い商品名・住所でも画面外へはみ出させない */
}

/* キーボード操作のフォーカスは必ず見えるようにする (タップでは出さない) */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* 画面には出さないがスクリーンリーダーには読ませる文言 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- 上部 (店舗名): LINEミニアプリの白いヘッダーからそのまま続く見た目 ---- */
.order-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-top-bg);
  color: var(--color-text-strong);
  padding: 14px var(--space-edge);
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.step {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4px var(--space-edge) 7.75rem; /* 下部バーに隠れないよう余白を確保 */
}

.section-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 22px 0 8px;
}

.loading-text,
.hint-text {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/*
 * カテゴリのタブ (すべて | お弁当 | お惣菜 | …)。
 * 横一列に並べ、入りきらないときは帯だけを左右に動かす (ページは横に動かさない)。
 * 下へ送っても店名の帯のすぐ下に残る (top は店名の帯の高さ。order.js の placeCategoryTabs が入れる)。
 */
.category-tabs {
  position: sticky;
  top: 3.25rem;
  z-index: 15;
  margin: 0 calc(-1 * var(--space-edge)) 10px;
  background: var(--color-page-bg);
  border-bottom: 1px solid var(--color-border);
}

.category-tabs-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px var(--space-edge);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs-list::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  max-width: 11em; /* 長い名前は途中で切る (全部は title と見出しで読める) */
  min-height: 44px; /* 指で押しやすい大きさ */
  padding: 0 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.category-tab.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.category-tab:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* 「すべて」のタブで、カテゴリごとに付ける見出し */
.category-heading {
  margin: 10px 0 -4px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.category-heading:first-child {
  margin-top: 0;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/*
 * 商品画像は「どの商品も同じ大きさ・同じ縦横比」で並べる。
 * contain なので、縦長・横長どちらの写真でもケーキ本体が切れず、
 * 引き伸ばしも起きない (足りない部分は白で埋まる)。
 */
.product-image,
.product-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.product-image {
  object-fit: contain;
  object-position: center;
}

/* 画像未登録・読み込み失敗のときの共通の代替表示 (壊れた画像アイコンは出さない) */
.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.product-image-placeholder svg {
  width: 3rem;
  height: 3rem;
  opacity: 0.7;
}

.product-image-placeholder .placeholder-text {
  font-size: 0.875rem;
}

.product-body {
  padding: 14px var(--space-edge) 16px;
}

.product-name {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 0 0 6px;
  line-height: 1.5;
}

.product-description {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 0 0 10px;
}

/* サイズのある商品で、サイズごとの価格表の見出しになる行 */
.product-price-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 0 0 4px;
}

/* 価格に添える「(税込)」などの小さな注記 */
.price-tax {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 4px;
  white-space: nowrap;
}

.product-remaining {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

.soldout-badge {
  display: inline-block;
  background: var(--color-ng-soft);
  color: var(--color-ng);
  border: 1px solid var(--color-ng);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 3px 12px;
  margin-bottom: 8px;
}

/* ---- 数量ステッパー ---- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.stepper-btn {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.stepper-btn:active:not(:disabled) {
  background: var(--color-surface-muted);
}

.stepper-btn:disabled {
  border-color: var(--color-border);
  color: var(--color-disabled-text);
  background: var(--color-surface-muted);
  cursor: default;
}

.stepper-qty {
  min-width: 2.75rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

/* ---- 下部固定バー ---- */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--space-edge) calc(12px + env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.bottom-total {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bottom-total-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.bottom-total-price {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

/* ---- ボタン ---- */
.btn-primary {
  flex: 1;
  max-width: 240px;
  min-height: var(--control-height);
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.btn-primary:active:not(:disabled) {
  background: var(--color-primary-dark);
}

.btn-primary:disabled {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  cursor: default;
}

/* 送信中: 無効状態に加えて「動いている」ことが分かるようにする */
.btn-primary.is-busy::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-text-muted);
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary.is-busy::before {
    animation: none;
  }
}

.btn-order {
  max-width: none;
}

/*
 * 下部固定バーのボタンは、文字の長さに合わせて幅を取る (足りない分は合計欄を詰める)。
 * 最低でもバーの半分、最大は .btn-primary と同じ 240px。
 * 合計欄と半分ずつ分け合う作り (flex: 1) では、Android 実機 (幅 411px・LINE の中) で
 * 「カートを見る（1点）」が2行になった (2026-10-06)。文字が少し大きい端末だと半分の幅では足りない。
 */
.bottom-bar .btn-primary {
  flex: 0 1 auto;
  min-width: min(50%, 240px);
  padding-left: 12px;
  padding-right: 12px;
}

/* 確認画面の「注文を確定する」はバーに1つだけなので、横いっぱいに広げる */
.bottom-bar .btn-order {
  flex: 1 1 auto;
}

/* ボタンの中の「（2点）」。途中で改行しない */
.btn-count {
  display: inline-block;
  white-space: nowrap;
}

/* 副ボタン (戻る・変更する・続けて注文する) */
.btn-secondary,
.btn-outline {
  min-height: var(--control-height);
  padding: 13px 20px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.btn-secondary:active,
.btn-outline:active {
  background: var(--color-surface-muted);
}

.btn-back {
  border: none;
  background: none;
  color: var(--color-primary-dark);
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 10px 2px;
  margin-top: 4px;
  cursor: pointer;
  font-family: inherit;
}

/* ---- 入力 ---- */
.text-input,
.textarea-input {
  width: 100%;
  min-height: var(--control-height);
  padding: 13px 14px;
  font-size: 1.0625rem;
  color: var(--color-text-strong);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: inherit;
}

/*
 * 1行の入力欄 (input・select) は、高さを --control-height にそろえる (docs/order-ui-design.md)。
 * 高さを中身に任せると、ブラウザが input / select に当てる line-height: normal が
 * フォントによって変わり、そろわなくなる。例: 17px のヒラギノは行の高さが 26px あり、
 * input だけ 13+26+13+枠2 = 54px に伸びる (select は行の高さを使わず 52px のまま)。
 * 文字は上下中央に置かれるので、上下の padding は付けない (左右だけ)。
 * --control-height は rem なので、ブラウザの文字を大きくすると一緒に高くなる。
 */
.text-input {
  height: var(--control-height);
  padding-top: 0;
  padding-bottom: 0;
}

/* 複数行の入力欄は、中身に合わせて伸ばす (最低の高さだけ決める) */
.textarea-input {
  font-size: 1rem;
  resize: vertical;
}

.text-input::placeholder,
.textarea-input::placeholder {
  color: var(--color-placeholder);
}

.text-input:focus,
.textarea-input:focus {
  border-color: var(--color-primary);
}

/* エラーのある項目だけを赤くする (通常状態の枠は赤くしない) */
.text-input.is-error,
.textarea-input.is-error {
  border-color: var(--color-ng);
  background: var(--color-ng-soft);
}

.field {
  margin-bottom: 18px;
}

/*
 * 受取日 (と受取時間) の欄。商品や入力欄に埋もれないよう、色の付いた枠で囲み、選んだ日を太く大きく出す。
 * 受取日を1ページ目 (商品の上) に出すお店では #pickup-date-slot、ほかのお店ではお客様情報の下の #pickup-section。
 * 2026-10-06: 実機の確認で「受取日が目立たない」との指摘 (白いプルダウンが、ほかの入力欄と同じ見た目だった)。
 */
#pickup-date-slot,
#pickup-section {
  margin: 4px 0 20px;
  padding: 14px 14px 0;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
}

#pickup-date-slot .field,
#pickup-section .field {
  margin-bottom: 14px;
}

#pickup-date-slot .field-label,
#pickup-section .field-label {
  font-size: 1.0625rem;
  color: var(--color-primary-dark);
}

#pickup-date-slot select.text-input,
#pickup-section select.text-input {
  border: 2px solid var(--color-primary);
  background-color: var(--color-surface);
  font-size: 1.1875rem;
  font-weight: 700;
}

#pickup-date-slot .hint-text,
#pickup-section .hint-text {
  color: var(--color-text);
}

.field-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-strong);
  margin-bottom: 6px;
}

.field .hint-text {
  margin: 6px 0 0;
}

/* 入力欄のすぐ下に、原因を日本語で出す */
.field-error {
  margin: 6px 0 0;
  color: var(--color-ng);
  font-size: 0.875rem;
  font-weight: 700;
}

.required-tag,
.optional-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

/* 必須は色だけでなく「必須」の文字で伝える (赤地に白文字) */
.required-tag {
  background: var(--color-required);
  color: #fff;
}

.optional-tag {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ---- サイズ選択 (サイズ必須商品) ---- */
/*
 * 「4号（約2〜4人分）」のような長いサイズ名でも 375px で詰まらないよう、
 * 1行目にサイズ名、2行目に価格と個数を置く。
 * 名前・価格・個数の3つを1行に詰めると、名前が2〜3行に折れて価格と重なって見える。
 */
.size-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name name"
    "price stepper";
  align-items: center;
  gap: 4px 10px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
}

.size-row:first-child {
  border-top: none;
}

.size-row-name {
  grid-area: name;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-strong);
  min-width: 0;
  overflow-wrap: anywhere;
}

.size-row-price {
  grid-area: price;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-strong);
  white-space: nowrap;
}

.size-row .stepper {
  grid-area: stepper;
}

/* サイズ行のステッパーは少し小さくして 375px 幅でも収める */
.size-row .stepper {
  gap: 8px;
}

.size-row .stepper-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: 1.3125rem;
}

.size-row .stepper-qty {
  min-width: 2rem;
  font-size: 1.3125rem;
}

/* ---- お客様情報 (登録済み表示) ---- */
.customer-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px var(--space-edge) 16px;
}

.customer-summary-list {
  margin: 0 0 14px;
}

.customer-summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.customer-summary-list > div:last-child {
  border-bottom: none;
}

.customer-summary-list dt {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.customer-summary-list dd {
  margin: 0;
  font-weight: 700;
  color: var(--color-text-strong);
  text-align: right;
  overflow-wrap: anywhere;
}

/*
 * 初めてご利用のお客様が入れる項目 (お名前〜メールアドレスの確認)。どこからどこまでかが一目で分かるよう、
 * 受取日の青い枠とは別の色 (クリーム色) の角丸の枠で囲む。登録済みの方の画面では枠を付けない (is-first-time なし)。
 * 2026-10-23: 初回だけの項目が、毎回入れる項目と同じように並んでいて分かりにくいとのご指摘。
 */
.customer-entry.is-first-time {
  margin-top: 4px;
  padding: 16px 14px 6px;
  border: 2px solid var(--color-group-border);
  border-radius: var(--radius-lg);
  background: var(--color-group-bg);
}

.first-time-head {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-group-divider);
}

.first-time-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-strong);
}

.first-time-lead {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  color: var(--color-text);
}

/* 枠の中の「ご注文の連絡先」は、枠の中の区切り (線の下の小見出し) にする */
.customer-entry.is-first-time .contact-title {
  margin: 4px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--color-group-divider);
}

.btn-quick-fill {
  display: block;
  width: 100%;
  margin-bottom: 16px;
}

.privacy-note a {
  color: var(--color-primary-dark);
}

/* 郵便番号の下の案内。検索中は小さな回転、見つかったら緑、見つからない・通信できないときはオレンジ */
.postal-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
}

.postal-status.is-ok {
  color: var(--color-ok);
  font-weight: 700;
}

.postal-status.is-warn {
  color: var(--color-notice);
  font-weight: 700;
}

/* お客様が別の住所を入れているとき: 書き換えずに、郵便番号の住所と「入れ替える」を出す */
.postal-status.is-conflict {
  color: var(--color-text);
}

.postal-status .btn-link {
  padding: 6px 0;
  font-weight: 700;
}

.loading-spinner.postal-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* ---- 受取時間チップ ---- */
.reminder-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reminder-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--control-height);
  padding: 12px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 1rem;
  cursor: pointer;
}

.reminder-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--color-primary);
}

.reminder-option:has(input:checked) {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 1px var(--color-primary);
  background: var(--color-primary-soft);
}

/* ---- 確認画面 ---- */
.confirm-title {
  font-size: 1.25rem;
  color: var(--color-text-strong);
  margin: 12px 0 4px;
}

.confirm-store {
  margin: 0 0 14px;
  color: var(--color-text-muted);
  font-weight: 700;
}

.confirm-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px var(--space-edge);
}

.confirm-item-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-strong);
}

.confirm-item-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.confirm-item-detail strong {
  color: var(--color-text-strong);
  white-space: nowrap;
}

.confirm-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px var(--space-edge);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

.confirm-total strong {
  font-size: 1.5rem;
  color: var(--color-text-strong);
}

.confirm-meta {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px var(--space-edge);
}

.confirm-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.confirm-meta > div:last-child {
  border-bottom: none;
}

.confirm-meta dt {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.confirm-meta dd {
  margin: 0;
  font-weight: 700;
  color: var(--color-text-strong);
  text-align: right;
  overflow-wrap: anywhere;
}

.error-text {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--color-ng-soft);
  border: 1px solid var(--color-ng);
  border-radius: var(--radius-sm);
  color: var(--color-ng);
  font-weight: 700;
  white-space: pre-line;
}

/* ---- 完了画面 ---- */
.done-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 32px var(--space-edge);
  margin-top: 16px;
}

.done-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-ok-soft);
  color: var(--color-ok);
  font-size: 2rem;
  line-height: 4rem;
}

.done-title {
  font-size: 1.3125rem;
  color: var(--color-text-strong);
  margin: 0 0 12px;
}

.done-text {
  white-space: pre-line;
  color: var(--color-text-muted);
}

.done-note {
  margin: 12px 0 24px;
  font-weight: 700;
}

.done-order-number {
  display: inline-block;
  margin: 0 0 12px;
  padding: 8px 20px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text-strong);
  border-radius: var(--radius-sm);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.done-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  max-width: 320px;
  margin: 0 auto;
}

.done-actions .btn-primary {
  max-width: none;
  flex: none;
}

.done-oa-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ---- トースト ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 7rem;
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100% - 32px);
  background: rgba(35, 39, 43, 0.94);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  white-space: pre-line;
}

/* ---- 店舗情報ページ (/order/info/) ---- */
.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px var(--space-edge);
  margin-top: 16px;
}

.info-status {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
}

.info-status[data-state="open"] {
  background: var(--color-ok-soft);
  color: var(--color-ok);
}

.info-status[data-state="paused"] {
  background: var(--color-ng-soft);
  color: var(--color-ng);
}

.info-status[data-state="preparing"] {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.info-rows {
  margin: 14px 0 0;
}

.info-rows dt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}

.info-rows dd {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

.info-order-link {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  text-decoration: none;
  margin: 24px 0 12px;
}

/* 店舗情報ページ: 営業時間・休業予定の複数行表示 */
.info-hours-line {
  line-height: 1.7;
}

/* ==========================================================================
   商品画像の横スワイプ (1商品につき最大10枚・1枚目がメイン)
   ========================================================================== */

.product-gallery {
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

/*
 * 横スワイプ。1枚ずつぴたりと止まる (scroll-snap)。
 * 画像が1枚だけの商品では、はみ出しが無いので普通の画像と同じ見た目になる。
 */
.gallery-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

/* 枠線は .product-gallery が引くので、中の画像では引かない (二重線を防ぐ) */
.product-gallery .product-image,
.product-gallery .product-image-placeholder {
  border-bottom: none;
}

/* 何枚あって何枚目を見ているかの目印 */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 6px;
  background: var(--color-surface);
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border-strong);
}

.gallery-dot.current {
  background: var(--color-primary);
}

/* ==========================================================================
   注文明細 (同じ商品を内容違いで複数)
   ========================================================================== */

/*
 * 明細1件を1枚のカードにする。
 * 商品カード (白) の中に置くので、ごく薄いグレーの下地と細い枠で
 * 「ここからここまでが注文1」が分かるようにする。色は付けない
 * (入力欄の白が沈まないように、下地は薄いままにしておく)。
 */
.order-entry {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  /* 削除のときに高さをたたむ (追加のときは下の keyframes を使う) */
  transition:
    opacity 220ms ease,
    height 220ms ease,
    margin 220ms ease,
    padding 220ms ease;
}

/* カードどうしは離す (くっつくと1件に見える) */
.order-entry + .order-entry {
  margin-top: 14px;
}

/*
 * 明細が1件だけで、見出しも出さない状態 (個数しかない商品の通常時)。
 * 区切るものが無いので囲む枠は付けない。2件以上に分けたときは
 * renumberEntries() がこの指定を外し、他と同じカードになる。
 */
.order-entry.is-plain {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* 「別に包装します」。追加ボタンのすぐ下に、その理由として置く */
.add-entry-note {
  margin: 6px 0 0;
  text-align: center;
}

/*
 * 追加された直後: 少し下から、薄い状態から現れる。
 * transition ではなく keyframes を使う。カードの通常の見た目は
 * 「不透明でその場にある」ままなので、アニメーションが再生されなくても
 * (裏のタブ・動きを控える設定など) 透明なカードが residue として残らない。
 */
@keyframes order-entry-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-entry.is-entering {
  animation: order-entry-enter 240ms ease-out;
}

/* 削除中: 薄くなりながら高さが縮む */
.order-entry.is-leaving {
  opacity: 0;
}

/*
 * 動きを控える設定の利用者にはアニメーションを出さない。
 * 追加・削除の機能そのものはアニメーションに依存していない。
 */
@media (prefers-reduced-motion: reduce) {
  .order-entry {
    transition: none;
  }

  .order-entry.is-entering {
    animation: none;
  }
}

/* このカードの見出し。入力項目のラベルより明らかに大きく、太く */
.entry-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 0 0 12px;
  line-height: 1.4;
}

.entry-field {
  margin-bottom: 14px;
}

.entry-field .hint-text {
  margin: 0 0 6px;
}

/* ---- 2者選択 ---- */
/*
 * 「付ける / 付けない」のような2択。
 * 小さな丸を並べるのではなく、指で押せる大きさのボタン2つを横に並べる。
 * 幅が足りないときは縦に折り返す (375px でも文字が潰れないように)。
 */
.binary-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.binary-option {
  flex: 1 1 8rem;
  min-height: 3.25rem;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  touch-action: manipulation;
}

.binary-option:active {
  background: var(--color-surface-muted);
}

/* 選ばれている側は、色と枠の太さの両方で示す (色だけだと見分けにくい人がいる) */
.binary-option.is-selected {
  border-width: 2px;
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.binary-option-label {
  word-break: break-word;
}

.binary-option-price {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---- 数値入力 ---- */
/* 個数と同じ形の ＋/− にする (数の意味は違うが、操作は同じほうが迷わない) */
.entry-number .number-stepper {
  justify-content: flex-start;
}

.number-stepper .number-input {
  width: 4.5rem;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  font-family: inherit;
}

/* 選んだ内容の追加料金 (リスト・2者選択・数値入力で共通) */
.entry-option-price {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

/* 個数は「個数」の見出しと ＋/− を1行に並べる (指で押しやすい大きさのまま) */
.entry-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-quantity .field-label {
  margin-bottom: 0;
}

/* 金額はカードの下地より一段明るくして、入力欄と区別する */
.entry-price {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.entry-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.entry-price-row + .entry-price-row {
  margin-top: 4px;
}

.entry-price-total {
  color: var(--color-text-strong);
  font-weight: 700;
}

.entry-price-total strong {
  font-size: 1.125rem;
}

/* ---- 参考画像 (入力方式: 画像) ---- */
/*
 * ファイルを選ぶ入力欄 (カメラ用・写真選択用の2つ) そのものは隠す。ブラウザごとに見た目がまちまちで、
 * 「選択されていません」という英語混じりの文言が出ることもあるため、
 * 押す場所は自前のボタンに寄せる (label ではなく button + input.click())。
 * display:none にすると一部のブラウザでフォーカスを当てられなくなるので、
 * 画面から見えない置き方にとどめる。
 */
.entry-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.entry-image-preview:empty {
  display: none;
}

/* まだ何も入っていないことを、ボタンだけでなく文字でも伝える */
.entry-image-empty {
  margin: 0;
  padding: 14px 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.entry-image-preview {
  margin: 0 0 10px;
}

/*
 * 選んだ画像。縦横比はそのままに、カードからはみ出さない大きさで出す。
 * 高さの上限を決めておかないと、縦長の写真で画面が埋まってしまう。
 */
.entry-image-thumb {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  object-fit: contain;
}

.entry-image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/*
 * [カメラで撮影] [写真から選択] [削除] の最大3つ。
 * 375px では2つ並べて3つ目を折り返す幅にする (文字が潰れない下限が 9rem)。
 */
.entry-image-actions button {
  flex: 1 1 9rem;
}

/* 「削除」。押し間違いを減らすため、選び直しとは色を分ける */
.btn-danger-outline {
  min-height: var(--control-height);
  padding: 13px 20px;
  border: 1px solid var(--color-ng);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ng);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.btn-danger-outline:active {
  background: var(--color-ng-soft);
}

.entry-image-actions button:disabled {
  color: var(--color-disabled-text);
  border-color: var(--color-border);
  cursor: default;
}

.entry-field .entry-image-status:empty {
  display: none;
}

.entry-field .entry-image-status {
  margin: 8px 0 0;
}

/* 読めない形式・大きすぎるなど、その場で直せる案内 */
.entry-field .entry-image-error {
  color: var(--color-ng);
  font-weight: 700;
}

.btn-remove-entry,
.btn-add-entry {
  width: 100%;
  margin-top: 12px;
}

.product-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-weight: 700;
  color: var(--color-text-strong);
}

.product-subtotal strong {
  font-size: 1.125rem;
}

/* ==========================================================================
   画面下部の「ご注文内容」
   ========================================================================== */

.order-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px var(--space-edge) 16px;
  margin-top: 20px;
}

.order-summary .section-label {
  margin-top: 0;
}

.summary-product + .summary-product {
  border-top: 1px solid var(--color-border);
  margin-top: 10px;
  padding-top: 10px;
}

.summary-product-name {
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 0 0 4px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* 長いメッセージでも 375px 幅で横にはみ出さない */
.summary-row-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-row-price {
  white-space: nowrap;
}

.summary-subtotal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-weight: 700;
  color: var(--color-text-strong);
}

.order-summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--color-border-strong);
  font-weight: 700;
  color: var(--color-text-strong);
}

.order-summary-total strong {
  font-size: 1.375rem;
}

/* 確認画面: 明細ごとの選択内容 (サイズ・メッセージなど) */
.confirm-item-options {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

/* 「本日分は◯◯以降のお時間から選べます」の案内 */
#time-hint {
  margin: 0 0 8px;
}

/* -------------------------------------------------------------------------- */
/* ご本人の確認 (外部ブラウザ) と、ご注文の連絡先                                  */
/* -------------------------------------------------------------------------- */

.auth-section {
  padding: 4px 0 16px;
}

.auth-lead {
  margin: 0 0 6px;
  color: var(--color-text-strong);
  font-size: 1rem;
}

.auth-buttons {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.btn-auth {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
}

/* LINE のログインボタンは LINE の緑 (LINE のブランドガイドラインの色) */
.btn-auth-line {
  background: #06c755;
  border-color: #06c755;
  color: #ffffff;
}

.btn-auth-line:active {
  background: #05b34c;
}

.btn-link {
  appearance: none;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--color-primary);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-small {
  min-height: 40px;
  padding: 0 16px;
  margin-top: 8px;
  width: auto;
}

.contact-line {
  margin: 0 0 8px;
  padding: 12px;
  border-radius: 10px;
  background: var(--color-ok-soft);
  color: var(--color-text-strong);
  font-size: 0.9375rem;
}

.contact-email-verified {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

/*
 * 「確認コードを送信する」。メールアドレスの欄のすぐ下に、欄と同じ幅で置く。
 * 送れる形のアドレスが入るまでは灰色 (押すと足りないものを伝える)、入ったら主要ボタンの青。送信中は回転を出して押せなくする。
 * 2026-10-23: 白い小さなボタンで目立たないとのご指摘。
 */
.btn-primary.btn-send-code {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 10px;
  border-color: var(--color-border-strong);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.btn-primary.btn-send-code:active:not(:disabled) {
  background: var(--color-surface-muted);
}

.btn-primary.btn-send-code.is-ready {
  border-color: transparent;
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary.btn-send-code.is-ready:active:not(:disabled) {
  background: var(--color-primary-dark);
}

.btn-primary.btn-send-code:disabled {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.send-code-hint {
  margin: 8px 0 0;
}

/* 送れたことの知らせ。ダイアログを閉じたあとも、どこへ送ったかと入力に戻る手段を残す */
.send-code-sent {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-ok-soft);
  color: var(--color-ok);
  font-size: 0.875rem;
  font-weight: 700;
}

.send-code-sent .btn-link {
  display: block;
  padding: 6px 0 0;
  font-weight: 700;
}

.done-detail-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* 注文の確認・変更・キャンセル (/order/history/)                                 */
/* -------------------------------------------------------------------------- */

.history-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.history-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8125rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.history-status.is-canceled {
  background: var(--color-ng-soft);
  color: var(--color-ng);
}

.history-status.is-done {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.history-status.is-modified {
  background: #fff4d6;
  color: #7a4d00;
}

.history-meta {
  margin: 12px 0;
}

.history-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.history-deadline {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.history-image {
  display: block;
  max-width: 160px;
  max-height: 160px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.qty-row .qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-row button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  font-size: 1.25rem;
}

/* ======================================================================
 * 商品一覧 → 商品詳細 → カート (2026-10-05)
 * 一覧は「画像・名前・説明・価格・在庫」だけの小さなカード。選ぶのは商品詳細で行う。
 * ====================================================================== */

/* ---- 商品一覧のカード (押すと詳細を開く) ---- */
.product-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.product-tile-main {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-height: 6.5rem;
  padding: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.product-tile-main:active {
  background: var(--color-surface-muted);
}

.product-tile.is-soldout .product-thumb {
  opacity: 0.55;
}

/* 一覧・カートの小さな画像。どの商品も同じ大きさ (正方形) で並べる */
.product-thumb {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.product-thumb .product-image,
.product-thumb .product-image-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-bottom: 0;
}

.product-thumb .product-image-placeholder svg {
  width: 1.75rem;
  height: 1.75rem;
}

.product-thumb .product-image-placeholder .placeholder-text {
  font-size: 0.6875rem;
}

.product-tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-tile-body .product-name {
  font-size: 1.0625rem;
  margin: 0;
}

/* 説明は一覧では2行まで (続きは詳細で読む) */
.product-tile-description {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-tile-price {
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--color-text-strong);
}

.product-tile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.product-tile-badges .soldout-badge {
  margin: 0;
  padding: 1px 10px;
  font-size: 0.8125rem;
}

/* 受け渡しの目安 (調理にかかる時間 / 注文が多いため約◯分待ち)。src/lib/kitchen.ts の文をそのまま出す */
.pickup-estimate {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.pickup-estimate.is-congested {
  color: var(--color-notice);
  font-weight: 700;
}

.stock-badge,
.in-cart-badge {
  display: inline-block;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 1px 10px;
}

.stock-badge {
  background: var(--color-ok-soft);
  color: var(--color-ok);
  border: 1px solid var(--color-ok);
}

.in-cart-badge {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary);
}

/* ---- 商品詳細 ---- */
#product-detail .product-card {
  margin-top: 8px;
}

.item-note-section {
  margin-top: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px var(--space-edge) 16px;
}

.item-note-section .textarea-input {
  margin-top: 6px;
}

/* ---- カート ---- */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-line {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.cart-line-head {
  display: flex;
  gap: 12px;
}

/*
 * 同じ商品が2行以上に分かれているとき (別包装) の案内と印。
 * 行がまとまらない理由に気づけるよう、オレンジ系の色で目立たせる。
 */
.separate-pack-notice {
  padding: 10px 12px;
  border: 2px solid var(--color-notice-border);
  border-radius: var(--radius-lg);
  background: var(--color-notice-soft);
  color: var(--color-notice);
}

.separate-pack-title {
  margin: 0 0 2px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.separate-pack-text,
.separate-pack-hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
}

.separate-pack-hint {
  margin-top: 4px;
}

.cart-line-pack,
.confirm-item-pack {
  margin: 4px 0 0;
}

.separate-pack-badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--color-notice-border);
  border-radius: 999px;
  background: var(--color-notice-soft);
  color: var(--color-notice);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.cart-line-head .product-thumb {
  width: 4.5rem;
  height: 4.5rem;
}

.cart-line-info {
  flex: 1;
  min-width: 0;
}

.cart-line-name {
  margin: 0;
  font-weight: 700;
  color: var(--color-text-strong);
  line-height: 1.5;
}

.cart-line-options,
.cart-line-note,
.cart-line-unit {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.cart-line-controls {
  display: flex;
  /* 文字を大きくして数量と小計が1行に入らないときは、小計を次の行 (右寄せ) へ送る (横にはみ出させない) */
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.cart-line-controls .stepper {
  gap: 10px;
}

.cart-line-controls .stepper-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: 1.25rem;
}

.cart-line-controls .stepper-qty {
  min-width: 2rem;
  font-size: 1.25rem;
}

.cart-line-subtotal {
  margin-left: auto;
  font-size: 1.125rem;
  color: var(--color-text-strong);
  white-space: nowrap;
}

.cart-line-actions {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 6px;
}

.btn-remove-line {
  color: var(--color-ng);
}

.cart-empty {
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: 20px var(--space-edge);
  text-align: center;
  color: var(--color-text-muted);
}

.cart-total {
  margin-top: 14px;
}

/* ---- 完了画面の注文内容 ---- */
.done-meta {
  margin: 12px 0 0;
  text-align: left;
}

.done-meta > div {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.done-meta dt {
  flex: 0 0 5.5em;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.done-meta dd {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.done-items {
  margin: 10px 0 0;
  text-align: left;
}

.done-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.9375rem;
}

.done-item span:last-child {
  white-space: nowrap;
}

.cart-line-actions .btn-link {
  min-height: 2.75rem;
  padding: 0 6px;
}

/* カートで削除した直後の「元に戻す」 */
.cart-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--color-surface-muted);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
}

.cart-undo .btn-link {
  min-height: 2.75rem;
  white-space: nowrap;
}

/* 一覧の下部バーの合計にも「税込」を添える (文字としては価格の後ろの飾り。数字の読み取りは変えない) */
#total-price-1::after {
  content: "（税込）";
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 2px;
}

/* ---- ダイアログ (確認コードの入力) ----
 * 下部固定バー (30) より上、トースト (40) より下に重ねる。
 * スマートフォンのキーボードに隠れにくいよう、画面の上寄りに出す。
 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, 8vh) var(--space-edge) 16px;
  background: rgba(20, 24, 28, 0.5);
  overflow-y: auto;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 420px;
  padding: 20px 18px 18px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.modal-title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

.modal-text p {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text);
  /* 最後の行に「い。」だけが残らないよう、行の終わりをそろえる (効かないブラウザではそのまま) */
  text-wrap: pretty;
}

.modal-sent-to {
  margin: 10px 0 16px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.modal-sent-to strong {
  color: var(--color-text-strong);
}

/* 6桁のコードは大きく、間をあけて中央に */
.code-input {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: none;
  width: 100%;
  max-width: none;
}

/* ダイアログを開いている間は、後ろの画面を動かさない */
body.modal-open {
  overflow: hidden;
}

/* ---- 運営と規約の案内 (商品一覧・完了画面の下) ----
   お店の指定なしで開いた人・お店が準備中のときにも、誰のサービスかと問い合わせ先が分かるようにする。
   主役は商品なので、小さく控えめに置く。 */
.order-footer {
  margin: 28px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
}

.order-footer p {
  margin: 0 0 6px;
}

.order-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
}

.order-footer a {
  color: var(--color-primary-dark);
  /* 指で押せる高さを取る (文字は小さくても押しやすく) */
  display: inline-block;
  padding: 6px 0;
}

/* 注文確定の直前の一文 (支払いと規約への同意) */
.confirm-agreement {
  margin: 18px 0 0;
}

.confirm-agreement a {
  color: var(--color-primary-dark);
}

.done-shop-contact {
  margin: 20px 0 0;
}

/* お店の指定なしで開いたときの使い方 */
.service-guide {
  text-align: left;
  margin: 18px 0 0;
  padding-left: 1.4em;
  color: var(--color-text);
}

.service-guide li + li {
  margin-top: 8px;
}

/* トップページの「最近ご利用のお店」(この端末で開いたことのあるお店) */
.recent-stores .section-label {
  margin-top: 14px;
}

.recent-store-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-store {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px var(--space-edge);
}

.recent-store-name {
  margin: 0 0 12px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-strong);
  overflow-wrap: anywhere;
}

.recent-store-actions {
  display: flex;
  gap: 10px;
}

.recent-store-actions .btn-primary,
.recent-store-actions .btn-secondary {
  flex: 1 1 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
  text-decoration: none;
  white-space: nowrap;
}

/* ミニアプリの入口から外部ブラウザで開いた人向けの、Google で続ける Web の注文ページへの案内 */
.auth-web-entry {
  margin: 16px 0 0;
}

.auth-web-entry a {
  color: var(--color-primary-dark);
  font-weight: 700;
}

/* 利用規約・プライバシーポリシーの本文 */
.legal-page ol,
.legal-page ul {
  padding-left: 1.4em;
}

.legal-page a {
  color: var(--color-primary-dark);
}

.legal-operator {
  margin-top: 28px;
}

/* ---- LINE アプリの中 (ミニアプリ) のセーフエリア ----
   LINEミニアプリのデザインガイドライン: 縦向きでは下に 34px の余白を取る。
   印 (in-line-app) は line-context.js が LINE の User-Agent を見て付ける。 */
html.in-line-app .bottom-bar {
  padding-bottom: max(34px, calc(12px + env(safe-area-inset-bottom)));
}

html.in-line-app .step {
  padding-bottom: calc(7.75rem + 22px);
}

html.in-line-app .toast {
  bottom: calc(7rem + 22px);
}

/* ---- 読み込み中 (LINEミニアプリのガイドラインの推奨: 30×30 のスピナーを中央に) ---- */
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  text-align: center;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: loading-spin 0.9s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 2.4s;
  }
}

/* 受取時間の案内: 目安と「本日分は◯以降」を改行して出す。注文が重なっているときは目立たせる */
#time-hint {
  white-space: pre-line;
}

#time-hint.is-congested {
  color: var(--color-notice);
  font-weight: 700;
}

/* 確定のときに受け渡し予定時刻が変わった: 新しい時刻と、もう一度押してほしいことを目立たせる */
#confirm-error {
  white-space: pre-line;
}

#confirm-time.is-changed {
  color: var(--color-notice);
  font-weight: 700;
}

/* =========================================================
   お店のセール (本日のお得なサービス・カートの割引。migration 0055)
   ========================================================= */
.sale-services {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--color-notice-soft);
  border: 1px solid var(--color-notice-border);
  border-radius: var(--radius-lg);
}

.sale-services-title {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--color-notice);
}

.sale-services-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sale-services-list li {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.9375rem;
  color: var(--color-text-strong);
}

.sale-services-list .sale-icon {
  flex: 0 0 auto;
}

.sale-services-list .sale-when {
  margin-left: 4px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.sale-badge {
  display: inline-block;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 1px 10px;
  background: var(--color-notice-soft);
  color: var(--color-notice);
  border: 1px solid var(--color-notice-border);
}

.sale-summary {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.sale-summary p {
  margin: 2px 0;
}

.sale-category-total {
  font-weight: 700;
}

.sale-discount-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-ng);
  font-weight: 700;
}

.sale-discount-line span:last-child {
  white-space: nowrap;
}

.sale-condition {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.sale-hint {
  font-size: 0.875rem;
  color: var(--color-notice);
}

.sale-subtotal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.done-discounts .done-item {
  color: var(--color-ng);
}

/* ---------------- お支払い方法 (オンライン決済。public/order/pay.js) ---------------- */
.pay-methods {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line, #d9d9d9);
  border-radius: 10px;
}
.pay-title {
  margin: 0 0 8px;
  font-size: 1rem;
}
.pay-option-list {
  display: grid;
  gap: 8px;
}
.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line, #d9d9d9);
  border-radius: 8px;
  cursor: pointer;
}
.pay-option input {
  width: 20px;
  height: 20px;
}
.pay-card-box {
  margin-top: 12px;
  min-height: 120px;
}

/* ---- 期間限定商品 (migration 0063): 受付の状態・受取期間・受取日ごとの状況 ---- */
.sale-info {
  margin: 0 0 10px;
}

.sale-status {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--color-ok-soft);
  color: var(--color-ok);
  border: 1px solid var(--color-ok);
}

.sale-status.sale-phase-before,
.sale-status.sale-phase-ended,
.sale-status.sale-phase-closed {
  background: var(--color-surface-muted);
  color: var(--color-text);
  border-color: var(--color-border);
}

.sale-info .product-remaining {
  margin-bottom: 4px;
}

.sale-date-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sale-date {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}

.sale-date:first-child {
  border-top: none;
}

.sale-date.is-selected {
  font-weight: 700;
  background: var(--color-primary-soft);
}

.sale-date-sold_out .sale-date-state,
.sale-date-not_pickup_day .sale-date-state,
.sale-date-store_closed .sale-date-state,
.sale-date-outside_order_period .sale-date-state {
  color: var(--color-text-muted);
}

.sale-date-sold_out .sale-date-state {
  color: var(--color-ng);
  font-weight: 700;
}

.sale-date-few .sale-date-state {
  color: var(--palette-amber-800);
  font-weight: 700;
}

.limited-sale-badge {
  white-space: normal;
}
