/* モバイルファースト CSS */

:root {
  --gap: 8px;
  --topbar-height: 48px;
  --subnav-height: 44px;
  /* subnav は content 側にあるため、ヘッダー高は topbar のみ（PCではメガナビ分を別途加算） */
  --header-height: var(--topbar-height);
  --sidebar-width: 280px;

  /* サブナビ（暖簾風） */
  --noren-wood-1: #8b5e34;
  --noren-wood-2: #6f4724;
  --noren-wood-shadow: rgba(17, 24, 39, 0.25);
  --noren-fabric-1: #f3e6d2;
  --noren-fabric-2: #ead7bb;
  --noren-ink: #1f2937;
  --noren-stitch: rgba(120, 92, 63, 0.55);
  --noren-active-1: #1f2937;
  --noren-active-2: #111827;
  --noren-active-stitch: rgba(255, 255, 255, 0.55);
}

/* アクセシビリティとフォーカス */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 1.5px solid #57534e;
}

/* 基本リセット */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.5em;
  overflow-x: hidden;
  font-size: 16px; /* モバイルで読みやすいサイズに */
}

h1 {
  text-align: center;
  font-size: 24px;
  /* line-height: 1.3em; */
}

/* パンくずリスト */
.breadcrumbs {
  font-size: 12px;
  padding: 6px var(--gap);
  white-space: nowrap;
  background: rgb(234, 243, 254);
  border-bottom: 2px solid #e5e7eb;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.breadcrumbs a {
  display: inline-block;
  color: #000000;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumbs i {
  margin-right: 3px;
  font-size: 1.2em;
}
.breadcrumbs a:hover {
  color: #0066cc;
  text-decoration: underline;
}
.breadcrumbs span {
  color: #6b7280;
}

/*======================= ヘッダー（モバイル） ===========================*/
.site-header {
  /* ヘッダー全体を画面上で固定 */
  position: sticky;
  position: -webkit-sticky; /* iOS Safari 対応 */
  /* 明示的にコンテナ化 */
  z-index: 9999;
  top: 0;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid #e5e7eb;

  /* モバイルでスクロール方向に応じて出し入れ（JSで is-collapsed を付与） */
  transform: translateY(0);
  transition: transform 220ms ease;
  will-change: transform;
}

/* ヘッダーを隠す（モバイル用：JSで付与） */
.site-header.is-collapsed {
  transform: translateY(-110%);
}

/* ヘッダーが隠れている間、各固定要素の基準オフセットを0にする */
html.header-collapsed {
  --header-height: 0px;
}

/*-------------------- 上段ヘッダー（モバイル） ----------------------*/
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 8px var(--gap);
  gap: 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: nowrap;
}

/* ロゴ（モバイル） */
.topbar-left {
  display: flex;
  align-items: center;
}
.topbar-title {
  text-decoration: none;
  font-size: 24px;
  color: #6b7280;
}

/* 検索バーをヘッダー中央に表示 */
.topbar-center {
  /* モバイルではアイコンのみ。検索フォームは非表示 */
  display: none;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
}
.topbar-search .search-input-wrap {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}
.topbar-search .search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
}

.topbar-search .search-input-wrap input[type="text"] {
  width: 100%;
  padding-left: 34px; /* アイコン分の左余白 */
  padding-right: 34px; /* クリアボタン分の右余白 */
  border-radius: 100px;
}
.topbar-search .search-input-wrap .clear-btn {
  position: absolute;
  right: 6px;
  display: none; /* 初期は非表示、入力時に表示 */
  align-items: center;
  justify-content: center;
  width: 32px; /* 視覚はアイコンのみ、ヒットエリアは十分に */
  height: 32px;
  padding: 0; /* 汎用ボタンスタイルを打ち消す */
  min-width: 0; /* 汎用のmin-widthを打ち消す */
  border: none;
  border-radius: 100px;
  background: transparent;
  color: #6b7280; /* アイコン色 */
  font-size: 16px; /* アイコンサイズ */
  line-height: 1;
  cursor: pointer;
}
.topbar-search .search-input-wrap .clear-btn:hover {
  background: transparent; /* 背景は変えない */
  color: #374151; /* わずかに濃く */
  transform: none; /* 汎用ホバーの浮き上がりを無効化 */
  box-shadow: none;
}
.topbar-search input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  transition: border-color 0.2s ease;
  min-width: 160px;
  max-width: 100%;
}
.topbar-search input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.topbar-search button {
  padding: 8px 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 60px;
  flex-shrink: 0; /* サイドバーと同じ設定を追加 */
}
.topbar-search button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 右側エリア（モバイル） */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ユーザー「ようこそ〇〇さん」（モバイルでは非表示） */
.topbar-welcome {
  display: none;
}
/* ユーザー用ボタン各種 */
.topbar-nav {
  /* モバイルではテキストボタン非表示（アイコン化） */
  display: none;
  gap: 8px;
  align-items: center;
}
.topbar-nav-btn {
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  font-size: 13px;
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* 「マイページ・ログイン」ボタン */
.topbar-nav-btn-mypage,
.topbar-nav-btn-login {
  color: #1e40af;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #3b82f6;
}
.topbar-nav-btn-mypage:hover,
.topbar-nav-btn-login:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* モバイル用：トップバー内のアイコンボタン（検索・ログイン） */
.topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: black;
  background: none;
  border: none;
  text-decoration: none;
  font-size: 23px;
  cursor: pointer;
}

