/* style.css */

/* 全体リセット: パディングとボーダーを要素の幅に含める */
* {
  box-sizing: border-box;
}

/* HTMLとbodyの基本設定 */
html,
body {
  width: 100%; /* 幅を常に100%に設定 */
  overflow-x: hidden; /* 横スクロールを隠す（コンテンツのはみ出しがない場合のみ推奨） */
  font-family: sans-serif;
  background: #f4f4f4;
  padding: 16px; /* 全体のパディング */
  margin: 0;
  font-size: 16px;
  line-height: 1.6; /* 行の高さを設定し、読みやすくする */
}

/* コンテナの共通設定 */
.container,
.form-container {
  width: 100%; /* 親要素の幅いっぱいに広がる */
  max-width: 600px; /* PCなど大きい画面での最大幅を制限し、読みやすさを確保 */
  margin: 0 auto; /* 中央寄せ */
  padding: 20px; /* コンテナのパディング */
  background: #fff; /* 背景色 */
  border-radius: 8px; /* 角丸 */
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1); /* 影 */
}

/* ヘッダーの調整 */
header {
  text-align: center; /* ヘッダー内のコンテンツを中央揃え */
  padding: 10px; /* ヘッダーのパディング */
  max-width: 100%; /* 親要素の幅を超えない */
  box-sizing: border-box;
  margin-bottom: 20px; /* ヘッダーの下に余白を追加 */
}

header img {
  width: 100%; /* 画像をレスポンシブにする */
  max-width: 600px; /* 元々の画像の最大幅を維持 */
  height: auto; /* アスペクト比を維持 */
  display: block; /* ブロック要素にして中央寄せ可能に */
  margin: 0 auto 10px; /* 画像を中央寄せし、下部に余白 */
}

/* ヘッダー内の電話番号とお店の紹介ボタンのコンテナ */
.header-buttons {
  display: flex; /* Flexboxで子要素を横並びにする */
  justify-content: space-between; /* 要素間にスペースを均等に配置 */
  margin: 10px auto; /* 上下のマージンと左右中央寄せ */
  width: 100%; /* 親要素の幅いっぱいに広がる */
  max-width: 360px; /* ボタン群の最大幅を制限 */
  box-sizing: border-box;
  padding: 0 16px; /* 左右にパディングを追加し、端に寄るのを防ぐ */
}

/* ヘッダー内の電話番号とお店の紹介ボタン */
.header-buttons a {
  flex: 0 0 48%; /* 2つの要素がそれぞれ約半分の幅を取り、縮小を許可 */
  padding: 10px 0;
  background-color: #004d00;
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  white-space: nowrap; /* テキストの折り返しを防ぐ */
  min-width: 100px; /* ボタンが小さくなりすぎないように最小幅を設定 */
}

/* ヘッダー内の店舗情報テキスト */
.shop-info {
  text-align: left; /* 左寄せ */
  max-width: 480px; /* ロゴと同じくらいの最大幅に設定 */
  margin: 20px auto 0; /* 中央寄せと上マージン */
  padding: 0 16px; /* 左右にパディング */
  font-size: 14px;
  color: #333;
}
.shop-info p {
  margin-bottom: 5px; /* 段落間のスペース */
}
/* sd_order.htmlのフッターテキスト */
.shop-info-footer-text {
  font-size: 14px;
  color: #333;
  margin-top: 16px;
  margin-left: 8px;
  text-align: left;
}

/* 見出しの共通スタイル */
h1,
h2,
h3 {
  text-align: center;
  margin-bottom: 24px;
  color: #333;
}

/* フォーム要素の共通設定 */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%; /* 親要素の幅いっぱいに広がる */
  max-width: 100%; /* 親要素の幅を超えない */
  font-size: 16px;
  padding: 8px 10px; /* 縦パディングを調整 */
  margin-bottom: 12px;
  box-sizing: border-box; /* パディングを幅に含める */
  border: 1px solid #ccc; /* 枠線を追加 */
  border-radius: 4px; /* 角丸 */
  height: 48px; /* 高さ固定 */
}

textarea {
  height: auto; /* テキストエリアは自動調整 */
  min-height: 96px; /* 最小高さを設定 */
}

/* ボタンの基本スタイル */
button {
  font-size: 16px;
  padding: 10px 20px;
  margin-bottom: 12px;
  box-sizing: border-box;
  border-radius: 4px;
  cursor: pointer;
}

/* 住所検索ボタン */
.zip-search-button {
  font-size: 12px;
  padding: 4px 8px;
  display: inline-block;
  width: auto;
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}
.zip-search-button:hover {
  background-color: #e0e0e0;
}

