.stock-layout {
  display: grid;
  grid-template-columns: 320px 1fr; /* サイドバーの幅を広げる */
  gap: 30px;
}

.filter-section {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  align-self: start; /* コンテンツの高さに合わせる */
}

.filter-section h2 {
  margin-top: 0;
}

.filter-form .form-group {
  margin-bottom: 20px;
}

.filter-group {
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.filter-group legend {
  padding: 0 5px;
  font-weight: bold;
}

.filter-group-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap; /* 画面幅が足りない場合に折り返すようにする */
}

.filter-group-content .form-group {
  flex: 1; /* 各入力グループが均等に幅を取るようにする */
  min-width: 120px; /* 折り返した際の最小幅を確保 */
  margin-bottom: 0;
}

.filter-group-content .form-group + .form-group::before {
  content: "〜";
  color: #6c757d;
  font-weight: bold;
  align-self: flex-end; /* 下揃えにする */
  padding-bottom: 0.5em; /* ボタンや入力欄の高さと合わせる */
}
.input-with-unit {
  display: flex;
  align-items: center;
}

.input-with-unit input {
  width: 100%; /* 入力欄が利用可能な幅全体に広がるようにする */
  /* min-widthは親要素で制御するため、ここでは削除 */
}

.input-with-unit .unit {
  margin-left: 5px;
  white-space: nowrap;
}

.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 検索ボタンを追従させる */
  position: sticky;
  bottom: 20px;
  background-color: #f8f9fa; /* 背景色を指定して下のコンテンツと重ならないようにする */
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}

.pagination {
  margin-top: 30px;
  text-align: center;
}

.pagination a {
  margin: 0 5px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  text-decoration: none;
  color: #007bff;
}

.pagination a.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

@media (max-width: 992px) {
  .stock-layout {
    grid-template-columns: 1fr;
  }
}