/* モバイル用：全画面検索（オーバーレイ） */
.mobile-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050; /* header(9999)より上 */
  background: var(--surface-2, #ffffff);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;

  /* 登場方法の設定 */
  opacity: 0;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 300ms ease,
    transform 300ms ease,
    visibility 0s linear 300ms;
  will-change: opacity, transform;
}
.mobile-search-overlay.is-open {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 300ms ease,
    transform 300ms ease,
    visibility 0s linear 0s;
}
body.mobile-search-overlay-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-search-overlay {
    transition: none;
    transform: none;
  }
  .mobile-search-overlay.is-open {
    transform: none;
  }
}

.mobile-search-overlay__top {
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  padding: 0px var(--gap);
  background: linear-gradient(180deg, var(--topbar-bg-1, var(--surface-1, #ffffff)), var(--topbar-bg-2, var(--surface-1, #ffffff)));
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.mobile-search-overlay__back,
.mobile-search-overlay__advanced {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--header-fg, var(--text, #111827));
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
  font-size: 22px;
}
.mobile-search-overlay__back:hover,
.mobile-search-overlay__advanced:hover {
  background: var(--nav-hover-overlay, rgba(0, 0, 0, 0.06));
}
.mobile-search-overlay__back:active,
.mobile-search-overlay__advanced:active {
  background: var(--nav-hover-overlay, rgba(0, 0, 0, 0.1));
}

.mobile-search-overlay__form.topbar-search {
  width: 100%;
  min-width: 0;
}
.mobile-search-overlay__form .search-input-wrap {
  width: 100%;
}
.mobile-search-overlay input[type="text"] {
  font-size: 16px;
}

.mobile-search-overlay__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  background: var(--surface-2, #ffffff);
}

.mobile-suggest-list {
  width: 100%;
}

/* オーバーレイ内のサジェストはモバイル専用デザイン */
.mobile-search-overlay .suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px var(--gap);
  text-decoration: none;
  color: var(--text, #111827);
  font-size: 15px;
  line-height: 1.35;
  border-bottom: 1px solid var(--border, #e5e7eb); /* 行区切り */
  border-radius: 0; /* 外枠の丸み不要 */
}
.mobile-search-overlay .suggest-item:hover {
  background: var(--nav-hover-overlay, rgba(0, 0, 0, 0.04));
}
.mobile-search-overlay .suggest-item:active {
  background: var(--nav-hover-overlay, rgba(0, 0, 0, 0.08));
}
.mobile-search-overlay .suggest-item__text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal; /* 折り返しOK */
  word-break: break-word;
}
.mobile-search-overlay .suggest-item__chevron {
  flex: 0 0 auto;
  color: var(--muted, #9ca3af);
  font-size: 24px;
  line-height: 1;
}
.suggest-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-1, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 20px var(--shadow, rgba(0, 0, 0, 0.08));
  padding: 4px;
  z-index: 1002;
  display: none;
  max-height: 280px;
  overflow-y: auto;
}
.suggest-dropdown.is-open {
  display: block;
}
.suggest-dropdown .suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.suggest-dropdown .suggest-item__text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-dropdown .suggest-item__chevron {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--muted, #9ca3af);
  font-size: 20px;
  line-height: 1;
}
.suggest-item {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text, #111827);
  border-radius: 6px;
  font-size: 14px;
}
.suggest-item__text {
  display: inline;
}
.suggest-item:hover {
  background: var(--nav-hover-overlay, rgba(0, 0, 0, 0.06));
}

/* ハンバーガーメニューボタン（モバイル・タブレットのみ表示） */
.mobile-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 4px;
  min-width: 44px;
  min-height: 44px;
}
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
}
.hamburger-icon span {
  display: block;
  height: 3.5px;
  background-color: black;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.mobile-sidebar-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-sidebar-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}
.mobile-sidebar-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/*-------------------- メガナビ（モバイル・タブレットでは非表示） ----------------------*/
.mega-nav {
  display: none;
}

/*-------------------- サブヘッダー（モバイル詳細版） ----------------------*/
.subnav-row {
  /* content の先頭でヘッダー直下に固定 */
  position: sticky;
  top: var(--header-height);
  z-index: 9996; /* header(9999) < sidebar(9998) < overlay(9997) より下 */
  display: block;
  isolation: isolate;
  padding-top: 6px; /* 上の木の桟分 */

  /* スクロール方向で出し入れ（JSで is-collapsed を付与） */
  transform: translateY(0);
  opacity: 1;
  transition:
    top 220ms ease,
    transform 220ms ease,
    opacity 220ms ease;
  will-change: transform, top;
}

.subnav-row.is-collapsed {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

/* 暖簾を吊るす木の桟（上部） */
.subnav-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background:
    linear-gradient(90deg, var(--noren-wood-1), var(--noren-wood-2)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0px, rgba(255, 255, 255, 0.08) 8px, rgba(0, 0, 0, 0.06) 8px, rgba(0, 0, 0, 0.06) 16px);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.25),
    0 2px 8px var(--noren-wood-shadow);
  z-index: 1;
}

/* カテゴリー表示エリア（モバイル版） */
.subnav-cats {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden; /* モバイル横スクロール時の縦スクロール介入を防止 */
  -webkit-overflow-scrolling: touch; /* 慣性スクロール */
  scrollbar-width: none;
  gap: 0;
}
.subnav-cats::-webkit-scrollbar {
  display: none;
}

.subnav-links3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.subnav-links3 .subnav-item {
  min-width: 0;
  flex-shrink: 1;
}

/* サブナビアイテム（モバイル版） */
.subnav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--subnav-height);
  text-decoration: none;
  color: var(--noren-ink);
  border-right: 1px dashed var(--noren-stitch);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  min-width: 75px;
  /* 暖簾っぽい“布”の質感（画像なし） */
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 45%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.03) 0px, rgba(0, 0, 0, 0.03) 10px, rgba(255, 255, 255, 0.06) 10px, rgba(255, 255, 255, 0.06) 20px),
    linear-gradient(180deg, var(--noren-fabric-1) 0%, var(--noren-fabric-2) 100%);
  text-align: center;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  /* border-bottom-left-radius: 10px; */
  /* border-bottom-right-radius: 10px; */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -10px 14px rgba(0, 0, 0, 0.06);
}

