/**
 * カスタム検索フォームのスタイル - モダンバージョン
 */

 .cfs-search-container {
  max-width: 100%;
  margin: 20px 0;
  padding: 25px;
  background-color: #FFCB3A;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.cfs-search-form {
  display: flex;
  flex-direction: column;
  /* gap: 25px; */
}

/* 検索タイプの選択 - スイッチボタン */
.search-type-toggle {
  display: flex;
  align-items: center;
}

.search-toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin-left: 10px;
}

.search-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.search-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.search-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .search-toggle-slider {
  background-color: #FF6F3A;
}

input:focus + .search-toggle-slider {
  box-shadow: 0 0 1px #FF6F3A;
}

input:checked + .search-toggle-slider:before {
  transform: translateX(30px);
}

.search-toggle-icons {
  display: flex;
  justify-content: space-between;
  padding: 0 5px;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

.search-toggle-icons span:first-child {
  position: relative;
  left: 4px;
}

.search-toggle-icons span:last-child {
  position: relative;
  right: 4px;
}

/* キーワード検索エリア */
.keyword-search-area {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background-color: #fff;
  margin-bottom: 1em;
}

.keyword-search {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keyword-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.keyword-search label {
  font-weight: 600;
  color: #333;
  min-width: 80px;
}

.keyword-search input[type="text"] {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.keyword-search input[type="text"]:focus {
  border-color: #FF6F3A;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
  outline: none;
}

.keyword-search .additional-keyword {
  display: none;
}

/* フィルターセクション */
.filter-sections {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.attributes-section {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 15px;
  background-color: #fff;
  /* margin-bottom: 20px; */
}

.attributes-section h3 {
  margin-top: 0;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

/* 属性グループのコンテナ */
.attribute-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* アコーディオンスタイル */
.attribute-category {
  margin-bottom: 5px;
  width: 100%;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}

.attribute-category-header {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #f9f9f9;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.attribute-category-header:hover {
  background-color: #f0f0f0;
}

.attribute-category-title {
  font-weight: 600;
  color: #555;
  font-size: 15px;
  flex: 1;
}

.attribute-category-toggle {
  width: 20px;
  height: 20px;
  position: relative;
  transition: transform 0.3s;
}

.attribute-category-toggle:before,
.attribute-category-toggle:after {
  content: '';
  position: absolute;
  background-color: #666;
  transition: transform 0.3s ease;
}

.attribute-category-toggle:before {
  top: 9px;
  left: 2px;
  width: 16px;
  height: 2px;
}

.attribute-category-toggle:after {
  top: 2px;
  left: 9px;
  width: 2px;
  height: 16px;
}

.attribute-category.active .attribute-category-toggle:after {
  transform: rotate(90deg);
}

.attribute-content {
  padding: 15px;
  border-top: 1px solid #f0f0f0;
  background-color: #ffffff;
}

.attribute-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ボタンスタイルのチェックボックス */
.attribute-button {
  position: relative;
}

.attribute-button input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.attribute-button label {
  display: inline-block;
  padding: 8px 14px;
  font-size: 13px;
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}

.attribute-button input[type="checkbox"]:checked + label {
  background-color: #FF6F3A;
  color: white;
  border-color: #FF6F3A;
}

.attribute-button label:hover {
  background-color: #e9e9e9;
}

.attribute-button input[type="checkbox"]:checked + label:hover {
  background-color: FFE9C39;
}

/* 検索アクション */
.search-actions {
  display: flex;
  gap: 12px;
  margin-top: 15px;
}

.search-button {
  padding: 12px 24px;
  background-color: #FF6F3A;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.search-button:hover {
  background-color: FFE9C39;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reset-button {
  padding: 12px 24px;
  background-color: #f5f5f5;
  color: #555;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.reset-button:hover {
  background-color: #e9e9e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .attribute-categories {
      grid-template-columns: 1fr;
  }
  
  .keyword-search-area {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .keyword-search input[type="text"] {
      width: 100%;
  }
  
  .search-actions {
      flex-direction: column;
  }
  
  .search-button,
  .reset-button {
      width: 100%;
  }
}

/* ============================================ */
/* 検索履歴表示 (最近/人気) スタイル          */
/* ============================================ */

.cfs-search-term-list {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f9f9f9; /* 背景色を少し変えるなど */
  border: 1px solid #eee;
  border-radius: 6px;
}

.cfs-search-term-list h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.cfs-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px; /* タグ間の隙間 */
}

.cfs-search-tag {
  display: inline-block; /* display: flex; から変更 */
  background-color: #f0f0f0; /* タグの背景色 */
  border: 1px solid #e0e0e0;
  border-radius: 15px; /* 角丸 */
  padding: 5px 12px; /* 内側の余白 */
  font-size: 13px;
  line-height: 1.4;
  transition: background-color 0.2s, border-color 0.2s;
}

.cfs-search-tag a {
  text-decoration: none;
  color: #555; /* リンクの色 */
}

.cfs-search-tag:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}

.cfs-search-tag:hover a {
  color: #333;
}

.cfs-search-count {
  font-size: 0.9em;
  color: #777;
  margin-left: 4px;
}