html,
body {
  height: 100%;
  margin: 0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  padding-bottom: 6rem;
  background-color: #f5f5f5;
  padding-top: 70px;
  /* ヘッダーの高さ分（調整可） */
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #fff;
  padding: 0.5rem 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ヘッダーをフレックス横並びに */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

/* h1 の余白を調整（横並び用）*/

header h1 {
  margin: 0 0 0 10px;
  font-size: 1rem;
  text-align: left;
  flex: 1 1 auto;
}

h2 {
  text-align: center;
  margin: 1rem 0;
}

#backButton {
  position: static;
  top: auto;
  right: auto;
  margin: 0 15px 0 0;
  flex: 2;
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  background: linear-gradient(to bottom, #eb5151, #851717);
  color: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .15);
  cursor: pointer;
  transition: background .3s ease, transform .2s ease;
}

#backButton:hover {
  background: linear-gradient(to bottom, #e97b7b, #d74444);

  transform: translateY(-1px);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 1rem;
  padding-bottom: 7rem;
}

@media (min-width: 600px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    padding-bottom: 8rem;
  }
}

@media (min-width: 601px) {
  .category-grid {
    padding-bottom: 7rem;
  }
}

@media (min-width: 900px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-button {
  padding: 1.5rem 1rem;
  text-align: center;
  font-weight: bold;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
}

.category-button:hover {
  filter: brightness(1.16) opacity(0.85);
}

.hidden {
  display: none !important;
}

.subcategory {
  padding-left: 1rem;
  margin-top: 0.5rem;
}

.subcategory h3 {
  margin-bottom: 0.5rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  border-radius: 10px;
}

.modal-close.global-top-right {
  position: absolute;
  top: 15px;
  right: 20px;
  z-index: 2000;
  width: 36px;
  height: 36px;
  padding: 0;
  /* ← 余計な余白を完全カット */
  background: #ed5252;
  color: white;
  border: none;
  border-radius: 50%;
  /* ← 厳密な正円 */
  font-size: 1.5rem;
  /* ← 直径の1/2〜2/3程度でOK */
  font-weight: bold;
  line-height: 36px;
  /* ← 高さに合わせる、中央揃え */
  text-align: center;
  box-sizing: border-box;
  /* ← 念のため明示 */
  cursor: pointer;
  transition: background 0.2s;
  appearance: none;
  /* ← Safari用 */
  -webkit-appearance: none;
  /* ← iOS用 */
  user-select: none;
}

.modal-close.global-top-right:active,
.modal-close.global-top-right:hover {
  background: #f19e9e;
}

.order-summary-content {
  max-height: 80vh;
  overflow-y: auto;
}

.order-price-line .qty-btn:first-of-type {
  margin-left: 0.5em;
  /* 0.3em～0.6emでOK */
}

.quantity-control {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  /* ← ボタンと数字の間を十分に */
}

.quantity-control button {
  width: 48px;
  /* 少し大きめに */
  height: 48px;
  font-size: 1.6rem;
  border: none;
  border-radius: 10px;
  background-color: #ccc;
  cursor: pointer;
  display: flex;
  /* ← 中央寄せの決め手 */
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.quantity-control button:active,
.quantity-control button:hover {
  background-color: #bbb;
}

/* 数字部分を大きく・太く・余白広く */
#quantity {
  display: inline-block;
  min-width: 0.5rem;
  /* 余白たっぷり（2.5〜3rem推奨） */
  font-size: 2rem;
  /* 数字を大きく */
  font-weight: bold;
  /* 太字 */
  text-align: center;
  margin: 0 1rem;
  /* 両脇にさらに余白 */
  vertical-align: middle;
  line-height: 48px;
  /* ボタンと同じ高さでど真ん中 */
  user-select: none;
}

.modal-buttons button,
.summary-buttons button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 16px;
}

#orderFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 1rem;
  border-top: 1px solid #ccc;
  text-align: center;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

#orderItemsContainer>div {
  margin: 0.5rem 0;
  font-size: 14px;
  text-align: left;
}

.order-date {
  background-color: #f0f0f0;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 1em;
  font-weight: bold;
}

