/* ===========================
Overlay handling
=========================== */
#overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#overlay.active { 
  display: flex; 
  opacity: 1;
}

#overlay-content {
  background: #fff;
  width: 80vw; /* 画面幅の80% */
  max-width: 450px;
  max-height: 80vh;
  overflow: auto;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  position: relative;
  transform: scale(0.9) translateY(-10px);
  opacity: 0;
  transition: all 0.2s ease;
}

#overlay.active #overlay-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.close-btn {
  background: #f8f9fa;
  border: 2px solid #dc3545;
  color: #dc3545;
  font-weight: bold;
  cursor: pointer;
  float: right;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.close-btn:hover {
  background: #dc3545;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

#subcategory-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  clear: both;
}
#subcategory-list li { border-bottom: 1px solid #eee; }
#subcategory-list .filter-btn {
  display: block;
  width: 100%;
  padding: .75rem 1rem;
  color: #0078D7;
  text-decoration: none;
  font-weight: bold;
}
#subcategory-list .filter-btn:hover { background: #f0f6ff; }




/* ===========================
CSS変数（配色管理）
=========================== */
:root {
  --bg-color: #FFF8F5;
  --header-color: #FADADD;
  --text-color: #4A3C3C;
  --button-color: #E7A7A7;
  --accent-color: #C65A5A;
}

/* ===========================
言語切り替え
=========================== */
.language-switcher {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-color);
  font-weight: bold;
}


/* ===========================
カテゴリナビゲーション
=========================== */
.top-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--top-categories-color, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
  border-radius: 16px;
  margin: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.category-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  color: var(--text-color);
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  color: var(--text-color);
}

.category-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 選択状態 */
.category-btn.active {
  background: var(--accent-color);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}

/* ===========================
横並びフルカテゴリナビ
=========================== */
.sticky-menu.horizontal {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  background-color: #0078D7;
  padding: 0.5rem;
  gap: 0.6rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* カテゴリボタン部分 */
.sticky-menu.horizontal summary {
  list-style: none;
  display: inline-block;
  background-color: rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 1rem;
}

.sticky-menu.horizontal summary:hover {
  background-color: rgba(255,255,255,0.3);
}

.sticky-menu.horizontal summary::-webkit-details-marker {
  display: none;
}

/* プルダウン領域 */
.sticky-menu.horizontal ul {
  position: absolute;
  background: #fff;
  color: #0078D7;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  min-width: 180px;
  transform: translateY(0.2rem);
}

.sticky-menu.horizontal li {
  margin: 0;
}

.sticky-menu.horizontal a {
  display: block;
  color: #0078D7;
  text-decoration: none;
  font-weight: bold;
  padding: 0.4rem 1rem;
  transition: background 0.2s ease;
}

.sticky-menu.horizontal a:hover {
  background-color: #f0f6ff;
}

/* 開閉アニメーション */
.sticky-menu.horizontal details[open] ul {
  animation: dropdownFade 0.25s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
メイン要素
=========================== */
body {
  font-family: 'Helvetica', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

header {
  background-color: var(--header-color);
  color: var(--text-color);
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  overflow-x: auto;     /* 横スクロール許可 */
  white-space: nowrap;    /* 折り返し防止 */
  scrollbar-width: thin;  /* スクロールバーを細く */
}

nav ul::-webkit-scrollbar {
  height: 6px;
}
nav ul::-webkit-scrollbar-thumb {
  background: rgba(0, 120, 215, 0.5);
  border-radius: 3px;
}

nav ul li {
  margin: 0 0.5rem;
  flex: 0 0 auto; /* アイテム幅を固定してスクロールしやすく */
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

/* ===========================
カードレイアウト
=========================== */
.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2rem;
}

/* 選択中サブカテゴリ見出し */
.selected-subcategory-title {
  text-align: center;
  margin: 1rem 0 0.5rem;
  font-size: 1.25rem;
  color: var(--accent-color);
}

.selected-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.selected-clear-btn {
  background: #f8f9fa;
  border: 1px solid #adb5bd;
  color: #495057;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all .2s ease;
}
.selected-clear-btn:hover {
  background: #e9ecef;
}

.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 1rem;
  padding: 1rem;
  width: 300px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.2s ease;
}

.card.show {
  opacity: 1;
  transform: translateY(0);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card button {
  background-color: var(--button-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.card.fade-out {
  opacity: 0;
  pointer-events: none;
}

.card.fade-in {
  opacity: 1;
}


img {
  width: 80px;
  height: 80px;
  border-radius: 5%;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: #eee;
  font-size: 0.8rem;
}



.filter-buttons {
  text-align: center;
  margin-top: 1rem;
}
/* ===========================
フィルターボタン
=========================== */
.filter-btn {
  width: 25rem;       /* 好みの幅に調整 */
  background-color: #fff;
  border: 2px solid #0078D7;
  color: #0078D7;
  padding: 0.6rem 1.2rem;
  margin: 0.3rem;
  cursor: pointer;
  border-radius: 9999px;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: inline-block;
  text-decoration: none;
}
/* ホバー時 */
.filter-btn:hover {
  background-color: #0078D7;
  color: #fff;
  transform: translateY(-2px);
}

/* 選択中のボタン */
.filter-btn.active {
  background-color: #0078D7;
  color: #fff;
  border-color: #005bb5;
  box-shadow: 0 4px 8px rgba(0,120,215,0.3);
  transform: translateY(-2px);
}


/* スマホ対応 */
@media (max-width: 700px) {
  #overlay-content { width: 95vw; }
  .top-categories {
    margin: 0.5rem;
    padding: 0.8rem;
    gap: 0.6rem;
  }
  
  .category-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 20px;
  }
  
  .sticky-menu.horizontal {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .sticky-menu.horizontal summary {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }
}