﻿/* ==========================================================================
   AX UI — служебные блоки AUXILIUM
   Правило проекта: новые стили живут отдельным файлом, bootstrap и style.css
   не правятся. Все цвета — из токенов css/style.css (:root).

   Палитра сайта по факту (замерено в браузере):
     фон страницы  #191919   секции (шахматка) #0d0d0d / #0a0a0a
     карточки      #111111   акцент             #baa98f
   Поэтому блок внутри страницы делается ТЕМНЕЕ фона, а не светлее.
   ========================================================================== */

/* ==========================================================================
   1. ПРЕДВАРИТЕЛЬНЫЙ ИТОГ В КОНФИГУРАТОРЕ

   Занимает то же место, что заголовок «Настройте ваш экзоскелет»: заголовок
   остаётся в потоке и держит высоту, итог лежит поверх него и меняется
   перекрёстным затуханием. Поэтому появление итога не сдвигает ни один
   пиксель ниже.
   ========================================================================== */

.ax-cfg-head {
    position: relative;
    margin: 0 0 24px;
}

/* Отступ при автоскролле к конфигуратору при смене шага */
#configurator {
    scroll-margin-top: 16px;
}

.ax-cfg-head__title {
    margin: 0;
    transition: opacity .45s cubic-bezier(.22, 1, .36, 1),
                transform .45s cubic-bezier(.22, 1, .36, 1);
}

.ax-cfg-head__total {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px) scale(.985);
    pointer-events: none;
    transition: opacity .45s cubic-bezier(.22, 1, .36, 1),
                transform .45s cubic-bezier(.22, 1, .36, 1);
}

.ax-cfg-head.is-total .ax-cfg-head__title {
    opacity: 0;
    transform: translateY(-8px);
}

.ax-cfg-head.is-total .ax-cfg-head__total {
    opacity: 1;
    transform: none;
}

.ax-cfg-head__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ax-cfg-head__value {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: font-size .4s cubic-bezier(.22, 1, .36, 1);
}

/* --- Последний шаг: то же число становится главным --- */

.ax-cfg-head.is-final {
    min-height: 86px;
    margin-bottom: 6px;
}

.ax-cfg-head.is-final .ax-cfg-head__total {
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ax-cfg-head.is-final .ax-cfg-head__label {
    font-size: 10px;
    letter-spacing: 0.16em;
}

.ax-cfg-head.is-final .ax-cfg-head__value {
    font-size: 40px;
    letter-spacing: -0.02em;
}

/* На последнем шаге точки-индикатор не нужны: шаг уже крайний */
#configurator.is-final-step .steps-indicator {
    display: none;
}

#configurator .ax-final-note {
    margin: 0 0 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* «+X ₽» на карточках убраны там, где есть предварительный итог: наценки
   начисляются в конце, поэтому суммы с карточек не складывались в итог.
   На страницах без этого модуля цены на карточках остаются. */
[data-ax-total] .option-price {
    display: none;
}

/* Кнопка «Продолжить» появляется только после выбора — держим её место
   заранее, иначе блок конфигуратора прыгает по высоте */
.config-step .config-buttons {
    min-height: 44px;
    align-items: center;
}

/* ==========================================================================
   2. ВЫБОР КАНАЛА СВЯЗИ
   ========================================================================== */

.ax-channel {
    margin: 0 0 18px;
}

.ax-channel__label {
    display: block;
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ax-channel__opts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ax-channel__opt {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.ax-channel__opt input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.ax-channel__opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    font-size: 13.5px;
    line-height: 1;
    text-align: center;
    color: var(--text-secondary);
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.ax-channel__opt:hover span {
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.ax-channel__opt input:checked + span {
    border-color: var(--accent);
    background: rgba(186, 169, 143, 0.12);
    color: var(--text-primary);
}

.ax-channel__opt input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================================
   3. МОДАЛКА ЗАКАЗА
   ========================================================================== */

/* Мобильное меню (.slicknav_menu, z-index 9998) не должно лежать поверх модалки */
#orderModal {
    z-index: 10050;
}

#orderModal .modal-content {
    width: min(920px, 94vw);
    max-width: 920px;
    margin: 4vh auto;
    padding: 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

#orderModal .ax-mc__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    float: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
}

#orderModal .ax-mc__close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
}

/* --- Шапка --- */

#orderModal .ax-mc__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#orderModal .ax-mc__head img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(1) brightness(1.15);
    flex: 0 0 auto;
}

#orderModal .ax-mc__brand {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