/* 次へボタン */
.next-button {
  background-color: #007bff;
  color: white;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  width: 100%; /* 幅を100%に */
  max-width: 300px; /* 最大幅を設定 */
  display: block; /* 中央寄せのためにブロック要素に */
  margin: 20px auto; /* 中央寄せと上下マージン */
}
.next-button:hover {
  background-color: #0056b3;
}

/* 修正するボタン */
.back-button {
  background-color: #777;
  color: white;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  width: 100%; /* 幅を100%に */
  max-width: 300px; /* 最大幅を設定 */
  display: block; /* 中央寄せのためにブロック要素に */
  margin: 20px auto; /* 中央寄せと上下マージン */
}
.back-button:hover {
  background-color: #555;
}

/* 確認ページのボタン配置 */
.button-group {
  display: flex;
  flex-wrap: wrap; /* 小さい画面で折り返す */
  justify-content: center;
  gap: 20px; /* ボタン間のスペース */
  margin-top: 30px;
}
.button-group .next-button,
.button-group .back-button {
  margin: 0; /* flexboxなので個別のmarginをリセット */
  flex-grow: 1; /* 利用可能なスペースを埋める */
  max-width: 200px; /* ボタンの最大幅 */
}

/* 必須ラベル */
.required-label {
  background: red;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  margin-right: 8px;
  border-radius: 3px;
  display: inline-block;
}

/* 姓・名の入力欄の横並び配置 */
.name-row {
  display: flex; /* Flexboxで横並び */
  gap: 10px; /* 要素間のスペース */
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px; /* 入力欄の下に余白を追加 */
}
.name-row input,
.name-row p {
  /* sd_order.htmlのpタグも考慮 */
  flex: 1; /* 利用可能なスペースを均等に分配 */
  min-width: 0; /* Flexアイテムが内容のサイズより小さくなることを許可 */
  font-size: 16px;
  height: 48px; /* 高さを固定 */
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex; /* pタグ内のテキストを中央揃えにするため */
  align-items: center; /* pタグ内のテキストを中央揃えにするため */
}
.name-row p {
  background-color: #e9e9e9; /* sd_order.htmlのpタグの背景色 */
}

/* 商品情報表示エリアのスタイル（index.htmlの車両情報とsd_order.htmlの商品要約） */
.product-info-display,
#selected-product-preview.product-summary {
  padding: 14px;
  margin: 20px 0;
  background-color: #f0f8ff;
  border-left: 4px solid #0077cc;
  font-size: 16px;
  color: #000;
}
.product-info-display h2,
#selected-product-preview.product-summary h2 {
  margin: 0;
}
.product-info-display p,
#selected-product-preview.product-summary p {
  margin: 4px 0;
}
.product-info-display .product-total,
#selected-product-preview.product-summary .product-total {
  font-size: 20px;
  color: #004d00;
}
.product-info-display .product-total span,
#selected-product-preview.product-summary .product-total span {
  font-size: 18px;
}

/* ご注文内容確認ページ（sd_order.html）のフォームグループ */
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}
.form-group p {
  background-color: #e9e9e9;
  padding: 10px;
  border-radius: 4px;
  word-wrap: break-word; /* 長いテキストがはみ出さないように */
}