.item {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.item-image {
  display: block;
  margin: 0 auto 0.5rem auto;
  border-radius: 8px;
  object-fit: cover;
  width: 120px;
  max-width: 100%;
  max-height: 110px;
  background: #eee;
}

.order-footer-buttons {
  display: flex;
}

/* 履歴ボタン */
.view-history-btn {
  flex: 0 0 110px;
  padding: 0.7rem 0.2rem;
  font-size: 1rem;
  font-weight: bold;
  background: linear-gradient(to bottom, #098f53, #04492c);
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.view-history-btn:hover {
  background: linear-gradient(to bottom, #108752, #0a6c43);
  transform: translateY(-1px);
}

/* スタッフ紹介ボタン */
.staff-intro-btn {
  flex: 0 0 100px;
  padding: 0.85rem 0.2rem;
  font-size: 0.8rem;
  font-weight: bold;
  background: linear-gradient(to bottom, #5c8eff, #286ad7);
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-intro-btn:hover {
  background: linear-gradient(to bottom, #85a7ef, #4475b8);
  transform: translateY(-1px);
}

/* 🔥 注文ボタン（オレンジ系） */
.view-order-btn {
  flex: 8;
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: bold;
  background: linear-gradient(to bottom, #ff7043, #e64a19);
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.view-order-btn:hover {
  background: linear-gradient(to bottom, #ff8a65, #d84315);
  transform: scale(1.02);
}

/* ⛔ 押せない状態 */
.view-order-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
}

/* 注文後の閉じる（OK）ボタン */
#msgOkBtn {
  width: 80%;
  max-width: 100px;
  margin: 1.5rem auto 0 auto;
  display: block;
  padding: 1.5rem 0;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(180deg, #bdbdbd 0%, #757575 80%, #e0e0e0 100%);
  border: none;
  border-radius: 1.5rem;
  box-shadow:
    0 3px 12px rgba(70, 70, 70, 0.2),
    0 1.5px 0 #fff inset,
    0 -1.5px 0 #555 inset;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  letter-spacing: 0.08em;
  cursor: pointer;
  outline: none;
}

#msgOkBtn:hover,
#msgOkBtn:active {
  background: linear-gradient(180deg, #cfcfcf 0%, #616161 90%, #fafafa 100%);
  box-shadow:
    0 4px 16px rgba(50, 50, 50, 0.25),
    0 2px 0 #fff inset,
    0 -2px 0 #222 inset;
  transform: scale(1.04);
}

/* 商品行スタイル */
.order-summary-item {
  margin-bottom: 1.5rem;
}

.order-name-line {
  font-weight: bold;
  font-size: 1.1rem;
}

.order-price-line {
  margin-left: 1.5rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 2rem;
  height: 2rem;
  font-size: 1.3rem;
  /* ちょい大きめでバランス良し */
  border: none;
  border-radius: 5px;
  background-color: #ccc;
  cursor: pointer;
  display: flex;
  /* ← これがポイント！ */
  align-items: center;
  /* ← 垂直中央 */
  justify-content: center;
  /* ← 水平中央 */
  padding: 0;
  /* ← 必ずゼロ */
  box-sizing: border-box;
  /* 念のため */
  line-height: 1;
  /* ← 追加推奨 */
  appearance: none;
  /* ← iOS対策 */
  -webkit-appearance: none;
  /* ← iOS対策 */
}

.qty-btn:hover {
  background-color: #bbb;
}

.qty-count {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
}

/* ボタン領域全体 */
.summary-buttons {
  text-align: center;
  margin-top: 2rem;
}

/* メイン注文ボタン（ワインレッド・メタリック） */
#submitOrder {
  display: block;
  margin: 0 auto 1rem auto;
  padding: 1.2rem 2.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  color: white;
  background: linear-gradient(to bottom, #8B0000, #5A0000);
  /* ワインレッド系 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  margin-bottom: 30px;
}

#submitOrder:hover {
  background: linear-gradient(to bottom, #A00000, #6B0000);
  transform: translateY(-1px);
}

/* 「他の商品を追加する」ボタン（ダークグリーン・メタリック） */
#continueOrder {
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  color: white;
  background: linear-gradient(to bottom, #006400, #003300);
  /* ダークグリーン */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#continueOrder:hover {
  background: linear-gradient(to bottom, #007a00, #004400);
  transform: translateY(-1px);
}

/* 補助ボタン（小さくして横並び） */
.summary-sub-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.summary-sub-buttons button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: normal;
  border: none;
  border-radius: 8px;
  background-color: #eee;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-sub-buttons button:hover {
  background-color: #ddd;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  /* ← ボタンを左右に分離 */
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-buttons button {
  flex: 1;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  min-width: 100px;
  max-width: 50%;
}

/* 🟩 追加ボタン（右） */
#confirmOrder {
  order: 2;
  /* ← 明示的に右側へ */
  color: white;
  background: linear-gradient(to bottom, #006400, #003300);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

#confirmOrder:hover {
  background: linear-gradient(to bottom, #007a00, #004400);
  transform: translateY(-1px);
}

/* ⚪ キャンセルボタン（左） */
#cancelOrder {
  order: 1;
  color: #333;
  background: linear-gradient(to bottom, #eeeeee, #cccccc);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

#cancelOrder:hover {
  background: linear-gradient(to bottom, #f0f0f0, #bbbbbb);
  transform: translateY(-1px);
}

/* イベントボタン（右） */
.event-btn {
  position: static;
  top: auto;
  right: auto;
  margin: 0 0 0 12px;
  flex: unset;
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  background: linear-gradient(to bottom, #ffe05a, #ffc300);
  color: #5e0606;
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .15);
  cursor: pointer;
  transition: background .3s ease, transform .2s ease;
}

.event-btn:hover {
  background: linear-gradient(to bottom, #fff59b, #ffd200);
  transform: translateY(-1px);
}

.event-btn:active {
  filter: brightness(0.96);
  transform: scale(0.97);
}

@media (max-width: 600px) {
  .event-btn {
    font-size: 0.97em;
    padding: 1rem;
    margin-left: 8px;
    box-sizing: border-box;
  }
}

/* イベントモーダル */
.event-choice-btn {
  width: 100%;
  margin: 0.5em 0;
  padding: 0.7em 1.1em;
  font-size: 1.03em;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: #ffe05a;
  color: #222;
  box-shadow: 0 2px 6px #0001;
  cursor: pointer;
  transition: background 0.22s, transform 0.16s;
}

.event-choice-btn:hover {
  background: #fff0a2;
}

.close-modal-btn {
  width: 100%;
  padding: 0.6em 1em;
  background: #eee;
  border: none;
  border-radius: 8px;
  color: #666;
  font-weight: normal;
  cursor: pointer;
  font-size: 1em;
  margin-top: 1em;
}

.close-modal-btn:hover {
  background: #ddd;
}

.event-choice-btn.selected {
  background: #3399ff;
  color: #fff;
  font-weight: bold;
  border: 2px solid #2266bb;
}

/* 商品名と価格の表示デフォルト：PC/タブレットでは横並び */
.item-name {
  font-weight: bold;
}

.item-price {
  margin-left: .5em;
  color: #333;
}

/* パスコード専用モーダル（背景クリック不可・ESC不可・タブ移動不可） */
.passcode-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passcode-modal {
  background: #fff;
  border-radius: 1em;
  padding: 2em;
  box-shadow: 0 4px 24px #0004;
  min-width: 260px;
  text-align: center;
}

/* スマホのみ：縦並び（改行） */
@media (max-width: 600px) {

  .item-name,
  .item-price {
    display: block;
    margin-left: 0;

  }

  .item-price {
    margin-top: .2em;
    color: #444;
  }
}

.category-breadcrumb {
  font-weight: bold;
  margin: 1.5em 0 20px 20px;
  font-size: 1.1em;
  color: #222;
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  /* グリッド最上段で全幅を使う */
}

.category-breadcrumb .parent {
  color: #555;
}

.category-breadcrumb .sep {
  margin: 0 0.5em;
  color: #aaa;
}

.category-breadcrumb .child {
  color: #555;
}

/* #categoryContentはグリッドではなくblockで！ */
#categoryContent {
  display: block !important;
  width: 100%;
  max-width: none;
  padding: 0;
}

/* 商品カードのグリッドレイアウト */
.item-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2em;
  padding: 0 1rem;
}

/* パスコードモーダルオーバーレイ */
#passcodeOverlay {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  /* 垂直中央 */
  justify-content: center;
  /* 水平中央 */
  background: rgba(64, 64, 64, 0.65);
  /* 透過グレー */
}

/* モーダル本体をやや上に寄せる */
#passcodeModalContent {
  transform: translateY(-20%);
}

/* モーダル本体 */
#passcodeModalContent,
.passcode-modal {
  background: #fff;
  border-radius: 1.3em;
  padding: 2em 1em;
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.24), 0 2px 8px #c7c7c7;
  min-width: 260px;
  max-width: 95vw;
  text-align: center;
  animation: modal-pop 0.3s cubic-bezier(.3, 1.6, .7, 1) 1;
}

@keyframes modal-pop {
  0% {
    transform: scale(0.95) translateY(30px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

#passcodeModalContent h2,
.passcode-modal h2 {
  margin-bottom: 1.3em;
  font-size: 1.3em;
  font-weight: bold;
  color: #374151;
  letter-spacing: 0.04em;
}

/* 入力欄 */
#passcodeInput,
.passcode-input {
  font-size: 2em;
  letter-spacing: 0.4em;
  width: 5.4em;
  padding: 0.6em 0.5em 0.6em 0.7em;
  text-align: center;
  border: 2px solid #bbb;
  border-radius: 0.8em;
  background: #f9fafb;
  box-shadow: 0 1.5px 0 #fff inset;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

#passcodeInput:focus,
.passcode-input:focus {
  border-color: #fd6e5c;
  background: #fff;
  box-shadow: 0 0 0 2px #ffc3b3;
}

/* エラーメッセージ */
#passcodeError,
.passcode-error {
  color: #e53935;
  font-size: 1em;
  margin-top: 0.7em;
  min-height: 1.7em;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: .02em;
}

/* キャンセル済み表示 */
.order-canceled {
  color: #b00;
  font-weight: bold;
  font-size: 0.8em;
  margin-left: 0.8em;
  margin-top: 0.1em;
}

/* キャンセルボタン */
.order-cancel-btn {
  margin-left: 1.2em;
  font-size: 0.7em;
  padding: 0.3em 0.8em;
  border-radius: 4px;
  background: #ffd7d7;
  color: #b00;
  border: 1px solid #b00;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.order-cancel-btn:hover,
.order-cancel-btn:focus {
  background: #fff4f4;
  color: #900;
  outline: none;
}

/* 認証ボタン */
#passcodeSubmitBtn,
.passcode-submit-btn {
  width: 8em;
  height: 2.8em;
  font-size: 1.1em;
  margin-bottom: 0.7em;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(90deg, #ff7043 30%, #e64a19 90%);
  border: none;
  border-radius: 2em;
  box-shadow: 0 2px 12px rgba(255, 112, 67, 0.15);
  cursor: pointer;
  transition: background .19s, transform .13s, box-shadow .2s;
  outline: none;
  letter-spacing: 0.06em;
}

#passcodeSubmitBtn:active,
.passcode-submit-btn:active {
  background: linear-gradient(90deg, #fd6133 40%, #bb3e13 90%);
  transform: scale(0.97);
}

#passcodeSubmitBtn:disabled,
.passcode-submit-btn:disabled {
  background: #bbb;
  color: #eee;
  cursor: not-allowed;
  opacity: 0.7;
}

@media (min-width: 600px) {
  .item-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* タブレット以上で拡大 */
@media (min-width: 600px) {
  .item-image {
    width: 140px;
    height: 140px;
    max-width: 100%;
    max-height: 180px;
  }
}

/* PCならさらに大きく */
@media (min-width: 900px) {
  .item-image {
    width: 180px;
    height: 180px;
    max-width: 100%;
    max-height: 240px;
  }
}

/* ボタンが有効なときだけエレガントな瞬き */
@keyframes glow-pulse {

  0%,
  100% {
    box-shadow: 0 0 0px 0 #eb898b8f, 0 4px 8px rgba(207, 11, 14, 0.842);
    filter: brightness(1);
  }

  50% {
    box-shadow: 0 0 12px 4px #d4466c, 0 5px 12px rgba(129, 5, 32, 0.194);
    filter: brightness(1.25);
  }
}

.view-order-btn:not(.disabled) {
  animation: glow-pulse 1.8s cubic-bezier(.61, 0, .24, 1) infinite;
}

@media (max-width: 600px) {
  #categoryContent {
    padding-bottom: 100px;
  }
}

@media (min-width: 601px) {
  #categoryContent {
    padding-bottom: 90px;
  }
}

/* イベント演出の全画面オーバーレイ＆中央寄せ用コンテナ */
#overlay,
#summerEventContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* メインの中央エリア（子要素のabsolute対策） */
#summerEventInner {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* カード画像（中央） */
#eventCard {
  display: block;
  max-width: 400px;
  max-height: 400px;
  width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  z-index: 2010;
  position: relative;
  margin: 0 auto;
  max-width: min(90vw, 500px);
}

/* 光エフェクト（カードの上に重ねる場合） */
#lightRing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, gold 0%, white 40%, orange 80%, transparent 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  z-index: 2020;
  pointer-events: none;
  box-shadow:
    0 0 30px 10px gold,
    0 0 60px 20px orange,
    0 0 80px 40px rgba(255, 215, 0, 0.6);
  animation: lightExpand 1s ease-out forwards;
}

/* ボタン類（✕、保存） */
#closeBtn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.4rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.85);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  text-align: center;
  line-height: 36px;
  cursor: pointer;
  z-index: 2050;
}

#downloadBtn {
  position: absolute;
  bottom: 15px;
  right: 15px;
  padding: 10px 16px;
  font-size: 1rem;
  background: #ffd700;
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2050;
  box-shadow: 0 0 5px rgba(255, 255, 0, 0.6);
}

/* 演出アニメーション（回転＋拡大） */
@keyframes spin {
  from {
    transform: scale(0) rotate(0deg);
  }

  to {
    transform: scale(1) rotate(1080deg);
  }
}

@keyframes lightExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(15);
    opacity: 0;
  }
}

.fade-out {
  opacity: 0 !important;
}

/* showCardBtnスタイル */
#showCardBtn {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  font-size: 1.2rem;
  font-weight: bold;
  background: #f00;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2050;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: background 0.3s ease, transform 0.2s ease;
}

#showCardBtn:hover {
  background: #cc0000;
  transform: translateX(-50%) scale(1.05);
}

#showCardBtn:active {
  transform: translateX(-50%) scale(0.95);
}

/* ローディングモーダル */
#loadingModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 30, 30, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.loading-contents {
  text-align: center;
}

.loading-text {
  margin-top: 18px;
  color: #fff;
  font-size: 1.3em;
  letter-spacing: 0.12em;
  animation: blink 1.5s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* =========================
   1) 共通レイアウト
   ========================= */

/* ボタン行 */
.summary-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}

/* 注文確認モーダル */
#orderSummaryModal .summary-buttons {
  display: block;
  /* ← blockに固定 */
  text-align: center;
  margin-top: 2rem;
}

/* 注文履歴モーダル */
#orderHistoryModal .summary-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================
   2) 吹き出し（履歴モーダルのみ）
   ========================= */
#orderHistoryModal .btn-with-bubble {
  position: relative;
  display: inline-block;
}

#orderHistoryModal .price-bubble {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  background: #fff;
  border: 2px solid #7f3f98;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  white-space: nowrap;
  z-index: 2001;
  transition: opacity .18s ease, transform .18s cubic-bezier(.22, 1, .36, 1);
}

