/* ═══════════════════════════════════════════════════════════════
   site-v2-fixes.css — точечные правки поверх site-v2.css
   Загружается ПОСЛЕ site-v2.css, перебивает спецификой по необходимости.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Бэйдж-stat: ticker в <strong> не должен наследовать малый шрифт label ─── */
.v2-svc-hero__stat strong span,
.v2-svc-hero__stat strong [data-ticker],
.v2-page-hero__stat strong span,
.v2-page-hero__stat strong [data-ticker] {
  font-size: inherit !important;
  color: inherit !important;
  margin: 0 !important;
  display: inline !important;
  line-height: inherit !important;
}

/* ─── 2. Бургер прижат к правой стороне на мобильной ─── */
@media (max-width: 768px) {
  .v2-header__right {
    margin-left: auto;
  }
  .v2-burger {
    margin-left: auto;
  }
}

/* ─── 3. RNP timeline: маленькая цифра СЛЕВА, карточка справа (для ВСЕХ шагов) ─── */
@media (max-width: 768px) {
  .v2-timeline {
    padding-left: 0 !important;
  }
  /* перебиваем :nth-child(odd/even) — все шаги одинаковые на mobile */
  .v2-timeline__step,
  .v2-timeline__step:nth-child(odd),
  .v2-timeline__step:nth-child(even) {
    display: grid !important;
    grid-template-columns: 56px 1fr !important;
    gap: 12px !important;
    align-items: start !important;
    margin-bottom: 18px !important;
  }
  .v2-timeline__step:nth-child(odd) .v2-timeline__num,
  .v2-timeline__step:nth-child(even) .v2-timeline__num,
  .v2-timeline__step:nth-child(odd) .v2-timeline__num-wrap,
  .v2-timeline__step:nth-child(even) .v2-timeline__num-wrap {
    grid-column: 1 !important;
    justify-self: start !important;
  }
  .v2-timeline__step:nth-child(odd) .v2-timeline__card,
  .v2-timeline__step:nth-child(even) .v2-timeline__card {
    grid-column: 2 !important;
  }
  .v2-timeline__num-wrap, .v2-timeline__num {
    width: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    align-self: start !important;
    justify-self: start !important;
  }
  .v2-timeline__num-wrap > *, .v2-timeline__num > * {
    align-self: start;
  }
  .v2-timeline__num-bg {
    display: none !important;
  }
  .v2-timeline__num-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }
  .v2-timeline__card {
    margin: 0 !important;
    padding: 14px 16px !important;
    width: 100% !important;
  }
  .v2-timeline-snake { display: none !important; }
  .v2-timeline__marker { display: none !important; }
}

/* ─── 3b. arbitrazh hero stats — 2 колонки на мобиле, не 3 ─── */
@media (max-width: 768px) {
  .v2-svc-hero__stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 18px 24px !important;
  }
  .v2-svc-hero__stat {
    min-width: 0;
  }
}

/* ─── 3c. «7 направлений» (.v2-mpt-benefits) и подобные — 1 колонка на mobile ─── */
@media (max-width: 768px) {
  .v2-mpt-benefits,
  .v2-svc-grid,
  .v2-svc-list,
  .v2-svc-cards,
  .v2-services {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .v2-mpt-benefits > *,
  .v2-svc-grid > *,
  .v2-svc-list > *,
  .v2-svc-cards > *,
  .v2-services > * {
    min-width: 0;
    max-width: 100%;
  }
}

/* ─── 3d. Header: бургер прижат к крайнему правому краю на mobile ─── */
@media (max-width: 768px) {
  .v2-header__row {
    padding-left: 16px !important;
    padding-right: 12px !important;
    gap: 12px !important;
  }
  .v2-header__right {
    margin-left: auto;
    padding-right: 0 !important;
  }
}

/* ─── 4. «Пять шагов» — горизонтальный скролл со snap'ом + явный hint ─── */
@media (max-width: 768px) {
  .v2-svc-steps {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 14px !important;
    padding: 0 16px 28px !important;
    margin: 0 -16px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    /* подсказка-градиент справа что есть ещё контент */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    position: relative;
  }
  .v2-svc-step {
    flex: 0 0 70% !important;
    scroll-snap-align: start;
    min-width: 0;
  }
  .v2-svc-step__ball {
    margin: 0 auto 12px !important;
  }
  /* hint текст под секцией */
  .v2-svc-steps::after {
    display: none;  /* псевдо-элемент на flex container не работает как нужно — добавим JS-hint */
  }
  /* Бейдж «← свайп →» добавляется JS'ом в site-v2-fixes.css.script (см. ниже) */
}

/* ─── 5. Thanks (благодарности): минимальные правки, не ломая pageFlip ─── */
@media (max-width: 768px) {
  /* Текст внутри страницы должен скроллиться если не помещается (intro-страница) */
  #v2-book .page {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* На обложке убираем дополнительный pad сверху */
  #v2-book .page--cover .v2-book__cover-inner {
    padding-top: 24px !important;
  }
  /* Intro-страница: контент к верху, не центрировать вертикально */
  #v2-book .page--intro {
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 24px 18px !important;
    text-align: left !important;
  }
  #v2-book .page--intro__title {
    margin-top: 8px !important;
  }
  #v2-book .page--intro p {
    font-size: 15px !important;
    line-height: 1.55 !important;
    margin: 10px 0 !important;
  }
  #v2-book .page--intro__sig {
    margin-top: 18px !important;
  }
  /* Для intro-страницы: если есть текстовый блок — даём ему padding и нормальные размеры */
  #v2-book .page__paper {
    padding: 16px !important;
  }
  #v2-book .page__paper img {
    max-height: 75vh;
    object-fit: contain;
  }
  /* Контролы Назад/Вперёд должны идти ПОД книгой, в одной строке, не накладываясь */
  .v2-book__controls {
    position: static !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin: 16px auto 0 !important;
    padding: 0 12px !important;
    max-width: 100%;
  }
  .v2-book__btn {
    flex: 0 0 auto !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
  }
  .v2-book__counter {
    font-size: 14px !important;
  }
  .v2-book__hint {
    font-size: .82rem !important;
    padding: 0 16px !important;
    margin-top: 12px !important;
  }
}

