/* PC版絞り込み専用ページ - Figmaデザイン完全準拠 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #F2F2F2;
  color: #333333;
  line-height: 1.6;
}

/* レスポンシブ表示制御 */
.pc-only {
  display: inline;
}

.mobile-only {
  display: none;
}

.page-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* メインタイトルセクション */
.main-title-section {
  text-align: center;
  margin-bottom: 0px;
  background-color: #F2F2F2;
  padding: 40px 0;
}

.main-title {
  font-size: 24px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 20px;
  line-height: 1.4;
}

.sub-title {
  font-size: 18px;
  font-weight: 400;
  color: #333333;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* フィルターコンテナ */
.filter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

/* 全体フィルターボックス */
.filter-box {
  background-color: #FFFFFF;
  border: 3px solid #000000;
  width: 100%;
}

/* フィルターセクション */
.filter-section {
  display: flex;
  align-items: flex-start;
  padding: 16px 0px;
  border-bottom: 1px solid #000000;
  margin: 0 20px;
}

/* 関西版アコーディオンスタイル */
.prefecture-section {
  margin-bottom: 15px;
}

.prefecture-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
}

.prefecture-header:hover {
  background-color: #e9ecef;
}

.prefecture-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
}

.prefecture-checkbox {
  margin-right: 8px;
}

.toggle-btn {
  background: none;
  border: none;
  color: #007bff;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.toggle-btn:hover {
  background-color: #e7f3ff;
}

.area-list {
  display: none;
  padding: 16px;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 4px 4px;
}

.city-section {
  margin-bottom: 20px;
}

.city-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 12px;
  cursor: pointer;
}

.city-checkbox {
  margin-right: 8px;
}

.ward-list,
.other-cities,
.gun-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 12px;
  margin-left: 20px;
}

.checkbox-item {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 6px;
}

.filter-section:last-child {
  border-bottom: none;
}

/* セクションタイトル部分（左側） */
.section-header {
  width: 150px;
  flex-shrink: 0;
  position: relative;
  margin-right: 30px;
  padding-right: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  line-height: 1.3;
}

.help-icon {
  width: 24px;
  height: 24px;
  background-color: #6782AE;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #FFFFFF;
  position: static;
  flex-shrink: 0;
  cursor: pointer;
}

.help-icon:hover {
  background-color: #5a6fa1;
}

/* セクションコンテンツ部分（右側） */
.section-content {
  flex: 1;
}

/* チェックボックスグリッド */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
  width: 100%;
}

.checkbox-item {
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  color: #333333;
  cursor: pointer;
  line-height: 1.2;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1px solid #CCCCCC;
  border-radius: 2px;
  margin-right: 8px;
  appearance: none;
  background-color: #FFFFFF;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
  background-color: #6782AE;
  border-color: #6782AE;
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: bold;
}

/* スライダーセクション */
.slider-section {
  padding: 0;
}

.slider-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

/* スライダーラベル */
.slider-labels {
  position: relative;
  width: 400px;
  height: 40px;
  margin: 0 30px 10px 30px;
  overflow: visible;
}

.slider-label {
  position: absolute;
  background-color: #333333;
  color: #FFFFFF;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  top: 0;
  min-width: max-content;
}

#budget-min {
  left: 0%;
  transform: translateX(-50%);
}

#budget-max {
  right: 0 !important;
  left: auto !important;
  transform: translateX(0%) !important;
}

#price-min {
  left: 0%;
  transform: translateX(-50%);
}

#price-max {
  right: 0 !important;
  left: auto !important;
  transform: translateX(0%) !important;
}

#unit-price-min {
  left: 0%;
  transform: translateX(-50%);
}

#unit-price-max {
  right: 0 !important;
  left: auto !important;
  transform: translateX(0%) !important;
}


.slider-label::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #333333;
}

/* デュアルレンジスライダー */
.dual-range-slider {
  position: relative;
  width: 400px;
  height: 20px;
  margin: 0 30px;
}

