/**
 * 美容皮膚科「施術から探す」「症状から探す」専用コンポーネント。
 *
 * design_handoff の既存パターン（.cwt-treatment-card / .cwt-filter__* /
 * .cwt-anchor-chips など）とは独立した、このページ専用の新規コンポーネント。
 * 実際にモック（Vite/React + Tailwind）をローカルで起動して確認した見た目
 * （フローティングの絞り込みカード・チップ画像タイル・絞り込み時に
 * カテゴリ見出しごと「検索結果」表示へ切り替わる構成）に合わせて実装した。
 *
 * 色は既存のテーマトークンに寄せず、モックの実際の配色（#CD9ED7 系の
 * パープルグラデーション）をそのまま採用している（プレフィックス cwt-tf）。
 */

/* ============================================================
 * セクション背景（絞り込みエリア）
 * ============================================================ */
.cwt-tf-section {
  background: #FFFFFF;
  padding: 32px 0;
}

/* ============================================================
 * 絞り込みカード本体
 * ============================================================ */
.cwt-tf {
  background: #FFFFFF;
  border: 1px solid #EAD8EE;
  border-radius: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .cwt-tf {
    padding: 32px;
  }
}

.cwt-tf__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.cwt-tf__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 18px;
  font-weight: 700;
  color: #3A223D;
  margin: 0;
}
.cwt-tf__subtitle {
  font-size: 15px;
  color: #A087A3;
  margin: 4px 0 0;
}
.cwt-tf__reset {
  display: none;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #A087A3;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.cwt-tf__reset:hover,
.cwt-tf__reset:focus-visible {
  color: #9A5FA6;
  background: #F8F1FA;
}
.cwt-tf.is-filtered .cwt-tf__reset {
  display: inline-flex;
}

/* ---- チップ（症状／施術タイプの画像タイル） ---- */
.cwt-tf__panel {
  display: none;
  padding-top: 20px;
}
.cwt-tf__panel.is-open {
  display: block;
}
.cwt-tf__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .cwt-tf__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .cwt-tf__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.cwt-tf__tile {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #EAD8EE;
  cursor: pointer;
  background: none;
  padding: 0;
  text-align: left;
  transition: border-color 0.2s ease;
}
.cwt-tf__tile:hover {
  border-color: rgba(205, 158, 215, 0.6);
}
.cwt-tf__tile.is-selected {
  border-color: #CD9ED7;
  box-shadow: 0 0 0 2px rgba(205, 158, 215, 0.2);
}
.cwt-tf__tile-photo {
  width: 40%;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #F0E2F3;
}
.cwt-tf__tile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cwt-tf__tile-label {
  width: 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background: rgba(154, 95, 166, 0.85);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}
.cwt-tf__tile.is-selected .cwt-tf__tile-label {
  background: #CD9ED7;
}

/* ---- 選択中タグ ---- */
.cwt-tf__selected {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #F2E6F5;
}
.cwt-tf.is-filtered .cwt-tf__selected {
  display: flex;
}
.cwt-tf__selected-label {
  font-size: 14px;
  color: #A087A3;
}
.cwt-tf__selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 14px;
  background: rgba(205, 158, 215, 0.12);
  color: #9A5FA6;
  border: 1px solid rgba(205, 158, 215, 0.25);
  border-radius: 999px;
  cursor: pointer;
}

/* ============================================================
 * 結果表示（絞り込み前：カテゴリ別／絞り込み後：検索結果フラット）
 * ============================================================ */
.cwt-tf-results {
  background: linear-gradient(180deg, #FAF6F2 0%, #F8F1FA 100%);
  padding: 64px 0;
}
.cwt-tf-results[hidden] {
  display: none;
}

.cwt-tf-results__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.cwt-tf-results__bar {
  width: 6px;
  height: 32px;
  border-radius: 999px;
  background: #CD9ED7;
  flex-shrink: 0;
}
.cwt-tf-results__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 26px;
  font-weight: 700;
  color: #3A223D;
  margin: 0;
}
.cwt-tf-results__count {
  font-size: 14px;
  color: #6B526F;
  margin: 0 0 32px 18px;
}

.cwt-tf-group {
  margin-bottom: 80px;
}
.cwt-tf-group:last-child {
  margin-bottom: 0;
}
.cwt-tf-group__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
}
.cwt-tf-group__bar {
  width: 6px;
  height: 28px;
  border-radius: 999px;
  background: #CD9ED7;
  flex-shrink: 0;
}
.cwt-tf-group__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 22px;
  font-weight: 700;
  color: #3A223D;
  margin: 0;
}
.cwt-tf-group__lead {
  font-size: 16px;
  color: #6B526F;
  line-height: 1.7;
  margin: 0 0 32px;
}