/* 上部の“縫い目” */
.subnav-item::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 6px;
  /* border-top: 1px dashed var(--noren-stitch); */
  opacity: 0.9;
}

/* 下部の“裾フリンジ”風 */
.subnav-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0px, rgba(0, 0, 0, 0.06) 2px, rgba(255, 255, 255, 0.12) 2px, rgba(255, 255, 255, 0.12) 6px);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  opacity: 0.6;
}
.subnav-item:last-child {
  border-right: none;
}
.subnav-item:hover {
  color: var(--nav-hover-fg, #4a7c59);
  transform: translateY(-2px) scale(1.06);
  z-index: 2;
  box-shadow:
    inset 0 0 0 999px var(--nav-hover-overlay, rgba(74, 124, 89, 0.18)),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -10px 14px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(17, 24, 39, 0.12);
}
.subnav-item:active {
  transform: translateY(0) scale(1.02);
}
/* アクティブ状態（モバイル版） */
.subnav-item.active {
  background: linear-gradient(180deg, var(--noren-active-1), var(--noren-active-2));
  color: #ffffff;
  font-weight: 600;
  position: relative;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.subnav-item.active:hover {
  color: #ffffff;
}
.subnav-item.active:active {
  color: #ffffff;
}
/* アクティブ時は縫い目を明るく */
.subnav-item.active::before {
  border-top-color: var(--noren-active-stitch);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .subnav-row {
    transition: none;
  }
  .site-header {
    transition: none;
  }
  .sidebar {
    transition: none;
  }
  .sidebar-overlay {
    transition: none;
  }
  .subnav-item {
    transition: none;
  }
}

/* 1024px未満：サブナビが溢れないときは等分して余白を作らない */
@media screen and (max-width: 1023.98px) {
  .subnav-cats.is-fit {
    overflow-x: hidden;
  }
  .subnav-cats.is-fit .subnav-item {
    flex: 1 1 0;
    min-width: 0;
    flex-shrink: 1;
  }
}

/*======================= サイドバー（モバイル） ===========================*/
.sidebar {
  position: fixed;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  right: -100%;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  z-index: 9998; /* ヘッダーより低く設定 */
  transition:
    right 0.35s ease,
    top 220ms ease,
    height 220ms ease;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f9fafb;
  /* スクロール最適化 */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* iOS SafeAreaとAndroidナビゲーションバーに対応 */
  padding-bottom: env(safe-area-inset-bottom, 20px);
}
.sidebar.mobile-open {
  right: 0;
}

.sidebar-content {
  padding-top: 10px;
  padding-right: 20px;
  padding-left: 20px;
  padding-bottom: 100px;
}

/* PC用サイドバー開閉（デフォルト：モバイル/タブレットでは非表示） */
.sidebar-top-row {
  display: block;
}
.sidebar-collapse-btn,
.sidebar-expand-btn {
  display: none;
}
.sidebar-rail {
  display: none;
}

/* サイドバーオーバーレイ */
.sidebar-overlay {
  position: fixed;
  top: var(--header-height, 104px);
  height: calc(100vh - var(--header-height));
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9997; /* サイドバーより低く設定 */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    top 220ms ease,
    height 220ms ease;
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 管理者ページボタン */
.sidebar-admin {
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e7e5e4;
}
.sidebar-admin-btn {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: #166534;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid #22c55e;
  font-size: 14px;
}
.sidebar-admin-btn:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* ユーザー用認証ボタン（サイドバー内） */
.sidebar-nav {
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e7e5e4;
}
/* サイドバー内ウェルカムメッセージ */
.sidebar-welcome {
  margin-bottom: 12px;
  text-align: center;
}
.sidebar-welcome span {
  color: #000000;
  font-size: 14px;
  font-weight: 400;
  display: block;
  line-height: 1.4;
}
.sidebar-welcome strong {
  font-weight: 700;
}
.sidebar-nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 共通ボタンスタイル */
.sidebar-nav-btn {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 16px;
  text-align: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-height: 48px;
}
/* 「マイページ・ログアウト」ボタン */
.sidebar-nav-btn-mypage {
  color: #1e40af;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #3b82f6;
}
.sidebar-nav-btn-logout {
  color: #dc2626;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: #ef4444;
}
.sidebar-nav-btn-mypage:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.sidebar-nav-btn-logout:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}
/* 「ログイン・新規登録」ボタン */
.sidebar-nav-btn-login,
.sidebar-nav-btn-signup {
  color: #1e40af;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #3b82f6;
}
.sidebar-nav-btn-login:hover,
.sidebar-nav-btn-signup:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* モバイル用メガナビゲーション */
.sidebar-mega-nav {
  display: block;
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e7e5e4;
}
.sidebar-mega-nav h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: bold;
  color: #57534e;
}
.sidebar-mega-nav a {
  display: flex;
  gap: 5px;
}
.sidebar-mega-nav__item {
  display: block;
  padding: 16px 8px;
  text-decoration: none;
  color: #57534e;
  border-bottom: 1px solid #e7e5e4;
  font-weight: 500;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  font-size: 16px; /* 読みやすいサイズに */
  min-height: 48px; /* タッチに適したサイズ */
  align-items: center;
}
.sidebar-mega-nav__item:hover {
  color: #4a7c59;
  background-color: var(--nav-hover-overlay, rgba(74, 124, 89, 0.18));
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.12);
}
.sidebar-mega-nav__item:active {
  transform: translateY(0) scale(1.01);
}

