@charset "UTF-8";
/* =====================
*
カテゴリー検索モーダル、および検索モーダルのカテゴリー検索エリア
*
=====================*/

/* 検索コンテナに表示しているカテゴリ検索用 */
.category-tags-container {
  max-width: 420px;
  min-height: 34px;
  overflow: hidden;
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.category-tags {
  justify-content: center;
  padding: 0 12px;
  min-height: 34px;
  border-radius: 16px;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
  scroll-snap-type: x mandatory;
  position: relative;
}

.category-tags::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 4px;
  width: 20px;
  pointer-events: none;
}

.category-tags::-webkit-scrollbar {
  display: none;
}

/* カテゴリータグの基本スタイル */
.category-tag {
  padding: 6px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
  scroll-snap-align: start;
  position: relative;
  margin: 2px 0;
  box-sizing: border-box;
}

/* ホバー時 */
.category-tag:hover,
.category-tag.more-btn:hover {
  background-color: var(--primary-color);
  /* マピオンのメインブルー */
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

/* セレクテッド時 */
.category-tag.selected {
  background-color: var(--secondary-color);
  /* マピオンのリンクブルー */
  color: white;
  border-color: var(--secondary-color);
  font-weight: 600;
  transform: translateY(-1px);
}

.category-tag.more-btn {
  cursor: pointer;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ボタン押した時の動作 */
.category-tag:active,
.category-tag.more-btn:active {
  transform: translateY(1px);
}

/* アイコンとボタンのスタイル */
.category-tag i {
  margin-right: 6px;
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* ルート検索モード時に非表示 */
.search-container.route-search-mode-active .category-tags {
  display: none;
}

/* カテゴリー検索モーダル */
.category-search-modal-overlay {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.category-search-modal {
  position: relative;
  background-color: var(--bg-color);
  margin: 20px auto;
  padding: 20px 0;
  width: 90%;
  height: 100%;
  max-width: 800px;
  max-height: calc(100vh - 120px);
  border-radius: 4px;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.category-search-modal-close {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
  transition: color 0.3s ease;
  width: 50px;
  height: 50px;
}

.category-search-modal-close:hover {
  color: var(--primary-color);
}

.category-search-sections {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-left: 20px;
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.category-search-section h3 {
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--primary-color);
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
}

.category-search-section h3 i {
  width: 20px;
  height: 20px;
  color: var(--primary-color);
  margin-right: 8px;
}

.category-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.category-search-item {
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-search-item:hover {
  background-color: var(--hover-bg);
}

/* === サイズ別の指定 === */

@media (max-width: 768px),
(hover: none) and (pointer: coarse) {
  .category-tags-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-bottom: 4px;
    overflow: visible;
  }

  .category-tag {
    padding: 8px 12px;
    min-height: 30px;
    max-height: 30px;
    border-radius: 18px;
    -webkit-tap-highlight-color: transparent;
  }

  /* モバイルでのセレクテッド状態を強化 */
  .category-tag.selected {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
  }

}