.dual-range-slider input[type="range"] {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  appearance: none;
  pointer-events: none;
  outline: none;
  top: 7px;
}

.dual-range-slider input[type="range"]::-webkit-slider-track {
  width: 100%;
  height: 6px;
  background: transparent;
  border-radius: 3px;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: #6782AE;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  pointer-events: all;
  position: relative;
  z-index: 2;
  margin-top: -7px;
}

.dual-range-slider input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  background: transparent;
  border-radius: 3px;
  border: none;
}

.dual-range-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #6782AE;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  pointer-events: all;
}

/* スライダーベーストラック */
.dual-range-slider::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 6px;
  background: #E0E0E0;
  border-radius: 3px;
  z-index: 1;
}

/* スライダーの選択範囲 */
.dual-range-slider .slider-track {
  position: absolute;
  height: 6px;
  background: #6782AE;
  border-radius: 3px;
  top: 7px;
  pointer-events: none;
  z-index: 1;
}

/* ボタンセクション */
.button-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 0 0;
  width: 400px;
  margin: 0 auto;
}

/* 下部固定検索ボタン */
.fixed-search-button {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 15px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  justify-content: center;
}

.fixed-search-button.show {
  transform: translateY(0);
}

.fixed-search-button .search-button {
  width: 400px;
  max-width: calc(100vw - 40px);
  margin: 0;
  background-color: #FF7C00;
  border: 1px solid #FF7C00;
  border-radius: 4px;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(255, 124, 0, 0.3);
}

.fixed-search-button .search-button:hover {
  background-color: #e66a00;
  border-color: #e66a00;
  box-shadow: 0 4px 12px rgba(255, 124, 0, 0.4);
}

.search-button {
  background-color: #FF7C00;
  border: 1px solid #FF7C00;
  border-radius: 4px;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.search-button:hover {
  background-color: #e66a00;
  border-color: #e66a00;
}

.nav-button {
  background-color: #FFFFFF;
  border: 1px solid #CCCCCC;
  border-radius: 4px;
  color: #333333;
  font-size: 16px;
  font-weight: 400;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.nav-button:hover {
  background-color: #f8f9fa;
}

/* ヘルプモーダル */
.help-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.help-modal-content {
    background-color: #FFFFFF;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.help-modal-header {
  background-color: #F8F8F8;
  padding: 20px 30px;
  border-bottom: 2px solid #333333;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  position: relative;
}

.help-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #333333;
  text-align: center;
  margin: 0;
}

.help-modal-close {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 300;
  color: #666666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-modal-close:hover {
  color: #333333;
}

.help-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 80px);
}

.help-item {
  margin-bottom: 25px;
}

.help-item:last-child {
  margin-bottom: 0;
}

.help-item-title {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
}

.help-item-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
}

.help-modal-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 20px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.help-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 20px 0 10px 0;
}

.help-section-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* スクロールバーのスタイル */
.help-modal-body::-webkit-scrollbar {
    width: 8px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* iPad・タブレット最適化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .filter-section {
    padding: 20px;
  }

  .section-header {
    margin-bottom: 0px;
  }

  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 12px;
  }

  .checkbox-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-width: 0;
  }

  .dual-range-slider,
  .slider-labels {
    width: 400px;
  }
  .slider-labels {
    margin: 0 30px 10px 30px;
  }

  .dual-range-slider {
    margin: 0 30px;
  }}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .page-container {
    padding: 20px 0;
    width: 100%;
  }

  .filter-box {
    width: 100%;
    margin: 0;
  }

  .filter-section {
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 20px;
  }

  .section-header {
    min-width: auto;
    margin-right: 0;
    margin-bottom: 0px;
    padding-right: 0;
  }

  .help-icon {
    position: static;
    margin-left: 10px;
    display: inline-flex;
  }

  .dual-range-slider,
  .slider-labels {
    width: 100%;
    max-width: 400px;
  }

      .help-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }

    .help-modal-header {
        padding: 15px 20px;
    }

    .help-modal-body {
        padding: 20px;
        max-height: calc(95vh - 70px);
    }
}

