/* ===== 条件変更コンテナ ===== */
.change_container {
  width: 100%;
  padding: 0 var(--size-16) var(--size-16);
  position: relative;
  background: #ebebeb;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: margin-top 0.3s ease, transform 0.3s ease;
}

.change_container.search_ranking {
  padding-top: var(--size-16);
}

.change_trigger {
  width: min(480px, 100%);
  height: var(--size-64);
  padding: var(--size-16);
  border-radius: var(--size-4);
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--colorImportantPink);
  background-position: right var(--size-12) center;
  background-size: var(--size-24);
  color: white;
  cursor: pointer;
  margin: 0 auto;
  position: relative;
  font-weight: var(--fwSemiBold);
}

.change_trigger::after {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 1;
  border-radius: var(--size-4);
}

/* ===== フローティング絞り込みボタン ===== */
.floating_filter_btn {
  width: 100%;
  position: fixed;
  bottom: -90px;
  left: 0;
  z-index: 1000;
  padding: var(--size-16);
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating_filter_btn.show {
  bottom: 0;
}

.floating_filter_btn .change_trigger {
  width: min(480px, 100%);
  height: var(--size-64);
  margin: 0 auto;
  border-radius: var(--size-4);
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--colorImportantPink);
  color: white;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-size: var(--size-16);
}

.floating_filter_btn .change_trigger:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   フローティングバーに「条件の絞り込み（ピル）＋ナビ丸ボタン3つ」
   電車=search_station / ビル=search_shop / 王冠(ダイヤ)=search_ranking
   .floating_filter_btn--nav が付いた markup にのみ適用
   ============================================ */
.floating_filter_btn--nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--size-8);
  width: min(480px, 100%);
  /* 360px以下は縮ませない（必要なら横スクロール） */
  min-width: 360px;
  left: 50%;
  transform: translateX(-50%);
}

/* 条件絞り込みピルなし版（ナビ丸ボタンのみ）：センター寄せ
   .floating_filter_btn--nav-only を併用したときに適用
   z-index は駅検索ドロップダウン（.search-results: 1001）より上に */
.floating_filter_btn--nav-only {
  justify-content: center;
  z-index: 1002;
}
.floating_filter_btn--nav .change_trigger {
  flex: 1;
  width: auto;
  min-width: var(--size-120);
  margin: 0;
  height: var(--size-56);
  padding: 0 var(--size-16);
  border-radius: 999px;
  font-size: var(--size-14);
  line-height: 1.2;
  text-align: center;
  font-weight: var(--fwSemiBold);
}
.floating_filter_btn--nav .floating_nav_btn {
  width: var(--size-56);
  height: var(--size-56);
  border-radius: 50%;
  background: white;
  border: 1px solid var(--colorImportantPink);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}