.cwt-tf-cardgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) {
  .cwt-tf-cardgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cwt-tf-noresults {
  display: none;
  text-align: center;
  padding: 80px 24px;
}
.cwt-tf-noresults.is-visible {
  display: block;
}
.cwt-tf-noresults p {
  color: #A087A3;
  font-size: 14px;
  margin: 0 0 8px;
}

/* ============================================================
 * 施術カード
 * ============================================================ */
.cwt-tf-card {
  border-radius: 16px;
  border: 1px solid #F2E6F5;
  background: #FFFFFF;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
@media (min-width: 768px) {
  .cwt-tf-card {
    padding: 32px;
  }
}
.cwt-tf-card:hover {
  border-color: rgba(205, 158, 215, 0.5);
  background: #FDF9FE;
}
.cwt-tf-card__bar {
  width: 64px;
  height: 4px;
  border-radius: 999px;
  margin-bottom: 20px;
  background: linear-gradient(to right, #CD9ED7, #E5A8B8);
}
.cwt-tf-card__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 18px;
  font-weight: 700;
  color: #3A223D;
  line-height: 1.4;
  margin: 0 0 16px;
}
.cwt-tf-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.cwt-tf-card__tag {
  font-size: 14px;
  color: #7A4A82;
  background: #F5EDF7;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.cwt-tf-card__desc {
  font-size: 15px;
  color: #5F4663;
  line-height: 1.8;
  margin: 0 0 24px;
  flex: 1;
}
.cwt-tf-card__footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid #F2E6F5;
}
.cwt-tf-card__price-label {
  display: block;
  font-size: 13px;
  color: #A087A3;
  margin-bottom: 4px;
}
.cwt-tf-card__price {
  font-size: 17px;
  font-weight: 700;
  color: #9A5FA6;
}
.cwt-tf-card:hover .cwt-tf-card__price {
  color: #CD9ED7;
}
.cwt-tf-card__link {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #A087A3;
  text-decoration: none;
}
.cwt-tf-card:hover .cwt-tf-card__link {
  color: #9A5FA6;
}

/* ============================================================
 * 症状カード（症状から探すページのデフォルト表示。施術カードと
 * 同じ箱・余白・ホバー挙動にそろえ、cwt-tf-cardgrid で2列に並べる）
 * ============================================================ */
.cwt-tf-symptom {
  border-radius: 16px;
  border: 1px solid #F2E6F5;
  background: #FFFFFF;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
@media (min-width: 768px) {
  .cwt-tf-symptom {
    padding: 32px;
  }
}
.cwt-tf-symptom:hover {
  border-color: rgba(205, 158, 215, 0.5);
  background: #FDF9FE;
}
.cwt-tf-symptom__bar {
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  margin-bottom: 20px;
  background: linear-gradient(to right, #CD9ED7, #E5A8B8);
}
.cwt-tf-symptom__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 18px;
  font-weight: 700;
  color: #3A223D;
  margin: 0 0 16px;
}
.cwt-tf-symptom__lead {
  font-size: 16px;
  color: #6B526F;
  line-height: 1.8;
  margin: 0 0 16px;
}
.cwt-tf-symptom__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #A087A3;
  margin: 0 0 12px;
}
.cwt-tf-symptom__list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.cwt-tf-symptom__list li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  color: #5F4663;
  line-height: 1.8;
}
.cwt-tf-symptom__list li + li {
  margin-top: 8px;
}
.cwt-tf-symptom__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CD9ED7;
}
.cwt-tf-symptom__overview {
  font-size: 14px;
  color: #A087A3;
  line-height: 1.8;
  border-left: 2px solid #F2E6F5;
  padding-left: 16px;
  margin: 0 0 20px;
}
.cwt-tf-symptom__footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #F2E6F5;
}
.cwt-tf-symptom__treatments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cwt-tf-symptom__treatments a.cwt-tf-card__tag {
  text-decoration: none;
}
.cwt-tf-symptom__treatments a.cwt-tf-card__tag:hover {
  background: #EAD8EE;
}

@media (max-width: 599px) {
  .cwt-tf-results {
    padding: 40px 0;
  }
  .cwt-tf-group {
    margin-bottom: 56px;
  }
}