#orderHistoryModal .price-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 2px solid #7f3f98;
  border-bottom: 2px solid #7f3f98;
  transform: translate(-50%, -8px) rotate(45deg);
}

#orderHistoryModal .price-bubble.show {
  display: inline-block;
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: history-bubble-pop .24s ease-out;
}

@keyframes history-bubble-pop {
  0% {
    transform: translateX(-50%) scale(.85);
    opacity: 0;
  }

  60% {
    transform: translateX(-50%) scale(1.06);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

@media (max-width: 480px) {
  #orderHistoryModal .price-bubble {
    max-width: 80vw;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .price-bubble {
    min-width: 180px;
    font-size: 1rem;
  }
}

/* =========================
   3) 各ボタンの見た目
   ========================= */
#showHistoryTotalBtn {
  background: linear-gradient(135deg, #7f3f98, #5b7ee5);
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, transform 0.2s ease;
}

#showHistoryTotalBtn:hover {
  transform: translateY(-1px);
}

#showHistoryTotalBtn:active {
  transform: translateY(0);
}

#closeHistoryBtn {
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#closeHistoryBtn:hover {
  background: #e8e8e8;
  transform: translateY(-1px);
}

#closeHistoryBtn:active {
  transform: translateY(0);
}

/* =========================
   4) モーダルとスクロール制御
   ========================= */

/* オーバーレイ（全モーダル共通） */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, .45);
  z-index: 10000;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal .modal-content {
  max-height: 85vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* モーダル開時、背面を止める（JSで .modal-open を付与） */
html.modal-open,
body.modal-open {
  overflow: hidden;
  height: 100%;
}

/* 背面の独自スクロール領域（#menuContainer）も止める */
#menuContainer.modal-locked {
  overflow: hidden !important;
}

/* =========================
   5) グローバルの ✕ ボタン
   ========================= */
#globalCloseButton {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10001;
  pointer-events: auto;
}