.floating_filter_btn--nav .floating_nav_btn .icon {
  width: 32px;
  height: 32px;
  background-color: var(--colorImportantPink);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.floating_filter_btn--nav .floating_nav_btn.station .icon {
  -webkit-mask-image: url(../images/icon_station.svg);
  mask-image: url(../images/icon_station.svg);
}
.floating_filter_btn--nav .floating_nav_btn.shop .icon {
  -webkit-mask-image: url(../images/icon_shop.svg);
  mask-image: url(../images/icon_shop.svg);
}
/* イチ推し（ダイヤ）：枠線を黄色に上書き（背景は親ルールで白のまま） */
.floating_filter_btn--nav .floating_nav_btn.ranking {
  border-color: var(--colorYellow);
}
.floating_filter_btn--nav .floating_nav_btn.ranking .icon {
  -webkit-mask-image: url(../images/icon_ranking.svg);
  mask-image: url(../images/icon_ranking.svg);
  width: 41px;
  height: 32px;
  transform: translateY(2px);
  /* ダイヤは黄色（イチ推し色を統一） */
  background-color: var(--colorYellow);
}

/* ポップアップオーバーレイ */
.filter_popup_overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10002;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter_popup_overlay.active {
  display: block;
  opacity: 1;
}

.filter_popup {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  width: min(768px, 100%);
  height: 100vh;
  height: 100dvh;
  background: #2f2561;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* または、より確実にするためのフォールバック */
@supports not (height: 100dvh) {
  .filter_popup {
    height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}


.filter_popup_overlay.active .filter_popup {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ヘッダー - 固定位置 */
.filter_header {
  height: var(--size-56);
  position: relative;
  padding: var(--size-16);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: var(--fwSemiBold);
}

.close_btn {
  position: absolute;
  right: var(--size-16);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: var(--size-24);
  cursor: pointer;
}

.filter_title {
  font-size: var(--size-16);
  color: white;
}

.filter_content {
  flex: 1;
  overflow-y: auto;
  background: white;
}

.filter_item {
  display: flex;
  align-items: center;
  gap: var(--size-16);
  padding: var(--size-16);
  border-bottom: solid 1px var(--colorLightGray);
}

.filter_item:last-child {
  border: none;
}


.filter_item.last_item {
  border-bottom: solid 1px var(--colorLightGray);
}


.filter_item.checkbox_filter {
  flex-direction: row;
  align-items: flex-start;
  align-items: center;
}

.filter_label {
  font-size: var(--size-14);
  min-width: var(--size-80);
  flex-shrink: 0;
  font-weight: var(--fwSemiBold);
}

.filter_select {
  appearance: none;
  height: var(--size-56);
  padding: var(--size-12);
  padding-right: var(--size-24);
  border: 1px solid var(--colorLightGray);
  border-radius: var(--size-4);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23dadbe2' stroke-width='1' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
  background-position: right var(--size-12) center;
  background-size: var(--size-24);
  transition: background-image 0.2s ease;
  text-align: center;
  font-size: var(--size-14);
  color: #374151;
  flex: 1;
}

.filter_select option {
  color: #374151;
}

#area_detail option[value="0"] {
  color: var(--colorImportantPink);
}

#area_detail:has(option[value="0"]:checked) {
  color: var(--colorImportantPink);
}

/* チェックボックスグループ */
.checkbox_group {
  display: flex;
  flex-direction: column;
  gap: var(--size-12);
  flex: 1;
  margin-top: 0;
}

.checkbox_item {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: var(--size-14);
  position: relative;
}

.checkbox_item input {
  opacity: 0;
  position: absolute;
}

.checkmark {
  width: var(--size-16);
  height: var(--size-16);
  background: white;
  border-radius: 2px;
  margin-right: var(--size-12);
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--colorLightGray);
}

.checkbox_item input:checked + .checkmark {
  background-color: var(--colorImportantPink);
  border-color: var(--colorImportantPink);
}

.checkbox_item input:checked + .checkmark:after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* フッター - 固定位置 */
.filter_footer {
  background: #2f2561;
  padding: var(--size-24) var(--size-16);
  display: flex;
  align-items: center;
  gap: var(--size-16);
  z-index: 1000;
  flex-shrink: 0;
}

.reset_btn {
  background: white;
  color: var(--colorBlack);
  border: none;
  padding: 0;
  border-radius: var(--size-4);
  font-size: var(--size-12);
  cursor: pointer;
  width: var(--size-56);
  height: var(--size-56);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 1.2;
  font-weight: var(--fwSemiBold);
}

.search_btn {
  max-width: 440px;
  height: var(--size-64);
  margin: 0 auto;
  background: var(--colorImportantPink);
  color: white;
  border: none;
  border-radius: var(--size-4);
  font-size: var(--size-18);
  cursor: pointer;
  flex: 1;
  text-align: center;
  font-weight: var(--fwSemiBold);
}

.result_count {
  width: 90px;/*ボタンが可変するので一旦固定*/
  height: var(--size-56);
  color: white;
  font-size: var(--size-12);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.result_count .text-line {
  font-size: var(--size-12);
  line-height: 1.2;
  letter-spacing: 0.2em;
  margin-bottom: 2px;
}

.result_count .number-line {
  display: flex;
  align-items: baseline;
}

.result_count .number {
  font-size: var(--size-24);
  line-height: 1;
  font-weight: var(--fwSemiBold);
}

.result_count .unit {
  font-size: var(--size-12);
  line-height: 1;
}

.filter_select optgroup {
  color: var(--colorImportantPink);
  font-size: var(--size-12);
}

.filter_select optgroup option {
  font-size: var(--size-14);
}

/* ===== エラーモーダル ===== */
.filter_error_modal_overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10003;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.filter_error_modal {
  background: white;
  border-radius: var(--size-8);
  padding: var(--size-24);
  max-width: 320px;
  width: calc(100% - var(--size-32));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.filter_error_content {
  margin-bottom: var(--size-24);
}

.filter_error_message {
  font-size: var(--size-16);
  color: var(--colorBlack);
  text-align: center;
  line-height: 1.6;
}

.filter_error_ok_btn {
  width: 100%;
  height: var(--size-48);
  background: var(--colorImportantPink);
  color: white;
  border: none;
  border-radius: var(--size-4);
  font-size: var(--size-16);
  font-weight: var(--fwSemiBold);
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.filter_error_ok_btn:hover {
  opacity: 0.9;
}