/* 酒類カテゴリーリンク */
.sidebar-categories h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: bold;
  color: #57534e;
}
.sidebar-categories {
  padding-top: 20px;
  padding-bottom: 20px;
}
.sidebar-category__item {
  display: flex;
  align-items: center;
  padding: 16px 0px 16px 8px;
  text-decoration: none;
  color: #57534e;
  border-bottom: 1px solid #e7e5e4;
  font-weight: 500;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  font-size: 16px; /* 読みやすいサイズに */
  min-height: 48px; /* タッチに適したサイズ */
}
.sidebar-category__item:hover {
  color: #4a7c59;
  background-color: var(--nav-hover-overlay, rgba(74, 124, 89, 0.18));
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.12);
}
.sidebar-category__item:active {
  transform: translateY(0) scale(1.01);
}

/*======================= メインコンテンツ（モバイル） ===========================*/
#content {
  margin-left: 0;
  padding-bottom: 60px; /* フッター分の余白を確保 */
  min-height: calc(100vh - var(--header-height, 80px));
  position: relative;
}
.content-container {
  padding: 0 var(--gap);
}

/* フラッシュメッセージ */
.flash {
  list-style: none;
  padding: 0;
  margin: 0;

  /* トースト：本文を押し下げない */
  position: fixed;
  top: calc(var(--header-height, 48px) + env(safe-area-inset-top, 0px) + 8px);
  right: 8px;
  width: min(420px, calc(100vw - 16px));
  z-index: 10020;

  display: flex;
  flex-direction: column;
  gap: 8px;

  /* トースト以外へのクリック/スクロールを邪魔しない */
  pointer-events: none;
}
.flash-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 32px;
  align-items: start;
  gap: 10px;

  /* トースト本体 */
  pointer-events: auto;
  padding: 12px 10px 12px 12px;
  margin: 0;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 6px solid currentColor;
  color: #92400e;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);

  /* アニメーション */
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}
.flash-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  opacity: 0.95;
}
.flash-message {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.35;
}
.flash-message .flash-emph {
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0 0.12em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
}
.flash-close {
  position: static;
  appearance: none;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
}
.flash-close .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}
.flash-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #374151;
}
.flash-close:focus-visible {
  outline: 2px solid rgba(87, 83, 78, 0.8);
  outline-offset: 2px;
}
.flash-item.flash-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.flash-item.flash-error,
.flash-item.flash-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.flash-item.flash-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.flash-item.flash-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
.flash-item.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .flash-item {
    transition: none;
  }
}