/* 定休日の注意書き */
.holiday-note {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

/* フォームノート */
.form-note {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.6;
}

/* レスポンシブ対応（スマートフォン向け: 画面幅480px以下に適用） */
@media screen and (max-width: 480px) {
  /* 全体のパディングを調整し、さらに狭い画面でも収まるように */
  body {
    padding: 8px;
  }
  .container,
  .form-container {
    padding: 15px;
  }

  /* 姓・名の入力欄を縦積みに変更 */
  .name-row {
    flex-direction: column;
  }
  .name-row input,
  .name-row p {
    height: auto; /* 縦積みになった場合、高さは内容に合わせる */
    min-height: 48px; /* 最小高さを確保 */
  }

  /* ヘッダーのボタン群のパディング調整 */
  .header-buttons {
    padding: 0 8px;
    flex-direction: column; /* ボタンを縦積みにする */
    max-width: none; /* 幅の制限を解除 */
  }
  .header-buttons a {
    flex: none; /* Flexboxの比率を解除 */
    width: 100%; /* 幅を100%に */
    margin-bottom: 10px; /* 縦積みになったボタン間の余白 */
  }
  .header-buttons a:last-child {
    margin-bottom: 0; /* 最後のボタンの下マージンは不要 */
  }

  /* 商品要約の調整 */
  .product-summary,
  #selected-product-preview,
  .product-info-display {
    padding: 10px;
    font-size: 14px;
  }

  /* 確認ページのボタンを縦並びにする */
  .button-group {
    flex-direction: column;
    gap: 10px;
  }
}

.step-bar {
  display: flex;
  justify-content: space-between;
  margin: 20px auto;
  padding: 0 10px;
  font-size: 14px;
  max-width: 600px; /* 最大幅を form-container と統一 */
  width: 100%;
}
.step {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-bottom: 3px solid #ccc;
  color: #444444; /* 文字色を修正 */
}
.step.active {
  border-color: #007bff;
  color: #007bff;
  font-weight: bold;
}

/* Flatpickr カスタムスタイル */
.calendar-container {
  max-width: 100%; /* 親要素の幅に合わせる */
}

/* 定休日の背景色 */
.flatpickr-day.holiday {
  background-color: #ffe5e5 !important; /* 薄い赤 */
  color: #000 !important;
  cursor: not-allowed;
}

/* 選択された日付のスタイル */
.flatpickr-day.selected {
  background: #006600 !important; /* 濃い緑 */
  color: white !important;
  border-radius: 6px;
}

/* コメントボックスのスタイル */
.comment-box {
  text-align: center;
  margin-top: 5px; /* 少しスペースを減らす */
  font-size: 14px; /* フォントサイズ */
  color: #d32f2f; /* 赤色 */
  min-height: 20px; /* 領域確保 */
  transition: opacity 0.5s ease;
}

/* Flatpickr入力フィールドのスタイル調整 */
/* input[type="text"] の共通スタイルを Flatpickr の input にも適用されるように */
.flatpickr-input {
  height: 48px; /* 統一された高さ */
  font-size: 16px; /* 統一されたフォントサイズ */
  padding: 8px 10px; /* 統一されたパディング */
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
}

/* フッターリンク */
.footer-link {
  font-size: 14px;
  color: #0000ee;
  text-decoration: none;
  margin: 0 5px; /* リンク間のスペース */
}
.footer-link:hover {
  text-decoration: underline;
}

/* style.css の既存の内容に以下を追加・修正 */

/* ヘッダーボタンのコンテナ (payment_page.html, thank_you.html) */
/* header-buttons は既に定義済みの場合があります。定義済みなら既存のものをそのまま使用してください。 */
.header-buttons {
  display: flex;
  justify-content: space-between;
  margin: 10px auto;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  padding: 0 16px;
}

.header-buttons a {
  flex: 0 0 48%;
  padding: 10px 0;
  background-color: #004d00;
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  white-space: nowrap;
  min-width: 100px;
}

/* 支払い方法の選択肢グループ (payment_page.html) */
.payment-options-group {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 30px;
  align-items: center;
  text-align: center;
  max-width: 400px; /* payment-boxの最大幅に合わせる */
  margin-left: auto;
  margin-right: auto;
}

/* 支払い方法ボックス (payment_page.html) - 既存の .payment-box を調整 */
.payment-box {
  border: 2px solid #007700;
  background-color: #ffffff;
  color: #007700;
  font-weight: bold;
  width: 100%; /* 親要素の幅いっぱいに広がる */
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease;
  text-align: center;
}

.payment-box.card {
  border-color: #0055aa;
  color: #0055aa;
}

.payment-box:hover {
  background-color: #f0f0f0;
}

.payment-box.bank:hover {
  /* 銀行振込のホバー効果を調整 */
  background-color: #e8f5e9;
  border-color: #004d00;
  color: #004d00;
}

.payment-box.card:hover {
  /* クレジットカードのホバー効果を調整 */
  background-color: #e3f2fd;
  border-color: #003366;
  color: #003366;
}

.payment-label {
  font-size: 18px;
}

/* 支払い方法注意書き (payment_page.html) */
.payment-note {
  font-size: 14px;
  color: #555;
  text-align: center;
  margin-top: 10px;
}

/* ありがとうメッセージ (thank_you.html) */
.thanks-message {
  text-align: center;
  font-size: 2rem; /* PC用デフォルトサイズ */
  line-height: 1.4;
  margin-bottom: 24px;
  color: #333;
}

.thanks-message span {
  display: inline; /* PCでは横並び */
}

/* フッターのスタイル (全ページ共通) */
footer {
  text-align: center;
  padding: 20px 0;
  margin-top: 30px;
  border-top: 1px solid #eee;
  background-color: #f4f4f4;
}

footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* スマホで折り返す */
  gap: 10px;
}