#orderModal .ax-mc__meta {
    margin: 3px 0 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* --- Тело: заказ слева, форма справа --- */

#orderModal .ax-mc__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow-y: auto;
    min-height: 0;
}

#orderModal .ax-mc__col {
    padding: 24px 32px 28px;
}

#orderModal .ax-mc__col--order {
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

#orderModal .ax-mc__eyebrow {
    margin: 0 0 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#orderModal .ax-mc__eyebrow--divider {
    margin: 22px 0 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

#orderModal .ax-mc__title {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--text-primary);
}

#orderModal .configuration-details {
    margin: 0 0 16px;
}

#orderModal #selected-configuration {
    margin: 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

#orderModal .ax-mc__note {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
}

/* --- Что дальше --- */

#orderModal .ax-mc__steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

#orderModal .ax-mc__steps li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--text-secondary);
}

#orderModal .ax-mc__steps li:last-child {
    margin-bottom: 0;
}

#orderModal .ax-mc__steps li span {
    flex: 0 0 auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--accent);
}

/* --- Поля формы --- */

#orderModal .ax-mc__fields {
    display: grid;
    gap: 12px;
}

#orderModal .ax-mc__fields input[type="text"],
#orderModal .ax-mc__fields textarea {
    margin: 0;
}

#orderModal .ax-mc__fields textarea {
    min-height: 86px;
    resize: vertical;
}

/* --- Подвал: сумма и кнопка в одну строку --- */

#orderModal .ax-mc__foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 16px 32px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

#orderModal .ax-mc__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

#orderModal .ax-mc__price-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

#orderModal #priceModal {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#orderModal .ax-mc__submit {
    flex: 0 0 auto;
    width: auto;
    min-width: 230px;
    padding: 0 28px;
}

#orderModal .ax-mc__privacy {
    flex: 1 1 100%;
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
}

#orderModal .ax-mc__privacy a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   4. ПОДПИСЬ ПОД ЦЕНОЙ ФЛАГМАНА
   ========================================================================== */

