/* ======================================================
   Compare List - Full Integrated Styles (v3.1.0)
   カードデザイン、検索UI（Ajax対応）、ページネーションの統合
   ====================================================== */

/* ------------------------------------------------------
 * 1. 業者カード（Card UI）
 * ------------------------------------------------------ */
.custom-review-card {
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 1.2em;
  background: #fff;
  overflow: hidden;
}

.custom-review-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0.9em 1em;
  cursor: pointer;
}

.custom-review-card .head-left {
  min-width: 0;
  flex: 1;
}

.custom-review-card h3.company-name {
  font-size: 1.1em;
  margin: 0 0 0.25em;
  line-height: 1.3;
  font-weight: 700;
  color: #333;
}

.custom-review-card .stars {
  font-size: 0.9em;
  color: #f39c12; /* 黄色 */
}

.custom-review-card .google-review-count {
  font-size: 0.85em;
  color: #666;
  margin-left: 0.5em;
}

.custom-review-card .toggle-btn {
  display: flex !important;
  margin-left: auto;
  font-size: 1.25em;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 1.8em;
  height: 1.8em;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.custom-review-card .addr-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em;
  color: #333;
  font-size: 0.88em;
  line-height: 1.4;
  margin-top: 4px;
}

.custom-review-card .card-body {
  padding: 0 1em 1em;
  border-top: none;
}

.custom-review-card .phone {
  font-size: 0.95em;
  margin: 0.6em 0 0.4em;
  color: #555;
}

.custom-review-card .summary-box {
  background: #f4f4f4;
  padding: 0.6em 0.8em;
  border-radius: 4px;
  font-size: 0.95em;
  line-height: 1.6;
  margin-top: 0.4em;
}

.custom-review-card .detail-link {
  display: inline-block;
  margin-top: 0.6em;
  font-weight: 700;
  color: #06c;
  text-decoration: none;
  font-size: 0.95em;
}

/* SP時のカード調整 */
@media (max-width: 768px) {
  .custom-review-card .toggle-btn {
    display: none !important;
  }
  .custom-review-card .addr-inline {
    display: block !important;
    margin-top: 0.2em;
    line-height: 1.4;
  }
  .custom-review-card .postal-inline {
    display: block !important;
    margin: 0 !important;
    line-height: 1.2;
  }
  .custom-review-card .address-inline {
    display: block !important;
    margin: 0 !important;
    line-height: 1.2;
  }
}

/* ------------------------------------------------------
 * 2. 検索・フィルタUI（新デザイン統合版）
 * ------------------------------------------------------ */
.compare-filters-container {
  background: #f4faec;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 25px;
  box-sizing: border-box;
  min-height: 120px;
}

.compare-list-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-row {
  display: flex;
  gap: 6px;
  width: 100%;
  align-items: stretch;
}

.pref-select-wrap {
  flex: 0 0 220px; /* 都道府県を大きく確保 */
}

.pref-select-wrap select {
  width: 100%;
  background: #fff !important;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0 10px;
  height: 42px; /* Ajax版の高さに統一 */
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

.sort-buttons-wrap {
  display: flex;
  flex: 1;
  gap: 4px;
}

.sort-btn {
  flex: 1;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 20px; /* 丸みを20pxに設定 */
  padding: 0 2px;
  font-size: 11px;
  cursor: pointer;
  color: #555;
  height: 42px;
  white-space: nowrap;
  transition: none;
  outline: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sort-btn:hover {
  background: #f7f7f7;
}

.sort-btn.active {
  background: #7ab63d;
  color: #fff;
  border-color: #7ab63d;
  font-weight: bold;
}

.search-input-wrap {
  flex: 1;
}

.search-input-wrap input {
  width: 100%;
  background: #fff !important;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0 12px;
  height: 42px;
  font-size: 14px;
  box-sizing: border-box;
}

.search-submit-btn {
  background: #f09f4d;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 20px;
  height: 42px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
}

.clear-btn {
  background: #888;
  color: #fff;
  text-decoration: none;
  padding: 0 12px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

/* SP時のフィルタUI調整 */
@media (max-width: 767px) {
  .filter-row {
    flex-wrap: wrap;
  }
  .pref-select-wrap {
    flex: 1 0 100%;
  }
  .sort-buttons-wrap {
    flex: 1 0 100%;
  }
  .sort-btn {
    font-size: 12px;
  }
}

/* ------------------------------------------------------
 * 3. ページネーション（Pagination）
 * ------------------------------------------------------ */
.compare-pagination {
  margin: 2em 0;
  text-align: center;
}

.compare-pagination ul {
  display: inline-flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
}

.compare-pagination li {
  display: inline-block;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
}

.compare-pagination a,
.compare-pagination span {
  display: inline-block;
  min-width: 32px;
  height: 30px;
  padding: 10px;
  line-height: 4px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  color: #333;
  background: #fff;
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
}

.compare-pagination a:hover {
  background: #f0f0f0;
}

.compare-pagination .current {
  background: #4caf50;
  color: #fff;
  border-color: #4caf50;
  font-weight: bold;
}

@media (max-width: 768px) {
  .compare-pagination ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .compare-pagination a,
  .compare-pagination span {
    min-width: 26px;
    height: 28px;
    line-height: 28px;
    font-size: 12px;
  }
}

/* ------------------------------------------------------
 * 4. Ajax用アニメーション・オーバーレイ
 * ------------------------------------------------------ */
.ajax-fade {
  animation: compareFadeIn 0.3s ease;
}

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

/* ★ここを修正：min-height を 200px から auto に変更 */
.compare-list-inner {
  position: relative;
  min-height: auto; /* ここを auto にすることで余白が消えます */
}

.compare-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  z-index: 10;
  display: none;
  border-radius: 8px;
}
/* 市区町村ページ用のUI調整 */
.filter-row.is-area-page .sort-buttons-wrap {
  flex: 1 1 100%;
}

.filter-row.is-area-page .sort-btn {
  font-size: 13px; /* 都道府県がない分、少し文字を大きくして押しやすく */
}

/* 0件時のガイダンスデザイン */
.no-results-guidance {
  padding: 20px 0;
  margin-top: 20px;
}

.no-results-heading {
  font-size: 1.25em;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.no-results-text {
  font-size: 0.95em;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* 都道府県へのリンクボックス */
.parent-link-box {
  margin: 20px 0;
  text-align: center;
}

.parent-link-box a {
  display: block;
  border: 2px solid #7ab63d;
  color: #7ab63d;
  padding: 15px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background 0.3s;
  background-color: #fff;
}

.parent-link-box a:hover {
  background: #f4faec;
}

/* CTA部分の余白 */
.no-results-cta {
  margin-top: 30px;
}
