/* ============================================
   飲食店開業機器シミュレーター - スタイルシート
   ★ 色変更は :root 内の変数を書き換えてください
   ============================================ */

/* ---------- カラー変数 ---------- */
:root {
  --primary:       #e06b2d;    /* メインカラー（オレンジ） */
  --primary-dark:  #c0561f;    /* ホバー時 */
  --primary-light: #fff4ee;    /* 薄いオレンジ背景 */
  --header-from:   #1a1a2e;    /* ヘッダーグラデーション 開始 */
  --header-to:     #2c1654;    /* ヘッダーグラデーション 終了 */
  --bg:            #f4f6f9;    /* ページ背景（薄グレー） */
  --white:         #ffffff;
  --text:          #1a1a2e;    /* メインテキスト */
  --text-muted:    #6b7280;    /* サブテキスト */
  --border:        #e5e7eb;    /* 枠線 */
  --done:          #22c55e;    /* 完了済みの緑 */
  --radius:        14px;
  --shadow:        0 2px 16px rgba(0, 0, 0, 0.08);
  --shadow-hover:  0 8px 28px rgba(224, 107, 45, 0.22);
}

/* ---------- リセット ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ヘッダー ---------- */
header {
  background: linear-gradient(140deg, var(--header-from) 0%, var(--header-to) 100%);
  color: #fff;
  text-align: center;
  padding: 52px 24px 44px;
}

.header-label {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.9);
}

header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.header-sub {
  margin-top: 14px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
}

/* スマホのみ改行 */
.sp-only { display: none; }
@media (max-width: 480px) {
  .sp-only { display: inline; }
  header h1 { font-size: 1.65rem; }
}

/* ---------- 進捗バー ---------- */
.progress-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 16px;
}

.progress-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 360px;
  margin: 0 auto;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.progress-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.progress-step span {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 22px;
  max-width: 72px;
  transition: background 0.4s;
}

/* アクティブ */
.progress-step.active .progress-circle {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}
.progress-step.active span {
  color: var(--primary);
  font-weight: 700;
}

/* 完了済み */
.progress-step.done .progress-circle {
  background: var(--done);
  color: #fff;
}
.progress-step.done span { color: var(--done); }
.progress-line.done { background: var(--done); }

/* ---------- メインコンテンツ ---------- */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 20px 56px;
}

/* ---------- アニメーション ---------- */
.step {
  display: none;
}
.step.active {
  display: block;
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- ステップヘッダー ---------- */
.step-header {
  margin-bottom: 28px;
}

.step-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(224,107,45,0.25);
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.step-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.step-desc {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.highlight {
  color: var(--primary);
  font-weight: 700;
}

/* ---------- 選択カードグリッド ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* スマホは縦1列 */
@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* 選択カードボタン */
.select-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 120px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.18s, box-shadow 0.2s;
}

.select-card:hover,
.select-card:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  outline: none;
}

.select-card:active {
  transform: translateY(-1px);
}

/* スマホの選択カードは横並びに */
@media (max-width: 560px) {
  .select-card {
    flex-direction: row;
    justify-content: flex-start;
    padding: 22px 24px;
    min-height: 80px;
    text-align: left;
    gap: 18px;
  }
}

.card-icon {
  font-size: 2.6rem;
  line-height: 1;
}

@media (max-width: 560px) {
  .card-icon { font-size: 2rem; }
}

.card-text { display: flex; flex-direction: column; gap: 3px; }

.card-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* 予算カード */
.budget-card {
  min-height: 100px;
}

.budget-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

/* ---------- バッジ ---------- */
.summary-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(224,107,45,0.3);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- 機器テーブル ---------- */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;          /* 角丸をtableにも適用 */
  overflow-x: auto;          /* スマホ横スクロール対応 */
  margin-bottom: 24px;
}

.equipment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 600px;          /* テーブルが潰れないよう最小幅を設定 */
}

/* テーブルヘッダー */
.equipment-table thead tr {
  background: var(--text);
  color: #fff;
}

.equipment-table th {
  padding: 14px 18px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* 列幅 */
.equipment-table .col-num   { width: 44px; text-align: center; }
.equipment-table .col-name  { width: 30%; }
.equipment-table .col-price { width: 22%; text-align: right; white-space: nowrap; }
.equipment-table .col-use   { width: auto; }

/* テーブル本体 */
.equipment-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.equipment-table tbody tr:last-child {
  border-bottom: none;
}

.equipment-table tbody tr:hover {
  background: var(--primary-light);
}

/* 偶数行を薄グレーに */
.equipment-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.equipment-table tbody tr:nth-child(even):hover {
  background: var(--primary-light);
}

.equipment-table td {
  padding: 15px 18px;
  vertical-align: middle;
  color: var(--text);
  line-height: 1.5;
}

/* 番号セル */
.row-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

/* 機器名 */
.col-name-text {
  font-weight: 600;
}

/* 価格 */
.col-price {
  font-weight: 700;
  color: var(--primary-dark);
}

/* 用途 */
.col-use {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* 購入リンク列 */
.col-link {
  white-space: nowrap;
  text-align: center;
  width: 120px;
}

/* 楽天で探すボタン */
.btn-buy {
  display: inline-block;
  background: #bf0000;          /* 楽天レッド */
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.18s, transform 0.15s;
  white-space: nowrap;
}

.btn-buy:hover {
  background: #990000;
  transform: translateY(-1px);
}

.btn-buy:active {
  transform: translateY(0);
}

/* 準備中バッジ */
.link-pending {
  display: inline-block;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  letter-spacing: 0.04em;
}

/* ---------- 合計ボックス ---------- */
.total-box {
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
}

.total-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.total-price {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

.total-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- ボタンエリア ---------- */
.btn-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .btn-area {
    flex-direction: column;
  }
}

.btn-back {
  background: var(--white);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 13px 22px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
}

.btn-back:hover {
  background: #f1f5f9;
  color: var(--text);
}

.btn-reset {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 13px 28px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 0.18s, transform 0.15s;
}

.btn-reset:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .btn-back, .btn-reset {
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1rem;
  }
}

/* ---------- エラーメッセージ ---------- */
.error-msg {
  background: #fff8f0;
  border: 1.5px solid #f4a05a;
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 0.9rem;
  line-height: 1.85;
  color: #7c3a10;
  margin-top: 20px;
}

.error-msg code {
  background: #ffe8d0;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.85em;
  font-family: monospace;
}

/* ---------- フッター ---------- */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px 20px;
}

.footer-copy {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-note {
  font-size: 0.75rem;
  color: #b0bec5;
}
