/* ========================================
   СТИЛИ СЕКЦИИ ЧАВО — faq.css
   ======================================== */

.faq-section {
  padding: 60px 0 30px;
  background-color: var(--color-bg, #ffffff);
  position: relative;
  z-index: 10;
}

.faq-section .news-header-wrap {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 30px;
}

.faq-section .title {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  color: var(--color-text, #0f172a);
  margin-bottom: 12px;
}

.faq-section {
  font-size: 15px;
  color: var(--color-text-muted, #64748b);
  line-height: 1.5;
}

/* ===== Список ===== */
.faq-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Элемент ===== */
.faq-item {
  background: #ffffff;
  border: 2px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.faq-item:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: rgba(46, 219, 165, 0.4);
  box-shadow: 0 8px 24px rgba(5, 60, 60, 0.06);
}

.faq-item[open] {
  background: #ffffff;
  border-color: rgba(46, 219, 165, 0.55);
  box-shadow: 0 12px 32px rgba(5, 60, 60, 0.08);
}

/* ===== Вопрос ===== */
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  line-height: 1.4;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  color: var(--color-primary-light, #00966a);
  background: rgba(0, 150, 106, 0.04);
}

.faq-item[open] .faq-question {
  color: var(--color-primary, #053c3c);
  background: rgba(0, 150, 106, 0.06);
}

.faq-chevron {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--color-primary-light, #00966a);
  transition: transform 0.3s ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

/* ===== Ответ ===== */
.faq-answer {
  padding: 0 24px 22px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--color-text-light, #475569);
  animation: faqFadeIn 0.25s ease-out;
}

.faq-answer p {
  margin: 0 0 10px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer a {
  color: var(--color-primary-light, #00966a);
  text-decoration: underline;
  text-decoration-color: rgba(0, 150, 106, 0.4);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.faq-answer a:hover {
  color: var(--color-primary, #053c3c);
  text-decoration-color: var(--color-primary, #053c3c);
}

.faq-answer strong {
  color: var(--color-text, #0f172a);
  font-weight: 700;
}

@keyframes faqFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Нижний CTA-баннер ===== */
.faq-mirror-banner {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 24px;
  background: rgba(5, 60, 60, 0.04);
  border: 1px dashed rgba(46, 219, 165, 0.4);
  border-radius: 14px;
  text-align: center;
}

.faq-mirror-content {
  display: flex;
  justify-content: center;
}

.faq-mirror-content .btn-submit {
  width: 100%;
  max-width: 400px;
  height: 48px;
  font-size: 15px;
}

/* ===== Адаптив ===== */
@media (max-width: 768px) {
  .faq-section {
    padding: 40px 0 20px;
  }

  .faq-question {
    padding: 12px 18px;
    font-size: 15px;
  }

  .faq-answer {
    padding: 0 18px 18px;
    font-size: 14px;
  }

  .faq-chevron {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .faq-question {
    padding: 10px 16px;
    font-size: 14px;
  }

  .faq-answer {
    padding: 0 16px 16px;
    font-size: 13.5px;
  }
}

/* ===== Управление списком FAQ (Шторка) ===== */
.faq-controls {
  display: flex;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto 20px;
  /* Убираем sticky, так как кнопка управляет всем блоком, а не прилипает при скролле */
  position: relative;
  z-index: 10;
}

.faq-toggle-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  background: #ffffff;
  border: 2px solid var(--color-primary-light, #00966a);
  border-radius: 30px;
  color: var(--color-primary, #053c3c);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  box-shadow: 0 6px 20px rgba(0, 150, 106, 0.15);
}

.faq-toggle-all-btn:hover {
  background: var(--color-primary-light, #00966a);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(0, 150, 106, 0.3);
}

.faq-toggle-all-btn i {
  font-size: 14px;
  transition: transform 0.3s ease;
}

/* Плавное скрытие/появление списка */
.faq-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  
  /* Анимация шторки */
  max-height: 5000px; /* Достаточно большое значение для всех вопросов */
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}

.faq-list.is-hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* Скрываем CTA-баннер вместе со списком */
.faq-mirror-banner {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 24px;
  background: rgba(5, 60, 60, 0.04);
  border: 1px dashed rgba(46, 219, 165, 0.4);
  border-radius: 14px;
  text-align: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.faq-mirror-banner.is-hidden {
  display: none; /* Или visibility: hidden; если нужна плавность, но display надежнее для layout */
}

/* На мобильных — кнопка на всю ширину */
@media (max-width: 768px) {
  .faq-toggle-all-btn {
    width: 100%;
    max-width: 400px;
    padding: 14px 20px;
    font-size: 15px;
  }
}