/**
 * Главная (index.html): секции импорта и ИИ — финальный слой каскада.
 * Подключается ПОСЛЕ footer.css и nfs-flashes.css, чтобы правила не терялись.
 * Визуал как в dizich/nfsauto_homepage2.html: фон секции импорта = фон страницы (--nfs-bg), не белый лист.
 */

#importSection.import-section {
  padding: 52px 0;
  background: var(--nfs-bg);
  width: 100%;
  box-sizing: border-box;
}

#importSection .section-inner,
#aiAssistantSection .section-inner {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
  box-sizing: border-box;
}

#importSection .section-header,
#yandexReviewsSection .section-header {
  text-align: left;
  margin-bottom: 2rem;
}

#importSection .section-header .nfs-section-title,
#yandexReviewsSection .section-header .nfs-section-title {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.2em;
  white-space: nowrap;
  text-align: left;
}

#importSection .section-header .nfs-section-subtitle,
#yandexReviewsSection .section-header .nfs-section-subtitle {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

section#aiAssistantSection.ai-section > .section-inner {
  position: relative;
  z-index: 1;
}

/* Переключение: Корея = калькулятор, Китай/США = форма заявки */
#importSection .import-tab-content {
  display: none;
}

#importSection .import-tab-content.active {
  display: block;
}

/* Табы региона: одна строка на всю ширину карточки калькулятора */
#importSection .nfs-import-tabs.nfs-navigation-pack {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
}

#importSection .nfs-import-tabs .speed-tabs {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
}

#importSection .nfs-import-tabs .stab {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

/* Форма заявки (разметка как nfs-ds4-modal) в колонке калькулятора */
#importSection .nfs-import-lead-card {
  max-width: none;
  width: 100%;
  margin-top: 0;
}

#importSection .nfs-import-lead-card .nfs-ds4-modal-close {
  display: none;
}

/* Без верхней анимированной полоски (как у демо-модалки) — только блок импорта */
#importSection .nfs-import-lead-card.nfs-ds4-modal::before {
  content: none;
  display: none;
  animation: none;
}

#importSection .nfs-ds4-modal-ta {
  min-height: 56px;
  resize: vertical;
  margin-bottom: 8px;
}

#importSection .nfs-import-lead-disclaimer {
  font-size: 9px;
  color: var(--nfs-t4, #9aa0b8);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

#importSection .nfs-calc-result-row--total {
  align-items: center;
}

#importSection .nfs-calc-total-hint {
  font-size: 9px;
  color: var(--nfs-t3, #5a6480);
  margin-top: 1px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   Главная: ключевые CTA в стиле кнопки поиска hero-filter (.hero-btn-search)
   ═══════════════════════════════════════════════════════════════ */

#heroSection button.nfs-listings-btn-more,
#carListingsSection button.nfs-listings-btn-more,
#importSection .nfs-import-lead-card .nfs-ds4-btn.nfs-ds4-btn--primary.btn-import-lead,
#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary,
#aiAssistantSection #btnAiAnalyze.nfs-ai-analyze-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--nfs-ff, 'Montserrat', sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #3b7fff 0%, var(--nfs-blue2, #2b6fe8) 40%, var(--nfs-blue, #1a5fd9) 70%, #1248b0 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 -1px 0 rgba(0, 0, 0, 0.18) inset,
    0 2px 10px rgba(26, 95, 217, 0.3),
    0 0 0 0.5px rgba(26, 95, 217, 0.4);
  text-decoration: none;
  line-height: 1.25;
  box-sizing: border-box;
}

#heroSection button.nfs-listings-btn-more svg,
#carListingsSection button.nfs-listings-btn-more svg {
  color: inherit;
  opacity: 0.95;
}

#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary,
#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary:visited {
  color: #fff;
}

#heroSection button.nfs-listings-btn-more::after,
#carListingsSection button.nfs-listings-btn-more::after,
#importSection .nfs-import-lead-card .nfs-ds4-btn.nfs-ds4-btn--primary.btn-import-lead::after,
#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary::after,
#aiAssistantSection #btnAiAnalyze.nfs-ai-analyze-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  background-size: 200% 100%;
  background-position: 200% center;
  transition: background-position 0.4s;
  pointer-events: none;
}

#heroSection button.nfs-listings-btn-more:hover::after,
#carListingsSection button.nfs-listings-btn-more:hover::after,
#importSection .nfs-import-lead-card .nfs-ds4-btn.nfs-ds4-btn--primary.btn-import-lead:hover::after,
#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary:hover::after,
#aiAssistantSection #btnAiAnalyze.nfs-ai-analyze-btn:hover::after {
  background-position: -200% center;
}

#heroSection button.nfs-listings-btn-more:hover,
#carListingsSection button.nfs-listings-btn-more:hover,
#importSection .nfs-import-lead-card .nfs-ds4-btn.nfs-ds4-btn--primary.btn-import-lead:hover,
#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary:hover,
#aiAssistantSection #btnAiAnalyze.nfs-ai-analyze-btn:hover {
  transform: translateY(-1px);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(59, 127, 255, 0.6),
    0 0 14px rgba(59, 127, 255, 0.3),
    0 4px 14px rgba(26, 95, 217, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

#heroSection button.nfs-listings-btn-more:focus-visible,
#carListingsSection button.nfs-listings-btn-more:focus-visible,
#importSection .nfs-import-lead-card .nfs-ds4-btn.nfs-ds4-btn--primary.btn-import-lead:focus-visible,
#featuresSection .nfs-section-cta a.nfs-btn.nfs-btn-primary:focus-visible,
#aiAssistantSection #btnAiAnalyze.nfs-ai-analyze-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--nfs-white, #fff),
    0 0 0 4px var(--nfs-blue, #1a5fd9);
}

#importSection .nfs-import-lead-card .nfs-ds4-btn.nfs-ds4-btn--primary.btn-import-lead {
  width: 100%;
  margin-top: 4px;
}

#aiAssistantSection #btnAiAnalyze.nfs-ai-analyze-btn {
  width: 100%;
}

/* Было в nfs-car-listings: отключаем поворот иконки при ховере — как у hero */
#carListingsSection button.nfs-listings-btn-more:hover svg {
  transform: none;
}

/* Модальное окно заявки (CTA «Начать подбор» в этапах импорта) */
#importSection .nfs-import-lead-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#importSection .nfs-import-lead-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(13, 17, 23, 0.55);
  cursor: pointer;
}

#importSection .nfs-import-lead-modal-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: min(90vh, 640px);
  overflow-y: auto;
}

#importSection .nfs-import-lead-modal-overlay .nfs-import-lead-card--popup {
  max-width: none;
  width: 100%;
}

/* Кнопка закрытия только в модалке (в табах скрыта) */
#importSection .nfs-import-lead-modal-overlay .nfs-import-lead-card--popup .nfs-ds4-modal-close {
  display: flex;
}

/* Заголовки секций: на мобилке не обрезать длинные строки (nowrap + flex ломали «на Яндекс.Картах») */
@media (max-width: 767px) {
  #yandexReviewsSection .section-header .section-left,
  #importSection .section-header .section-left {
    max-width: 100%;
    min-width: 0;
  }

  #yandexReviewsSection .section-header .nfs-section-title,
  #importSection .section-header .nfs-section-title {
    white-space: normal;
    flex-wrap: wrap;
    max-width: 100%;
  }

  #yandexReviewsSection .section-header .nfs-section-title-accent,
  #importSection .section-header .nfs-section-title-accent {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