/*======================= フッター（モバイル） ===========================*/
.site-footer {
  padding: 20px 0;
  background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%);
  color: black;
  font-size: 13px;
}

.footer-container {
  padding: var(--gap);
}

.footer-categories h3 {
  margin: 0 0 16px 0;
  font-size: 20px; /* 読みやすいサイズに */
  font-weight: bold;
}

.footer-category-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px; /* 少し広く */
}

.footer-category-item a {
  display: block;
  padding: 12px 0; /* タップしやすいサイズに */
  text-decoration: none;
  color: #57534e;
  border-bottom: 2px solid #e5e7eb;
  font-size: 16px; /* 読みやすいサイズに */
  border-radius: 8px;
  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}
.footer-category-item a:hover {
  color: #44403c;
  background-color: var(--footer-hover-overlay, rgba(0, 0, 0, 0.04));
}
/* キーボード操作でも分かるように */
.footer-category-item a:focus-visible {
  background-color: var(--footer-hover-overlay, rgba(0, 0, 0, 0.06));
}

.footer-links {
  display: flex;
  gap: 12px;
  margin: 20px 0 12px 0;
  flex-wrap: wrap;
}
.footer-links a {
  color: #6b7280;
  text-decoration: none;
  font-size: 16px;
  padding: 8px;
  border-radius: 8px;
  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}
.footer-links a:hover {
  color: #374151;
  background-color: var(--footer-hover-overlay, rgba(0, 0, 0, 0.04));
}
.footer-links a:focus-visible {
  background-color: var(--footer-hover-overlay, rgba(0, 0, 0, 0.06));
}

.site-footer p {
  margin: 8px 0;
  font-size: 14px; /* 少し大きく */
  color: #6b7280;
  line-height: 1.5;
}

/*======================= PC専用：ページTOPへボタン（ベース） ===========================*/
.page-top-btn {
  /* PC以外は base_responsive.css 側で display を切替 */
  display: none;
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 9995;

  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;

  width: 78px;
  height: 78px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--accent, #4a7c59);
  color: var(--accent-contrast, #ffffff);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.24);
  cursor: pointer;

  /* フェードイン/アウト */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s linear 180ms;
}

.page-top-btn .material-symbols-outlined {
  font-size: 28px;
  line-height: 1;
}

.page-top-btn__label {
  font-size: 15px;
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
}

.page-top-btn:hover {
  background: var(--accent-hover, var(--accent, #4a7c59));
  transform: translateY(8px) scale(1.01);
}

.page-top-btn:active {
  transform: translateY(9px) scale(0.99);
}

.page-top-btn:focus-visible {
  outline: 2px solid var(--focus-ring, rgba(138, 90, 43, 0.55));
  outline-offset: 3px;
}