.flagship-price-note {
    flex-basis: 100%;
    margin: 10px 0 0;
    max-width: 40ch;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ==========================================================================
   5. НАГРУЗКА — куда уходит вес
   ========================================================================== */

.ax-load {
    background: #0d0d0d;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 76px 0;
}

.ax-load__grid {
    display: grid;
    grid-template-columns: minmax(260px, 5fr) 7fr;
    gap: 64px;
    align-items: end;
}

.ax-load__title {
    margin: 12px 0 14px;
    font-family: 'Libre Franklin', sans-serif;
    font-size: clamp(26px, 2.2vw, 32px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.ax-load__lead {
    margin: 0;
    max-width: 38ch;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.ax-load__chart-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ax-load__bar {
    display: flex;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.ax-load__seg {
    display: block;
    height: 100%;
    width: 0;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.ax-load__bar.is-inview .ax-load__seg {
    width: calc(var(--seg) * 1%);
}

.ax-load__seg--frame {
    background: var(--accent);
}

.ax-load__seg--body {
    background: rgba(255, 255, 255, 0.16);
}

.ax-load__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-top: 14px;
}

.ax-load__key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.ax-load__key i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex: 0 0 auto;
}

.ax-load__key--frame i {
    background: var(--accent);
}

.ax-load__key--body i {
    background: rgba(255, 255, 255, 0.3);
}

.ax-load__facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 56px 0 0;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ax-load__fact {
    padding: 0 32px;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.ax-load__fact:first-child {
    padding-left: 0;
    border-left: 0;
}

.ax-load__fact dt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 25px;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.ax-load__fact dd {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.ax-load__note {
    margin: 26px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ==========================================================================
   6. ФЛАГМАН — компактная версия, чтобы секция читалась без прокрутки
   ========================================================================== */

.flagship-section {
    padding: 56px 0;
    min-height: 0;
}

.flagship-wrapper {
    gap: 48px;
    align-items: center;
}

.flagship-media {
    position: static;
    top: auto;
}

.flagship-image-main {
    padding: 14px;
}

.flagship-image-main img {
    max-height: 330px;
}

.flagship-trust {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.trust-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 9px 10px;
    gap: 7px;
}

.trust-icon {
    width: 22px;
    height: 22px;
    font-size: 10px;
}

.trust-item span {
    font-size: 10.5px;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.flagship-specs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.f-spec {
    padding: 10px 10px 12px;
    gap: 3px;
}

.f-spec > i {
    font-size: 11px;
    margin-bottom: 1px;
}

.f-spec-value {
    font-size: 20px;
}

.f-spec-value span {
    font-size: 11px;
}

.f-spec-label {
    font-size: 9.5px;
    letter-spacing: 0.06em;
    line-height: 1.3;
}

.flagship-header {
    margin-bottom: 8px;
}

.flagship-subtitle {
    margin-bottom: 12px;
}

.flagship-desc {
    margin-bottom: 18px;
}

.flagship-price-block {
    margin-bottom: 0;
}

.price-row {
    margin-bottom: 14px;
}

.flagship-price {
    font-size: 32px;
}

.flagship-price-note {
    margin-top: 6px;
}

/* ==========================================================================
   8. ШАПКА ТОВАРА — растворяется при переходе со шага 1

   Освобождает ~170 px по вертикали: конфигуратор поднимается и на длинных
   шагах перестаёт уезжать под фолд. Название модели остаётся в хлебных
   крошках, поэтому контекст не теряется.
   ========================================================================== */

.ax-ph {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .55s cubic-bezier(.4, 0, .2, 1);
}

.ax-ph__inner {
    overflow: hidden;
    min-height: 0;
}

.ax-ph__inner > * {
    transition: opacity .3s ease,
                filter .5s cubic-bezier(.4, 0, .2, 1),
                transform .5s cubic-bezier(.4, 0, .2, 1);
}

.ax-ph.is-hidden {
    grid-template-rows: 0fr;
}

.ax-ph.is-hidden .ax-ph__inner > * {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(-12px);
}

/* лёгкая лесенка: заголовок уходит первым, описание — следом */
.ax-ph.is-hidden .ax-ph__inner > :nth-child(1) {
    transition-delay: 0ms;
}

.ax-ph.is-hidden .ax-ph__inner > :nth-child(2) {
    transition-delay: 70ms;
}

@media (prefers-reduced-motion: reduce) {
    .ax-ph,
    .ax-ph__inner > * {
        transition: none;
    }
}

/* ==========================================================================
   9. АДАПТИВ
   ========================================================================== */

@media only screen and (max-width: 991px) {
    .ax-load {
        padding: 56px 0;
    }

    .ax-load__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .ax-load__lead {
        max-width: none;
    }

    .flagship-section {
        padding: 48px 0;
    }

    .flagship-wrapper {
        align-items: start;
    }

    .flagship-trust,
    .flagship-specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 767px) {
    .ax-load__facts {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 40px;
        padding-top: 0;
        border-top: 0;
    }

    .ax-load__fact {
        padding: 18px 0;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

    .ax-load__fact:first-child {
        padding-top: 0;
        border-top: 0;
    }

    .ax-load__bar {
        height: 48px;
    }

    #orderModal .modal-content {
        width: 94vw;
        margin: 3vh auto;
        max-height: 94vh;
    }

    #orderModal .ax-mc__head {
        padding: 16px 20px;
    }

    #orderModal .ax-mc__body {
        grid-template-columns: 1fr;
    }

    #orderModal .ax-mc__col {
        padding: 20px;
    }

    #orderModal .ax-mc__col--order {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    /* На телефоне сначала форма — сводка заказа идёт как подтверждение перед ценой */
    #orderModal .ax-mc__col--form {
        order: -1;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    #orderModal .ax-mc__foot {
        padding: 14px 20px 16px;
    }

    #orderModal .ax-mc__submit {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ax-load__seg {
        transition: none;
    }

    .ax-channel__opt span {
        transition: none;
    }
}

/* --- Две полосы нагрузки: ходьба (динамика) и стоя (статика) --- */
.ax-load__rows {
    display: grid;
    gap: 16px;
}

.ax-load__row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 16px;
}

.ax-load__mode {
    font-size: 14px;
    line-height: 1.2;
    color: var(--text-primary);
}

.ax-load__mode span {
    display: block;
    margin-top: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ax-load__row .ax-load__bar {
    height: 46px;
}

.ax-load__val {
    text-align: right;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ax-load__val span {
    margin-left: 2px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

@media (max-width: 575px) {
    .ax-load__row {
        grid-template-columns: 1fr auto;
        row-gap: 8px;
    }

    .ax-load__row .ax-load__bar {
        grid-column: 1 / -1;
        order: 3;
        height: 38px;
    }
}

/* Версия «Только спина»: наколенник крепится к ноге, поэтому скрыт */
#configurator.is-spine-only .ax-module-knee {
    display: none !important;
}
