/* Section polish — глобальные апгрейды для FAQ-аккордеона, карточек преимуществ
 * и pricing-карточек. Не меняет HTML — только стили. JS — в /js/faq-accordion.js
 */

/* ==== Mobile typography & overflow fixes ====
 * NOTE: overflow-x применяется только в mobile @media и только на body — иначе ломает
 * position:fixed sticky header на десктопе.
 */
@media (max-width: 768px) {
  body {
    overflow-x: clip;     /* clip > hidden — не создаёт scrolling у потомков, не ломает fixed */
    max-width: 100%;
  }
  body, main, section, .section, .container { max-width: 100%; }
  h1, h2, h3, .h1, .h2, .h3 {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100%;
    hyphens: auto;
  }
  /* .wprices слайдер: убираем negative margin, который вытягивал блок за container */
  .wprices {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  /* DC contact widget — если выходит за viewport */
  .dc-contact-widget, .dc-contact-bubble { max-width: 100vw; }
}
@supports not (overflow-x: clip) {
  @media (max-width: 768px) { body { overflow-x: hidden; } }
}

/* Перебиваем огромные desktop-значения H1/H2 на мобильном */
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  h1, .h1, .hero__title {
    font-size: 28px !important;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  h2, .h2 {
    font-size: 22px !important;
    line-height: 1.25;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  h3, .h3 { font-size: 17px !important; line-height: 1.3; }
  .hero__subtitle { font-size: 16px !important; line-height: 1.45; }
  .hero__lead { font-size: 15px !important; line-height: 1.5; }
  .hero__list li { font-size: 15px !important; }
  /* Hero высоту уменьшаем — на мобильном не нужен 85vh */
  .hero, .seo-hero { min-height: auto; }
  .hero__cnt, .seo-hero__content { padding: 28px 0 32px; }
  /* Кнопки тапаемые: минимум 44×44 по WCAG */
  .btn, .btn--primary, .btn--secondary { min-height: 44px; padding: 12px 20px; font-size: 15px; }
  .btn--large { padding: 14px 22px; font-size: 16px; }
  /* Защита для .data-table — должны прокручиваться */
  .table-wrap, .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 100%; }
}
@media (max-width: 480px) {
  h1, .h1, .hero__title { font-size: 24px !important; }
  h2, .h2 { font-size: 20px !important; }
  .hero__title { letter-spacing: -0.01em; }
}

/* ==== seo-hero (страницы шаблонные) — отсутствовавшие правила, чтобы img растянулся как фон ==== */
.seo-hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}
.seo-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.seo-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(15, 23, 42, .55), rgba(15, 23, 42, .65));
  z-index: 1;
}
.seo-hero__content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 100px 0 60px;
}
.seo-hero__content .hero__title,
.seo-hero__content h1 { color: #fff; }
.seo-hero__content .hero__subtitle,
.seo-hero__content .hero__list,
.seo-hero__content .hero__list li { color: rgba(255, 255, 255, .92); }
.seo-hero__content .breadcrumb a { color: rgba(255, 255, 255, .85); }
.seo-hero__content .breadcrumb__sep { color: rgba(255, 255, 255, .55); }
@media (max-width: 768px) {
  .seo-hero { min-height: 360px; }
  .seo-hero__content { padding: 90px 0 40px; }
}

/* ==== Header непрозрачная подложка на мобильном (всегда, независимо от sticky) ==== */
@media (max-width: 768px) {
  .thb-header {
    background: rgba(255, 255, 255, .98) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  }
  .thb-header .burger span { background: var(--text, #0f172a) !important; }
  .thb-header .lang-btn { background: #fff !important; color: var(--text, #0f172a) !important; border-color: #ddd !important; }
}

/* ==== Collapsible sections — на мобильном секции c длинным текстом сворачиваются ==== */
@media (max-width: 768px) {
  .thb-collapsible {
    position: relative;
    max-height: 380px;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .thb-collapsible::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
    pointer-events: none;
    transition: opacity .25s;
  }
  .thb-collapsible.is-expanded {
    max-height: 9999px;
  }
  .thb-collapsible.is-expanded::after { opacity: 0; }
  /* Если секция на muted-фоне, gradient до muted */
  .section--muted .thb-collapsible::after {
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0), var(--surface, #f8fafc) 85%);
  }
  .thb-collapsible-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px auto 0;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    width: auto;
  }
  .thb-collapsible-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}
@media (min-width: 769px) {
  .thb-collapsible-toggle { display: none; }
  .thb-collapsible::after { display: none; }
  .thb-collapsible { max-height: none !important; }
}

/* ==== Footer accordion на мобильном — колонки сворачиваются ==== */
@media (max-width: 768px) {
  .footer__col {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding-bottom: 0;
  }
  .footer__title {
    cursor: pointer;
    position: relative;
    padding: 14px 38px 14px 0;
    margin: 0;
    user-select: none;
  }
  .footer__title::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    transition: transform .25s;
    opacity: .7;
  }
  .footer__col.is-open .footer__title::after {
    transform: translateY(-30%) rotate(-135deg);
  }
  .footer__list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, opacity .25s;
    opacity: 0;
    margin: 0;
  }
  .footer__col.is-open .footer__list {
    max-height: 800px;
    opacity: 1;
    padding-bottom: 14px;
  }
}


/* ==== FAQ accordion ==== */
.faq { display: grid; gap: 12px; }
.faq__item {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.faq__item:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.faq__item h3 {
  cursor: pointer;
  margin: 0;
  padding: 18px 56px 18px 22px;
  position: relative;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  user-select: none;
  outline: none;
}
.faq__item h3:focus-visible { box-shadow: inset 0 0 0 2px #2563eb; border-radius: 14px; }
.faq__item h3::after {
  content: '';
  position: absolute;
  right: 22px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: rotate(45deg);
  transition: transform .25s ease;
}
.faq__item.is-open { border-color: #2563eb; box-shadow: 0 4px 14px rgba(37,99,235,.08); }
.faq__item.is-open h3::after { transform: rotate(-135deg); top: 26px; border-color: #2563eb; }
.faq__item p, .faq__item .faq__a {
  margin: 0;
  padding: 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .25s ease, opacity .25s ease;
  color: #475569;
  line-height: 1.65;
  opacity: 0;
}
.faq__item.is-open p, .faq__item.is-open .faq__a {
  max-height: 800px;
  padding: 0 22px 20px;
  opacity: 1;
}

/* ==== Advantages — нумерованные карточки ==== */
.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.adv-item {
  background: #fff;
  border-radius: 14px;
  padding: 24px 22px 22px;
  border: 1px solid #e2e8f0;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}
.adv-item:hover {
  transform: translateY(-3px);
  border-color: #2563eb;
  box-shadow: 0 10px 26px rgba(15,23,42,.08);
}
.adv-item__num {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: rgba(37,99,235,.08);
  border-radius: 999px;
}
.adv-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}
.adv-item p {
  margin: 0;
  font-size: 14.5px;
  color: #475569;
  line-height: 1.6;
}

/* ==== Expand-blocks (для длинных «полотен» текста) ==== */
.expandables { display: grid; gap: 12px; }
.exp-block {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.exp-block:hover { border-color: #cbd5e1; }
.exp-block summary {
  cursor: pointer;
  padding: 18px 56px 18px 22px;
  position: relative;
  list-style: none;
  user-select: none;
}
.exp-block summary::-webkit-details-marker { display: none; }
.exp-block summary::marker { content: ''; }
.exp-block summary h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}
.exp-block summary::after {
  content: '';
  position: absolute;
  right: 22px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: rotate(45deg);
  transition: transform .25s;
}
.exp-block[open] { border-color: #2563eb; box-shadow: 0 4px 14px rgba(37,99,235,.08); }
.exp-block[open] summary::after { transform: rotate(-135deg); top: 26px; border-color: #2563eb; }
.exp-content {
  padding: 4px 22px 22px;
  color: #475569;
  line-height: 1.7;
  border-top: 1px solid #f1f5f9;
  margin-top: -1px;
}
.exp-content p { margin: 14px 0 0; }
.exp-content p:first-child { margin-top: 16px; }
.exp-content ul, .exp-content ol { margin: 12px 0 12px 0; padding-left: 22px; }
.exp-content li { margin-bottom: 7px; }
.exp-content strong { color: #0f172a; }
.exp-lead {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.65;
  color: #475569;
}

/* ==== Prices — pricing cards ==== */
.prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.price-item {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.price-item:hover {
  transform: translateY(-3px);
  border-color: #2563eb;
  box-shadow: 0 10px 26px rgba(37,99,235,.10);
}
.price-item h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}
.price-val {
  font-size: 22px;
  font-weight: 700;
  color: #2563eb;
  margin: 0 0 8px;
  line-height: 1.2;
}
.price-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.55;
}
