/* ===================================================
   弁当予約システム フロントエンドスタイル
   =================================================== */

.bento-order-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}

/* ── ステップ表示 ─────────────────────────────────── */
.bento-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.bento-step {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #999;
}
.bento-step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 6px;
}
.bento-step.active {
  color: #e65c00;
  font-weight: bold;
}
.bento-step.active .step-num {
  background: #e65c00;
}
.bento-step.done .step-num {
  background: #4caf50;
}
.bento-step-divider {
  width: 40px;
  height: 2px;
  background: #ddd;
  margin: 0 4px;
  align-self: center;
  flex-shrink: 0;
}

/* ── ステップ：スマホ対応 ─────────────────────────── */
@media (max-width: 480px) {
  .bento-steps {
    gap: 0;
    margin-bottom: 20px;
  }
  .bento-step {
    font-size: 10px;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }
  .bento-step .step-num {
    width: 26px;
    height: 26px;
    font-size: 13px;
    margin-right: 0;
    flex-shrink: 0;
  }
  .bento-step-divider {
    width: 16px;
    margin: 0 2px;
    align-self: flex-start;
    margin-top: 13px;
  }
}

/* ── セクション共通 ───────────────────────────────── */
.bento-section {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}
.bento-section h2 {
  font-size: 18px;
  font-weight: bold;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e65c00;
  color: #333;
}