/* ─── 6. Footer всегда показываем (если page имеет нестандартный layout — fallback) ─── */
.v2-footer {
  display: block !important;
}

/* ─── 7. Hint «← свайп →» под секцией шагов на мобиле ─── */
.v2-svc-steps-hint {
  display: none;
  text-align: center;
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  margin-top: -8px;
  padding-bottom: 18px;
  letter-spacing: .04em;
  user-select: none;
}
@media (max-width: 768px) {
  .v2-svc-steps-hint { display: block; }
}

/* ─── 8. Hero-art: убираем покачивание, оставляем zoom на hover ─── */
.v2-hero-art {
  animation: none !important;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.v2-hero-art:hover { transform: translateY(-50%) scale(1.05); }
.v2-hero-art::before { animation: none !important; }
@media (hover: none) {
  .v2-hero-art:hover { transform: translateY(-50%); }
}

/* ─── 11. Hero на главной: уменьшаем h1, чтобы слоган не наезжал на карту ─── */
@media (min-width: 900px) {
  .v2-hero h1 {
    font-size: clamp(1.6rem, 3.2vw, 40px) !important;
    line-height: 1.12 !important;
    letter-spacing: -.02em !important;
  }
}

/* ─── Anti-spam math-challenge в формах ─── */
.v2-challenge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, .03);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
}
.v2-challenge__label {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  opacity: .85;
}
.v2-challenge__input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .15);
  background: #fff;
  color: #1a2b24;
  font: inherit;
  font-size: 15px;
  width: 100%;
  max-width: 140px;
}
.v2-challenge__input:focus {
  outline: none;
  border-color: #6eb9a0;
  box-shadow: 0 0 0 3px rgba(110, 185, 160, .18);
}
/* Если форма на тёмном фоне (например, .v2-cta + .v2-form-card) — подстраиваемся */
.v2-form-card .v2-challenge {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .14);
}
.v2-form-card .v2-challenge__label {
  color: rgba(255, 255, 255, .85);
}

/* ─── Мобильное меню: ссылка-телефон золотом ─── */
.v2-mobile-nav__phone {
  margin-top: 18px;
  color: #C9A24B;
  font-weight: 700;
  border: none;
  font-size: 18px;
}

/* ─── 9. Шапка: «Контакты» — крайний правый пункт с акцентом ─── */
.v2-nav__contacts {
  margin-left: 12px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.v2-nav__contacts:hover {
  background-color: var(--accent, #6eb9a0);
  border-color: var(--accent, #6eb9a0);
  color: #fff;
}
@media (max-width: 1100px) {
  .v2-nav__contacts { margin-left: 6px; padding: 5px 10px; }
}

/* ─── 10. /o_nas.html — сетка соцсетей ─── */
.v2-onas-socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
@media (max-width: 900px) { .v2-onas-socials { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .v2-onas-socials { grid-template-columns: 1fr; } }
.v2-onas-soc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border, #dde5e0);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.v2-onas-soc:hover {
  border-color: var(--accent, #6eb9a0);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(11,61,52,.10);
}
.v2-onas-soc__icon {
  display: inline-block;
  width: 44px; height: 44px;
  flex-shrink: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.v2-onas-soc__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.v2-onas-soc__body strong {
  font-family: var(--ks-font-display, inherit);
  font-size: 1.05rem;
  color: var(--fg-1, #1a2b24);
}
.v2-onas-soc__body span {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--fg-3, #6a7770);
}
.v2-onas-soc__arrow {
  font-size: 18px;
  color: var(--fg-3, #6a7770);
  flex-shrink: 0;
  transition: transform .15s ease, color .15s ease;
}
.v2-onas-soc:hover .v2-onas-soc__arrow {
  color: var(--accent, #6eb9a0);
  transform: translateX(3px);
}

/* === hover-lift class — replaces inline onmouseover (CSP без unsafe-inline) === */
.hover-lift { transition: transform .15s ease-out; }
.hover-lift:hover { transform: translateY(-2px); }
