/* 改善されたサイドバースタイル */
.gift-sidebar {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 20px;
  transition: all 0.3s ease;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.sidebar-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background-color: #4caf50;
  border-radius: 2px;
}

/* フォーム要素のスタイル改善 */
.gift-filter-form select,
.gift-filter-form input[type="number"],
.gift-filter-form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  font-size: 14px;
  background-color: #f8fafc;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.gift-filter-form select:focus,
.gift-filter-form input:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
  outline: none;
  background-color: #ffffff;
}

/* 検索タイプのラジオボタン改善 */
.search-type {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  gap: 20px;
}

.search-type .radio-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  padding-left: 28px;
}

.search-type .radio-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.search-type .radio-label span {
  position: relative;
  color: #4a5568;
}

.search-type .radio-label input:checked + span {
  color: #2c3e50;
  font-weight: 600;
}

.search-type .radio-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-type .radio-label input:checked + span::after {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4caf50;
}

.search-type .radio-label:hover::before {
  border-color: #4caf50;
}

.search-type .radio-label input:checked ~ ::before {
  border-color: #4caf50;
}

.search-type .radio-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.search-type .radio-label span {
  position: relative;
  color: #4a5568;
}

.search-type .radio-label input:checked + span {
  color: #2c3e50;
  font-weight: 600;
}

.search-type .radio-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-type .radio-label input:checked + span::after {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4caf50;
}

.search-type .radio-label:hover::before {
  border-color: #4caf50;
}

.search-type .radio-label input:checked ~ ::before {
  border-color: #4caf50;
}

/* 折りたたみボタンのスタイル改善 */
.collapsible-toggle {
  background: linear-gradient(to right, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
  margin: 18px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.collapsible-toggle:hover {
  background: linear-gradient(to right, #f1f5f9, #e2e8f0);
  color: #334155;
}

.collapsible-toggle::after {
  content: "\f107"; /* FontAwesomeのアイコン（下向き矢印） */
  font-family: "Font Awesome 5 Free";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease, color 0.3s ease;
  font-size: 18px;
  color: #64748b;
}

.collapsible-toggle:hover::after {
  color: #475569;
}

.collapsible-toggle.active {
  background: linear-gradient(to right, #e2e8f0, #cbd5e0);
  border-color: #cbd5e0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.collapsible-toggle.active::after {
  transform: translateY(-50%) rotate(180deg);
  color: #334155;
}

/* 検索ボタンのスタイル改善 */
.search-button {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  margin-top: 24px;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.25);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(76, 175, 80, 0.35);
}

.search-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.search-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
}

.search-button:hover::before {
  left: 100%;
}

.gsearch-icon {
  font-size: 18px;
}

/* 並び替えボタンのスタイル改善 */
.sort-button {
  background: linear-gradient(135deg, #3498db, #2073b3);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.25);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.sort-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(52, 152, 219, 0.35);
}

.sort-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.sort-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
}

.sort-button:hover::before {
  left: 100%;
}

/* Select2カスタマイズ */
.select2-container {
  width: 100% !important;
  margin-bottom: 15px;
}

.select2-container--default .select2-selection--single {
  height: 42px;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  background-color: #f8fafc;
  padding: 6px 0;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 30px;
  padding-left: 12px;
  color: #4a5568;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px;
  right: 10px;
}

.select2-dropdown {
  border: 1px solid #e0e6ed;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.select2-search__field {
  padding: 10px !important;
  border: 1px solid #e0e6ed !important;
  border-radius: 4px !important;
}

.select2-results__option {
  padding: 10px 12px;
  font-size: 14px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #4caf50;
}

/* レスポンシブ対応 - スマホ表示時のギャップを縮める */
@media screen and (max-width: 768px) {
  .gift-sidebar {
    padding: 12px 10px; /* 左右上下のパディングを縮小 */
  }

  .sidebar-title {
    font-size: 18px; /* 元のフォントサイズを維持 */
    margin-bottom: 12px; /* タイトル下の余白を縮小 */
  }

  .sidebar-title::after {
    bottom: -6px; /* 下線の位置を調整 */
    width: 30px; /* 下線の幅を縮小 */
  }

  .gift-filter-form select,
  .gift-filter-form input[type="number"],
  .gift-filter-form input[type="text"] {
    padding: 8px 10px;
    font-size: 14px; /* 元のフォントサイズを維持 */
    margin-bottom: 8px; /* 入力フォーム間の余白を縮小 */
  }

  .search-type {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    gap: 20px;
  }

  .search-type .radio-label {
    font-size: 14px;
    padding-left: 28px;
  }

  .search-type .radio-label::before {
    width: 16px; /* ラジオボタンの円を小さく */
    height: 16px;
  }

  .search-type .radio-label input:checked + span::after {
    width: 8px; /* チェック時の円を小さく */
    height: 8px;
    left: -22px; /* 位置調整 */
  }

  .collapsible-toggle {
    padding: 10px 12px; /* 折りたたみボタンのパディングを縮小 */
    font-size: 14px; /* 元のフォントサイズを維持 */
    margin: 10px 0; /* 上下マージンを縮小 */
  }

  .collapsible-toggle::after {
    font-size: 18px; /* 元のフォントサイズを維持 */
  }

  .search-button,
  .sort-button {
    padding: 10px 12px; /* ボタンのパディングを縮小 */
    font-size: 15px; /* 元のフォントサイズを維持 */
    margin-top: 15px; /* 上部マージンを縮小 */
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.2); /* 影を少し小さく */
  }

  .gsearch-icon {
    font-size: 18px; /* 元のフォントサイズを維持 */
  }

  /* Select2カスタマイズのレスポンシブ対応 */
  .select2-container {
    margin-bottom: 8px; /* 下部マージンを縮小 */
  }

  .select2-container--default .select2-selection--single {
    height: 36px; /* 高さを縮小 */
  }

  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px; /* 行の高さを調整 */
    font-size: 14px; /* 元のフォントサイズを維持 */
  }

  .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px; /* 矢印部分の高さを調整 */
  }

  .select2-results__option {
    padding: 8px 10px; /* オプションのパディングを縮小 */
    font-size: 14px; /* 元のフォントサイズを維持 */
  }
}

/* より小さいスマホ画面用の追加調整 */
@media screen and (max-width: 480px) {
  .gift-sidebar {
    padding: 10px 8px; /* さらにパディングを縮小 */
  }

  .sidebar-title {
    margin-bottom: 10px;
  }

  .gift-filter-form select,
  .gift-filter-form input[type="number"],
  .gift-filter-form input[type="text"] {
    padding: 7px 8px;
    margin-bottom: 6px;
  }

  /* ラジオボタン関連のスタイルは変更しない */

  .collapsible-toggle {
    padding: 8px 10px;
    margin: 8px 0;
  }

  .search-button,
  .sort-button {
    padding: 8px 10px;
    gap: 8px;
  }
}