/* ── メニューカード ───────────────────────────────── */
.bento-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.bento-menu-card {
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.bento-menu-card:hover {
  border-color: #e65c00;
  box-shadow: 0 2px 8px rgba(230,92,0,.15);
}
.bento-menu-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}
.bento-menu-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.bento-menu-card-name {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 4px;
  color: #333;
}
/* ── OTP メール認証 ─────────────────────────────── */
.bento-otp-guide {
  font-size: 13px;
  color: #555;
  background: #fff8e1;
  border-left: 3px solid #f0a500;
  padding: 8px 12px;
  margin: 6px 0 10px;
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}
.bento-otp-btn {
  display: inline-block;
  padding: 10px 16px;
  background: #5d4037;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.bento-otp-btn:hover  { background: #4e342e; }
.bento-otp-btn:disabled { background: #bdbdbd; cursor: not-allowed; }
.bento-otp-resend-btn {
  padding: 8px 14px;
  background: none;
  color: #5d4037;
  border: 1px solid #5d4037;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.bento-otp-status { margin-top: 6px; font-size: 13px; min-height: 22px; }
.bento-otp-error    { color: #d32f2f; }
.bento-otp-success  { color: #1565c0; }
.bento-otp-verified { color: #2e7d32; font-weight: 600; }

.bento-free-tea-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid #a5d6a7;
  vertical-align: middle;
  white-space: nowrap;
}
.bento-menu-card-desc {
  font-size: 12px;
  color: #777;
  margin-bottom: 8px;
  min-height: 36px;
  flex: 1; /* 説明欄を伸ばして価格・数量の位置を揃える */
}
.bento-menu-card-price {
  font-size: 16px;
  font-weight: bold;
  color: #e65c00;
  margin-bottom: 10px;
  margin-top: auto; /* 説明文が短くても常に同じ高さに来る */
}
.bento-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* スピンボタン非表示（bag qty input） */
input#bento-bag-qty-input::-webkit-inner-spin-button,
input#bento-bag-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bento-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e65c00;
  background: #fff;
  color: #e65c00;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.bento-qty-btn:hover {
  background: #e65c00;
  color: #fff;
}
.bento-qty-num {
  font-size: 18px;
  font-weight: bold;
  min-width: 24px;
  text-align: center;
  color: #333;
}
/* input[type=number] としてのスタイル */
input.bento-qty-num {
  width: 54px;
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  padding: 0 4px;
  -moz-appearance: textfield;  /* Firefox: スピナー非表示 */
}
input.bento-qty-num:focus {
  outline: none;
  border-color: #e65c00;
  background: #fff;
}
input.bento-qty-num::-webkit-inner-spin-button,
input.bento-qty-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── 日付ピッカー ─────────────────────────────────── */
.bento-calendar {
  user-select: none;
}
.bento-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bento-cal-nav button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 18px;
  color: #555;
}
.bento-cal-nav button:hover { background: #f0f0f0; }
.bento-cal-title {
  font-weight: bold;
  font-size: 16px;
}
.bento-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.bento-cal-dow {
  font-size: 12px;
  color: #888;
  padding: 4px 0;
  font-weight: bold;
}
.bento-cal-dow.sun { color: #e53935; }
.bento-cal-dow.sat { color: #1565c0; }
.bento-cal-day {
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 14px;
  cursor: default;
  color: #bbb;
  background: #f9f9f9;
}
.bento-cal-day.available {
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: background 0.15s;
}
.bento-cal-day.available:hover {
  background: #fff3e0;
  border-color: #e65c00;
}
.bento-cal-day.selected {
  background: #e65c00 !important;
  color: #fff !important;
  border-color: #e65c00 !important;
  font-weight: bold;
}
.bento-cal-day.empty { background: none; border: none; }
.bento-selected-date {
  margin-top: 12px;
  font-weight: bold;
  color: #e65c00;
  font-size: 15px;
}

/* ── フォーム ─────────────────────────────────────── */
.bento-form-row {
  margin-bottom: 16px;
}
.bento-form-row label {
  display: block;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  color: #444;
}
.bento-form-row label .required {
  color: #e53935;
  margin-left: 4px;
  font-size: 11px;
}
.bento-form-row input[type="text"],
.bento-form-row input[type="email"],
.bento-form-row input[type="tel"],
.bento-form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  font-family: inherit;
}
.bento-form-row input:focus,
.bento-form-row textarea:focus {
  outline: none;
  border-color: #e65c00;
  box-shadow: 0 0 0 3px rgba(230,92,0,.1);
}
.bento-form-row textarea { height: 80px; resize: vertical; }

/* ── カートサマリー ───────────────────────────────── */
.bento-cart-summary {
  background: #fff8f3;
  border: 1px solid #f5c9a0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.bento-cart-summary h3 {
  font-size: 15px;
  margin: 0 0 10px;
  color: #555;
}
.bento-cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bento-cart-items li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f0d9c8;
  font-size: 14px;
}
.bento-cart-items li:last-child { border-bottom: none; }
.bento-cart-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #e65c00;
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
  color: #e65c00;
}
.bento-cart-tax {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.bento-cart-empty {
  color: #999;
  text-align: center;
  padding: 20px 0;
}

/* ── 税込ラベル ───────────────────────────────────── */
.bento-tax-label {
  font-size: 11px;
  font-weight: normal;
  color: #888;
  margin-left: 4px;
}

/* ── 支払い方法選択 ───────────────────────────────── */
.bento-payment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bento-payment-option {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bento-payment-option input[type="radio"] {
  display: none;
}
.bento-payment-option-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.bento-payment-option input:checked + .bento-payment-option-body {
  border-color: #e65c00;
  background: #fff8f3;
}
.bento-payment-option.selected .bento-payment-option-body {
  border-color: #e65c00;
  background: #fff8f3;
}
.bento-payment-option-body:hover {
  border-color: #e65c00;
}
.bento-payment-option-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.bento-payment-option-title {
  font-weight: bold;
  font-size: 15px;
  color: #333;
  margin-bottom: 3px;
}
.bento-payment-option-desc {
  font-size: 12px;
  color: #777;
  line-height: 1.5;
}

/* ── 送信ボタン ───────────────────────────────────── */
.bento-submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: #e65c00;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.bento-submit-btn:hover:not(:disabled) { background: #cc5200; }
.bento-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ── フィールドエラーハイライト ────────────────────── */
input.bento-input-error,
select.bento-input-error,
textarea.bento-input-error {
  border-color: #e53935 !important;
  background: #fff8f8 !important;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.18) !important;
  outline: none;
}
.bento-section.bento-section-error {
  border-color: #e53935 !important;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.12) !important;
}
.bento-field-error {
  animation: bento-shake 0.3s ease;
}
@keyframes bento-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

/* ── エラー・成功メッセージ ───────────────────────── */
.bento-error {
  background: #ffeaea;
  border: 1px solid #f44336;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.bento-success {
  background: #e8f5e9;
  border: 1px solid #4caf50;
  color: #2e7d32;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* ── 完了ページ ───────────────────────────────────── */
.bento-complete-wrap {
  max-width: 600px;
  margin: 40px auto;
  text-align: center;
  padding: 0 16px;
}
.bento-complete-icon {
  font-size: 64px;
  margin-bottom: 16px;
}
.bento-complete-wrap h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 8px;
}
.bento-order-detail-box {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: left;
  margin-top: 24px;
}
.bento-order-detail-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bento-order-detail-box th, .bento-order-detail-box td {
  padding: 8px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.bento-order-detail-box th { color: #777; width: 130px; }

/* ── ローディング ─────────────────────────────────── */
.bento-loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.bento-loading-inner {
  background: #fff;
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  font-size: 16px;
  color: #555;
}
.bento-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #e65c00;
  border-radius: 50%;
  animation: bento-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes bento-spin { to { transform: rotate(360deg); } }

/* レスポンシブ */
@media (max-width: 480px) {
  .bento-menu-grid { grid-template-columns: 1fr; }   /* スマホは1カラム */
  .bento-section { padding: 16px; }
}
