/* ===========================
   Global Reset & Base Styles
   =========================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: sans-serif;
  background: #eaf5e3;
}

.container {
  width: 100%;
  max-width: 2500px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ===========================
   Layout
   =========================== */
.content {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 32px;
}
.content.desktop-only {
  max-width: 2000px;
  margin: 0 auto;
  background: #fefefe;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.sidebar {
  width: 250px;
  min-width: 200px;
}
main {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

@media screen and (max-width: 768px) {
  .content {
    flex-direction: column;
    gap: 16px;
    overflow-x: hidden;
  }
  .sidebar,
  main {
    width: 100%;
    min-width: 0;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
}

@media screen and (min-width: 769px) {
  .desktop-only { display: block; }
  .mobile-only { display: none; }
}

@media screen and (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-only { display: block; }
}

/* ===========================
   Top Links & Navigation
   =========================== */
.top-links {
  background: #eef;
  padding: 8px 10px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #ccc;
}
.top-links a {
  margin: 0 10px;
  color: #3366cc;
  text-decoration: none;
}
.top-links a:hover {
  text-decoration: underline;
}
.menu-toggle {
  display: none;
  font-size: 18px;
  background: #007bff;
  color: #fff;
  padding: 10px 15px;
  cursor: pointer;
  text-align: center;
}
@media screen and (max-width: 768px) {
  .menu-toggle { display: block; }
  #mobileMenu.top-links {
    display: none;
    flex-direction: column;
    background: #eef;
    padding: 10px 0;
  }
  #mobileMenu.top-links.show { display: flex; }
  #mobileMenu.top-links a {
    display: block;
    padding: 8px 16px;
    border-bottom: 1px solid #ccc;
  }
}

/* ===========================
   Header
   =========================== */
header {
  background: #0073e6;
  color: #fff;
  padding: 10px 0;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}
header h1 {
  margin: 0;
  white-space: nowrap;
}
@media screen and (max-width: 768px) {
  header h1 { font-size: 18px; }
}

/* ===========================
   Headings
   =========================== */
h2 {
  text-align: center;
  margin: 1em 0;
}

/* ===========================
   Language Switch
   =========================== */