@media (max-width: 768px) {
  /* レスポンシブ表示制御 */
  .pc-only {
    display: none;
  }

  .mobile-only {
    display: inline;
  }

  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
  }

  .checkbox-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-width: 0;
  }

  .main-title-section {
    text-align: center;
    margin-bottom: 0px;
    background-color: #F2F2F2;
    padding: 14px 0;
  }

  .main-title {
    font-size: 20px;
  }

  .sub-title {
    font-size: 16px;
  }

  .section-header {
    width: 100%;
  }

  .button-section {
    width: 100%;
    max-width: 400px;
  }

  .filter-section {
    padding: 20px;
  }

  .dual-range-slider,
  .slider-labels {
    width: 300px;
  }

  .slider-labels {
    margin: 0 20px 10px 20px;
  }

  .dual-range-slider {
    margin: 0 20px;
  }

  .slider-label {
    position: absolute;
    background-color: #333333;
    color: #FFFFFF;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    top: 10px;
    min-width: max-content;
  }

  #budget-min, #price-min {
    left: 0%;
    transform: translateX(-50%);
  }

  #budget-max, #price-max {
    right: 0 !important;
    left: auto !important;
    transform: translateX(0%) !important;
  }
}

@media (max-width: 480px) {
  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 8px;
  }

  .checkbox-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-width: 0;
  }

  .checkbox-label {
    font-size: 13px;
  }

  .page-container {
    padding: 20px 10px;
  }

  .filter-box {
    margin: 0;
  }

  .filter-section {
    padding: 15px;
    margin: 0;
  }

  .section-header {
    margin-bottom: 0px;
  }

  .dual-range-slider,
  .slider-labels {
    width: 250px;
  }

  .slider-labels {
    margin: 0 15px 10px 15px;
  }

  .dual-range-slider {
    margin: 0 15px;
  }

  #budget-min, #price-min {
    left: 0%;
    transform: translateX(-50%);
  }

  #budget-max, #price-max {
    right: 0 !important;
    left: auto !important;
    transform: translateX(0%) !important;
  }
}

/* ネストしたチェックボックス（注文住宅・規格住宅）のスタイル */
.checkbox-label input#ready-house {
  margin: 0 3px;
  vertical-align: middle;
  transform: scale(0.9);
}

/* JavaScriptによる動的設定を強制的に上書き - 最優先 */
.slider-label[id="budget-max"],
.slider-label[id="price-max"],
.slider-label[id="unit-price-max"] {
  right: 0 !important;
  left: auto !important;
  transform: translateX(0%) !important;
}

/* インラインstyleを完全に上書き */
span#budget-max[style],
span#price-max[style],
span#unit-price-max[style] {
  right: 0 !important;
  left: auto !important;
  transform: translateX(0%) !important;
}

/* 注文住宅・規格住宅のラベル内配置調整 */

/* ツールチップスタイル */
.house-type-tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  white-space: nowrap;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* 下部固定ボタンのアニメーション */
@keyframes slideUpBounce {
  0% { transform: translateY(100%); }
  70% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

/* レスポンシブ対応：下部固定ボタン */
@media (max-width: 768px) {
  .fixed-search-button {
    padding: 12px 15px;
  }

  .fixed-search-button .search-button {
    width: 100%;
    max-width: calc(100vw - 30px);
    font-size: 15px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .fixed-search-button {
    padding: 10px 12px;
  }

  .fixed-search-button .search-button {
    width: 100%;
    max-width: calc(100vw - 24px);
    font-size: 14px;
    padding: 10px;
  }
}

/* 320px以下での1列レイアウト（施工可能エリア・会社所在地以外） */
@media (max-width: 320px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  /* 施工可能エリアと会社所在地は2列を維持 */
  .filter-section:nth-child(1) .checkbox-grid,
  .filter-section:nth-child(2) .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 長い項目のletter-spacing調整 */
.checkbox-label input[value="concreteprefab"] + *,
.checkbox-label input[value="superwall"] + * {
  letter-spacing: -1px;
}