.footer-link {
  font-size: 14px;
  color: #0000ee;
  text-decoration: none;
  padding: 5px 10px;
}

.footer-link:hover {
  text-decoration: underline;
}

/* スマートフォン向け調整 */
@media (max-width: 480px) {
  .thanks-message {
    font-size: 1.5rem; /* スマホでフォントサイズを小さく */
  }
  .thanks-message span {
    display: block; /* スマホで縦並び */
  }
  .payment-options-group {
    gap: 20px; /* スマホでの支払いボックス間のスペース調整 */
  }
  footer nav {
    flex-direction: column; /* フッターリンクを縦並びにする */
  }
}

/* style.css */

/* フォームグループ */
.form-group {
  margin-bottom: 15px; /* ← この値を調整します */
}

/* 第1・第2希望 両方対応 */
.calendar-container + .form-group {
  margin-top: 6px;
}

@media (max-width: 768px) {
  .calendar-container + .form-group {
    margin-top: 4px;
  }
}

.shop-info-card {
  max-width: 600px;
  margin: 2em auto;
  background-color: #f0f8ff;
  border: 2px solid #007bff;
  border-radius: 10px;
  padding: 1.5em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: left;
  font-family: "Helvetica", "Arial", sans-serif;
}

.shop-info-card .shop-name {
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.4em;
  color: #007bff;
  font-weight: bold;
  border-bottom: 1px solid #007bff;
  padding-bottom: 0.5em;
}

.shop-info-card .shop-info-detail p {
  margin: 0 0 1em 0;
  font-size: 1em;
  line-height: 1.6;
}

.shop-info-card strong {
  color: #333;
  font-weight: 600;
}
.product-info-display,
#selected-product-preview.product-summary {
  text-align: center; /* テキスト中央揃え */
}

.product-info-display img,
#selected-product-preview.product-summary img {
  display: block;
  margin: 0 auto 10px; /* 中央揃え＋下に余白 */
  max-width: 100%;
  height: auto;
}
#selected-product-preview.product-summary {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
#selected-product-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#selected-product-summary img {
  display: block;
  margin: 10px auto;
  max-width: 100%;
  height: auto;
}
/* 注文ページ・確認ページ共通の商品画像表示エリア */
#selected-product-preview img,
#selected-product-summary img {
  width: 240px; /* お好みで 200px〜300px に調整可能 */
  height: auto; /* アスペクト比維持 */
  display: block;
  margin: 10px auto; /* 中央揃え＋上下余白 */
  border-radius: 8px; /* 任意：角を少し丸める */
}

/* スマートフォン用に少し小さく */
@media (max-width: 480px) {
  #selected-product-preview img,
  #selected-product-summary img {
    width: 180px;
  }
}
.footer-link {
  display: inline-block;
  margin: 0 10px;
  color: #555;
  text-decoration: underline;
  font-size: 13px;
}
.footer-link:hover {
  color: #000;
}
.confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}
.confirm-table th,
.confirm-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}
.confirm-table th {
  width: 30%;
  background-color: #f9f9f9;
}
.container {
  text-align: center;
}

#selected-product-summary {
  margin: 20px auto;
  display: inline-block;
  text-align: center;
}

#payment-bank,
#payment-square {
  margin-top: 30px;
  display: inline-block;
  text-align: center;
}

.btn-square {
  display: inline-block;
  background-color: #0070c0; /* Square風の安心感ある青色 */
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  padding: 1em 2em;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  margin: 20px auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 400px;
  transition: background-color 0.3s ease;
}

.btn-square:hover {
  background-color: #005999;
}

/* 注文確認・決済ページの商品ブロックを中央揃え */
#selected-product-summary,
#confirm-product-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#selected-product-summary p,
#confirm-product-summary p {
  text-align: center;
  margin: 4px 0;
}

#selected-product-summary img,
#confirm-product-summary img {
  display: block;
  margin: 10px auto;
  width: 240px; /* 適度なサイズ */
  height: auto;
  border-radius: 8px;
}

/* --- Flatpickr: 定休日の見た目（選択不可セルの色） --- */
.flatpickr-day.holiday {
  background: #fff2f2; /* 薄い赤 */
  color: #b91c1c;
  border-color: #fecaca;
  cursor: not-allowed;
}

#response {
  text-align: center;
  font-size: 1rem; /* 大きさ調整（任意） */
  margin-top: 1em; /* ボタンとの間隔 */
}

#customer-name {
  font-size: 18px; /* ここで大きさを調整 */
  font-weight: bold; /* 太字にするなら追加 */
  color: #333; /* mutedカラーから濃くしたい場合 */
}