.lang-switch {
  /* ボタン群の幅に合わせる */
  width: max-content;      /* Chrome, FF などモダンブラウザでOK */
  /* 横方向のマージン自動で中央に */
  margin: 5px auto;       /* 上下余白はお好みで */
  /* もしテキスト寄せが要るなら */
  text-align: center;
  /* 背景色が出ていたら消す */
  background: none;
}
.lang-switch form {
  /* 共通 form { … } の背景＋余白をキャンセル */
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  margin: 0;

  /* ボタンの幅にピタリと合わせたいので inline-block のまま */
  display: inline-block;
}
.lang-switch button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #a3d9a5;
  background: #f2f2f2;
  font-size: 12px;
  margin-left: 5px;
  cursor: pointer;
  transition: all .2s ease;
  color: #333;
}
.lang-switch button:hover {
  background: #ddd;
}
.lang-switch button.active {
  background: #007BFF;
  color: #fff;
  border-color: #007BFF;
}
@media (prefers-color-scheme: dark) {
  .lang-switch button {
    background: #2a2a2a;
    color: #ccc;
    border: 1px solid #444;
  }
  .lang-switch button:hover { background: #444; }
  .lang-switch button.active {
    background: #1e90ff;
    color: #fff;
    border-color: #1e90ff;
  }
}


/* ===========================
   Calendar
   =========================== */
.calendar-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}
.calendar-month {
  margin-bottom: 20px;
}
.calendar-month h3 {
  text-align: center;
  font-size: 16px;
  margin-bottom: 5px;
}
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
  margin: 0 auto;
  font-size: 14px;
}
.calendar-table th,
.calendar-table td {
  width: 14.2%;
  border: 1px solid #000000;
  text-align: center;
  padding: 5px;
}
.calendar-table th {
  background: #f0f0f0;
  font-weight: bold;
}
.calendar-table td button {
  width: 100%;
  padding: 6px 0;
  font-size: 13px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.calendar-table td button:hover {
  background: #0056b3;
}
.calendar-table td button:disabled {
  background: #ccc;
  color: #666;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px auto;
  font-size: 16px;
  max-width: 300px;
}
.calendar-header a {
  padding: 5px 10px;
  background: #007bff;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}
.calendar-header span {
  font-weight: bold;
  text-align: center;
  flex-grow: 1;
}
@media screen and (max-width: 768px) {
  .calendar-table { font-size: 13px; }
}
/* ===========================
   Schedule
   =========================== */
.schedule-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin: 0 auto;
  display: inline-block; 
}
  .schedule-wrapper .store-announcement {
    width: 100%;
    box-sizing: border-box;
  }
.schedule-table {
  display: table;
  width: max-content;
  min-width: 800px;
  border-collapse: collapse;
  margin: 0 auto 20px;
}
.schedule-table th,
.schedule-table td {
  border: 1px solid #000000;
  padding: 6px;
  text-align: center;
  font-size: 15px;
  white-space: nowrap;
}
.schedule-table th {
  background: #e0f0ff;
}
.schedule-table .reserved {
  background: #a3d9a5;
  font-weight: bold;
}
.schedule-table .available {
  background: #fff;
  color: #007bff;
}
.schedule-table .holiday {
  background: #f0f0f0;
  color: #666;
  font-style: italic;
}
.disabled-slot {
  background: #eee !important;
  color: #999 !important;
  pointer-events: none;
}
@media screen and (max-width: 768px) {
  .schedule-table th,
  .schedule-table td {
    padding: 4px 6px;
    font-size: 14px;
  }
}
.off {
  background-color: #e0e0e0;
  color: #666;
  text-align: center;
  font-weight: bold;
}


/* ===========================
   Form
   =========================== */
form {
  background: #f0f0f0;
  padding: 15px;
  border-radius: 5px;
  text-align: left;
  margin: 32px auto;  /* ← 上下32px、左右中央寄せ */
  box-sizing: border-box;
  max-width: 970px;   /* ← 適切な最大幅で制限 */
  width: 100%;        /* ← レスポンシブ対応 */
}

form label {
  display: block;
  margin-bottom: 2px;
  font-weight: bold;
  font-size: 14px;
}
form input,
form select,
form textarea {
  width: 100%;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  font-size: 16px;
  box-sizing: border-box;
}
form textarea {
  height: 100px;
}
form button {
  background: #28a745;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  padding: 10px;
  width: 100%;
  font-size: 16px;
  margin-top: 10px;
}
form button:hover {
  background: #218838;
}
@media screen and (max-width: 768px) {
  form {
    overflow-x: hidden;
  }
  form table {
    width: 100%;
    table-layout: fixed;
  }
  form td {
    word-break: break-word;
    padding: 4px;
    vertical-align: top;
  }
}

/* ===========================
   Admin Page
   =========================== */
.admin-container {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  background: #fff;
  padding: 20px;
  border: 2px solid #ccc;
}
.admin-memo-row input[type="text"] {
  background: #f9fef9;
  font-size: 13px;
}
.admin-memo-row button {
  cursor: pointer;
}
.admin-memo-row td {
  border-top: 1px solid #ccc;
}

/* ===========================
   Utility
   =========================== */
a.admin-link {
  opacity: 0;
  pointer-events: none;
}
/* ─────────────────────────
   上部の余白をなくす
───────────────────────── */
/* “TOP／予約／メニュー…” と 言語切替 の間を詰める */
.top-links {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.store-announcement {
  background: #fff8e1;
  border: 1px solid #ffeb3b;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 4px;

  /* ↓ ここをお好みのサイズに */
  font-size: 1.8rem; /* 1.125rem = 18px 相当 */
  /* あるいは font-size: 16px;、font-size: 1.2em; などでもOK */

  color: #333;
}
/* ── 管理画面：休日カレンダー ── */
.calendar-container td {
  cursor: pointer;               /* カーソルが手の形になる */
  transition: background-color .2s ease;
}
.calendar-container td.holiday {
  background-color: #ffeb3b;     /* 休日セルの背景色 */
}

/* --- 既存のスタイルに続けて追加して下さい --- */

/* テーブルなど横幅がはみ出す要素はスクロール可能に */
.table-responsive {
  overflow-x: auto;
}

/* カレンダーの３ヶ月表示を flex レイアウトに */
.calendar-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* 月ボックスは幅固定ではなく、画面幅に応じて変化 */
.month-box {
  flex: 1 1 100%; /* デフォルトは全幅 */
  min-width: 240px; /* 小さすぎないように */
}

/* メニュー一覧のテーブルもスクロール対応 */
.menu-list {
  margin-bottom: 16px;
}
.menu-list table {
  width: 100%;
  border-collapse: collapse;
}
.menu-list thead {
  background: #f5f5f5;
}
.menu-list th,
.menu-list td {
  padding: 8px;
  border: 1px solid #ddd;
}

/* ボタンやテキストエリアなどフォーム部品の幅を揃える */
form textarea,
form input,
form select,
form button {
  width: 100%;
  box-sizing: border-box;
}

/* スマホ幅での細かい調整 */
@media screen and (max-width: 600px) {
  body {
    padding: 8px;
  }
  h1, h2, h4 {
    font-size: 1.2em;
  }
  .toggle-btn {
    font-size: 1em;
    padding: 6px 8px;
  }
  .menu-list th,
  .menu-list td {
    font-size: 0.9em;
  }
}
/* ─── ログイン画面専用 ───────────────────── */
.login-container {
  max-width: 360px;
  margin: 2em auto;
  padding: 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  background: #fff;
  border-radius: 8px;
}

.login-container h1 {
  margin-bottom: 1em;
  font-size: 1.4em;
  text-align: center;
}

.login-form label {
  display: block;
  margin-bottom: 0.75em;
}

.login-form label span {
  display: block;
  margin-bottom: 0.25em;
  font-size: 0.9em;
}

.login-form input[type="password"] {
  width: 100%;
  padding: 0.6em;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-form button {
  width: 100%;
  padding: 0.75em;
  margin-top: 0.5em;
  border: none;
  border-radius: 4px;
  background: #007bff;
  color: #fff;
  font-size: 1em;
}

.error {
  color: #d00;
  margin-bottom: 1em;
  text-align: center;
}

/* 小さい画面で余白を調整 */
@media screen and (max-width: 400px) {
  .login-container {
    margin: 1em;
    padding: 0.75em;
  }
  .login-container h1 {
    font-size: 1.2em;
  }
}
/* モバイル版 管理者コメントセル */
.admin-comment-mobile {
  background: #f0fff0;
  font-size: 0.85em;
  padding: 4px;
  word-break: break-word;
}

@media screen and (max-width: 768px) {
  .login-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1em !important;
    margin: 1em auto !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .login-form input,
  .login-form button {
    width: 100% !important;
    box-sizing: border-box;
  }
}
/* すべての要素でパディング込みの幅計算に統一 */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 万一の横オーバースクロール完全ブロック */
html, body {
  overscroll-behavior-x: none;   /* 横方向の “ぐにゃっ” を封じる */
}
