/* =======================================================
   THERA SPA · FAQ MODULE (Elementor + Article)
   ======================================================= */

/* ---------- Biến màu / style chung ---------- */
.th-faq-wrap,
.th-faq {
  --th-faq-border: #ff9800;
  --th-faq-border-soft: rgba(255, 152, 0, 0.22);
  --th-faq-text: #222222;
  --th-faq-muted: #666666;
  --th-faq-radius-card: 14px;
  --th-faq-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  --th-faq-shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.03);
  --th-faq-card-bg: #fff7eb; /* nền kem nhạt như hiện tại */
  --th-faq-pill-bg-active: rgba(255, 152, 0, 0.09);
  --th-faq-transition: 0.25s ease-in-out;
}

/* =======================================================
   1. FAQ GIAO DIỆN – ELEMENTOR TOGGLE
   Section/Column bọc widget toggle cần class: th-faq-wrap
   ======================================================= */

.th-faq-wrap {
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 15px;
}

.th-faq-wrap .elementor-toggle {
  border: 0;
  background: transparent;
}

/* Mỗi item */
.th-faq-wrap .elementor-toggle-item {
  margin-bottom: 12px;
  border-radius: var(--th-faq-radius-card);
  background: var(--th-faq-card-bg);
  box-shadow: var(--th-faq-shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: box-shadow var(--th-faq-transition),
              border-color var(--th-faq-transition),
              transform var(--th-faq-transition),
              background var(--th-faq-transition);
}

/* Header câu hỏi
   → dùng display:block cho mọi màn hình để text không bao giờ bị chồng */
.th-faq-wrap .elementor-toggle .elementor-tab-title {
  position: relative;
  display: block;
  padding: 12px 52px 12px 52px;  /* left cho chấm, right cho nút */
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--th-faq-text);
}

/* Vòng tròn bên trái */
.th-faq-wrap .elementor-toggle .elementor-tab-title::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--th-faq-border-soft);
  box-shadow: inset 0 0 0 3px #fff;
  background: #fff;
}

/* DẤU + / – bên phải (tự vẽ, không dùng icon Elementor) */
.th-faq-wrap .elementor-toggle .elementor-tab-title::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--th-faq-border-soft);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: var(--th-faq-border);
  pointer-events: none; /* click ăn cả dòng, không dính icon */
  transition: var(--th-faq-transition);
}

/* Nội dung trả lời */
.th-faq-wrap .elementor-toggle .elementor-tab-content {
  padding: 0 24px 14px 52px;
  font-size: 14px;
  color: var(--th-faq-muted);
  line-height: 1.75;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

/* Trạng thái mở – JS thêm .th-is-open, Elementor thêm .elementor-active */
.th-faq-wrap .elementor-toggle-item.th-is-open {
  border-color: var(--th-faq-border);
  box-shadow: var(--th-faq-shadow);
  transform: translateY(-1px);
  background: #fff;
}

.th-faq-wrap .elementor-toggle .elementor-tab-title.elementor-active {
  color: var(--th-faq-border);
  background: var(--th-faq-pill-bg-active);
}

.th-faq-wrap
  .elementor-toggle
  .elementor-tab-title.elementor-active::before {
  background: linear-gradient(135deg, #ffb347, #ff9800);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.18);
  border-color: transparent;
}

/* Đổi + thành – khi đang mở */
.th-faq-wrap
  .elementor-toggle
  .elementor-tab-title.elementor-active::after {
  content: "–";
  background: linear-gradient(135deg, #ffb347, #ff9800);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.45);
}

/* ẨN HOÀN TOÀN ICON MẶC ĐỊNH CỦA ELEMENTOR */
.th-faq-wrap .elementor-toggle .elementor-toggle-icon {
  display: none !important;
}

/* Mobile FAQ giao diện – chỉ giảm size & padding, giữ block layout */
@media (max-width: 767px) {
  .th-faq-wrap {
    padding: 0 10px 40px;
  }

  .th-faq-wrap .elementor-toggle .elementor-tab-title {
    padding: 10px 48px 10px 46px;
    font-size: 14px;
    line-height: 1.6;
  }

  .th-faq-wrap .elementor-toggle .elementor-tab-content {
    padding: 0 18px 12px 46px;
    font-size: 13px;
  }

  .th-faq-wrap .elementor-toggle .elementor-tab-title::before {
    left: 18px;
  }
}

/* =======================================================
   2. FAQ TRONG BÀI VIẾT – <details>
   HTML:
   <section class="th-faq" data-single="true"> ... </section>
   ======================================================= */

.th-faq {
  max-width: 860px;
  margin: 40px auto 60px;
  padding: 0 15px;
}

.th-faq__heading {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 18px;
  color: var(--th-faq-border);
}

/* Mỗi item */
.th-faq__item {
  margin: 0 0 10px 0;
  border-radius: var(--th-faq-radius-card);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--th-faq-shadow-soft);
  overflow: hidden;
  transition: box-shadow var(--th-faq-transition),
              border-color var(--th-faq-transition),
              transform var(--th-faq-transition),
              background var(--th-faq-transition);
}

/* Tắt dấu tam giác mặc định của <details> */
.th-faq__item > summary {
  list-style: none;
}
.th-faq__item > summary::-webkit-details-marker {
  display: none;
}

/* Câu hỏi */
.th-faq__q {
  position: relative;
  display: block;
  padding: 10px 44px 10px 42px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--th-faq-text);
  background: var(--th-faq-card-bg);
}

/* Vòng tròn bên trái */
.th-faq__q::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--th-faq-border-soft);
  box-shadow: inset 0 0 0 3px #fff;
  background: #fff;
}

/* Nút + / - bên phải cho FAQ trong bài viết */
.th-faq__q::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--th-faq-border-soft);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: var(--th-faq-border);
  transition: var(--th-faq-transition);
}

/* Nội dung trả lời */
.th-faq__a {
  padding: 0 18px 10px 42px;
  font-size: 14px;
  color: var(--th-faq-muted);
  line-height: 1.75;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

/* Trạng thái mở */
.th-faq__item[open] {
  border-color: var(--th-faq-border);
  box-shadow: var(--th-faq-shadow);
  transform: translateY(-1px);
}

.th-faq__item[open] > .th-faq__q {
  color: var(--th-faq-border);
  background: var(--th-faq-pill-bg-active);
}

.th-faq__item[open] > .th-faq__q::before {
  background: linear-gradient(135deg, #ffb347, #ff9800);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.18);
  border-color: transparent;
}

.th-faq__item[open] > .th-faq__q::after {
  content: "–";
  background: linear-gradient(135deg, #ffb347, #ff9800);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.45);
}

/* Mobile FAQ bài viết */
@media (max-width: 767px) {
  .th-faq {
    padding: 0 10px;
    margin-bottom: 40px;
  }

  .th-faq__q {
    padding: 9px 40px 9px 38px;
    font-size: 14px;
  }

  .th-faq__a {
    padding: 0 16px 9px 38px;
    font-size: 13px;
  }

  .th-faq__q::before {
    left: 16px;
  }
}
