/* Шаг 2 конфигуратора (6.3б, PDL-60): об автомобиле, галерея, миниатюры, форма с вкладками.
   Перенос CSS блока U6 (landing/docs/tilda-blocks/Ver_4_dev/u6-gallery.html:3–947): галерея, характеристики,
   вкладки, «По телефону», согласие. Убраны лайтбокс (в U6 не открывался), мессенджеры, «Где открыть MAX»,
   вкладка ЛК с расчётом. Значения U6 подобраны под content-box — он и включается внутри #uc-gallery-custom
   (site.css ставит border-box всей странице). */
#uc-gallery-custom *, #uc-gallery-custom *::before, #uc-gallery-custom *::after { box-sizing: content-box; }
#uc-gallery-custom .uc-calc-input { box-sizing: border-box; }

#uc-gallery-custom {
    max-width: min(1000px, 85vw);
    margin: 0 auto;
    width: 100%;
    padding: 45px 0 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Главное фото */
.gal-main {
    position: relative;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 3/2;
    border-radius: 12px;
    background: #f5f5f5;
    overflow: hidden;
    margin-bottom: 6px;
}

/* Swiper внутри главного фото */
.uc-gal-swiper {
    width: 100%;
    height: 100%;
}
.uc-gal-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}
.uc-gal-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Кнопки навигации поверх фото */
.gal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 40px;
    border-radius: 8px;
    border: 0.5px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    transition: background 0.15s;
}
.gal-nav-btn:hover { background: rgba(255,255,255,0.28); }
.gal-nav-btn.prev { left: 12px; }
.gal-nav-btn.next { right: 12px; }

/* Миниатюры */
.gal-thumbs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}
.gal-thumb {
    aspect-ratio: 3/2;
    border-radius: 6px;
    background: #f5f5f5;
    background-size: cover;
    background-position: center;
    border: 0.5px solid #e0e0e0;
    cursor: pointer;
    transition: border-color 0.15s;
}
/* .gal-thumb.active { border: 1.5px solid #111; } */
.gal-thumb:hover { border-color: #bbb; }

/* ================================================================
   КВИЗ ШАГ 2: ХАРАКТЕРИСТИКИ + NAV
================================================================ */
.uc-specs-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    padding-bottom: 20px;
    border-bottom: 0.5px solid #efefef;
    margin-bottom: 20px;
}
.uc-selection-title {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #111111;
    margin-bottom: 12px;
}
.uc-specs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.uc-spec-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 8px 14px;
}
.uc-spec-value {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #111111;
    margin-bottom: 2px;
}
.uc-spec-label {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #888888;
}

/* Nav-кнопки шага 2 скоупятся под #uc-gallery-custom: шаг 1 (cards.css) объявляет те же классы. */
#uc-gallery-custom .uc-quiz-btn-next {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    border-radius: 6px;
    cursor: pointer;
    padding: 13px 32px;
    /* --uc-btn-next-bg ставит шаблон site.html из оформления марки. */
    background: var(--uc-btn-next-bg, #2D5467);
    color: #ffffff;
    border: none;
    white-space: nowrap;
}
/* nowrap: иначе «← НАЗАД» ломается на две строки на узких экранах */
#uc-gallery-custom .uc-quiz-btn-back {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    border-radius: 6px;
    cursor: pointer;
    padding: 13px 24px;
    background: transparent;
    color: #1a1a1a;
    border: 0.5px solid #d0d0d0;
    white-space: nowrap;
}
/* Hover светлее базового на +10.4 пункта светлоты (та же дельта, что была
   у пары #1a1a1a → #333333); тон и насыщенность базового сохранены.
   Цвет кнопки намеренно отвязан от акцента #51565C плашки и плиток. */
#uc-gallery-custom .uc-quiz-btn-next:hover {
    background: var(--uc-btn-next-bg-hover, #3C728D);
}
#uc-gallery-custom .uc-quiz-btn-back:hover {
    border-color: #888888;
    background: #f8f8f8;
}

/* Обёртка для выравнивания контента (совпадает с .configurator в cards.css) */
.configurator {
    max-width: min(1000px, 85vw);
    margin: 0 auto;
}

@media (max-width: 640px) {
    #uc-gallery-custom { max-width: 100%; padding-top: 30px; }
    .configurator { padding: 0 8px; max-width: 100%; }
    .uc-specs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .uc-specs::-webkit-scrollbar { display: none; }
    .uc-spec-card { flex-shrink: 0; border-radius: 7px; padding: 6px 11px; }
    .uc-spec-value { font-size: 15px; white-space: nowrap; }
    .uc-spec-label { font-size: 13px; white-space: nowrap; }

    /* Фейды для горизонтального скролла пиллсов */
    .uc-specs-scroll-wrap { position: relative; }
    .uc-specs-scroll-wrap::before,
    .uc-specs-scroll-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        width: 36px;
        height: 100%;
        pointer-events: none;
        z-index: 1;
        transition: opacity 0.18s;
        opacity: 0;
    }
    .uc-specs-scroll-wrap::before {
        left: 0;
        background: linear-gradient(to left, transparent, #fff);
    }
    .uc-specs-scroll-wrap::after {
        right: 0;
        background: linear-gradient(to right, transparent, #fff);
    }
    .uc-specs-scroll-wrap.show-left::before  { opacity: 1; }
    .uc-specs-scroll-wrap.show-right::after  { opacity: 1; }
}

/* ================================================================
   АДАПТИВ
================================================================ */
@media (max-width: 640px) {
    .gal-main {
        width: 100vw;
        margin-left: calc((100% - 100vw) / 2);
        border-radius: 0;
    }
    .gal-nav-btn { width: 24px; height: 36px; border-radius: 6px; font-size: 14px; }
    .gal-thumbs { gap: 4px; width: 100%; margin-left: 0; margin-right: 0; }
    .gal-thumb { border-radius: 5px; }
}

/* ================================================================
   СЕКЦИЯ «РАСЧЁТ ЦЕНЫ» — ниже .gal-thumbs
   Спецификация из макета Шаг_3_-_Спецификация.html
================================================================ */
.uc-calc-section {
    margin-top: 20px;
    border-top: 0.5px solid #efefef;
    padding: 20px 0 45px;
}
/* Заголовок-«мостик» — как .bridge шага 1, но со своими классами и без отступа 28px. */
.uc-calc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    margin-bottom: 10px;
}
.uc-calc-bridge-bar {
    width: 3px;
    height: 18px;
    background: #1a1a1a;
    border-radius: 2px;
    flex-shrink: 0;
}
.uc-calc-bridge-text {
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
/* Вкладки «Способ связи»: таб-бар сверху + общее тело активной вкладки снизу,
   единая рамка на весь блок (замена прежних раздельных карточек-кнопок). */
.uc-calc-tabs {
    position: relative;      /* якорь для затухания таб-бара на мобайле */
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 32px;
}
.uc-calc-tabbar {
    display: flex;
    background: #fafafa;
    border-bottom: 0.5px solid #e0e0e0;
    /* Три вкладки шире контейнера уже на планшете (641–990 px) — бар
       прокручивается на любой ширине; при запасе места прокрутки нет. */
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.uc-calc-tabbar::-webkit-scrollbar { display: none; }
.uc-calc-method-btn { flex-shrink: 0; }
.uc-calc-tabbar__filler { flex: 1; min-width: 0; }
.uc-calc-method-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    text-align: left;
    padding: 16px 22px;
    font-family: Arial, sans-serif;
    background: #fafafa;
    border: none;
    border-right: 0.5px solid #e0e0e0;
    margin-bottom: -0.5px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.uc-calc-method-btn--narrow { min-width: 230px; }
.uc-calc-method-btn:hover { background: #f1f1f1; }
.uc-calc-method-btn.uc-calc-method-btn--active {
    background: #fff;
    box-shadow: inset 0 3px 0 #1a1a1a;
}
.uc-calc-method-btn.uc-calc-method-btn--active:hover { background: #fff; }
.uc-calc-method-emoji { font-size: 24px; line-height: 1; flex-shrink: 0; }
.uc-calc-method-name { display: block; font-size: 15px; font-weight: 600; color: #7a7a7a; }
.uc-calc-method-btn.uc-calc-method-btn--active .uc-calc-method-name { color: #1a1a1a; }
.uc-calc-method-desc { display: block; font-size: 12px; color: #8a8a8a; line-height: 1.45; }
.uc-calc-tabpanel { padding: 26px 24px 28px; background: #fff; }
.uc-calc-phone-section { margin-bottom: 0; }
.uc-calc-phone-hint {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #8a8a8a;
    margin: 0 0 18px;
    line-height: 1.5;
}
.uc-calc-phone-row { display: flex; gap: 16px; }
.uc-calc-phone-field { flex: 1; }
.uc-calc-phone-label {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}
.uc-calc-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.uc-calc-input:focus { border-color: #1a1a1a; }
.uc-calc-input.uc-calc-input--error { border-color: #d00; }
.uc-calc-agreements { margin-top: 20px; margin-bottom: 0; }
.uc-calc-agr-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #6a6a6a;
    line-height: 1.55;
}
.uc-calc-agr-item:last-child { margin-bottom: 0; }
.uc-calc-agr-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #c4c4c4;
    border-radius: 4px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
    margin-top: 1px;
    cursor: pointer;
}
.uc-calc-agr-item.uc-agr-checked .uc-calc-agr-check { border-color: #1a1a1a; }
/* Отказ из-за неотмеченного согласия. Скоупим под #uc-gallery-custom
   (правило про склейку CSS блоков из CLAUDE.md) и ставим ниже правила
   .uc-agr-checked: отмеченный пункт ошибочным не бывает, но если
   классы всё же окажутся вместе, красная рамка должна победить. */
#uc-gallery-custom .uc-calc-agr-item--error .uc-calc-agr-check { border-color: #d00; }
.uc-calc-agr-check::after {
    content: '';
    display: none;
    width: 11px;
    height: 6px;
    border-left: 2px solid #1a1a1a;
    border-bottom: 2px solid #1a1a1a;
    transform: rotate(-45deg) translateY(-2px);
}
.uc-calc-agr-item.uc-agr-checked .uc-calc-agr-check::after { display: block; }
.uc-calc-agr-text { flex: 1; }
.uc-calc-agr-text a { color: #8a8a8a; text-decoration: underline; text-underline-offset: 2px; }
.uc-calc-agr-text a:hover { color: #1a1a1a; }
/* Ссылки на попапы «Политика» и «Согласие» (site.js открывает <dialog> по data-dialog) */
#uc-gallery-custom .uc-calc-agr-text .link {
    background: none; border: 0; padding: 0; font: inherit; color: #8a8a8a; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
#uc-gallery-custom .uc-calc-agr-text .link:hover { color: #1a1a1a; }
/* Тестовый режим (ответ владельца 21.10, Р6): текст вкладок «В чате», «ЛК покупателя»
   и итог «По телефону» — заявка не отправляется. */
.uc-calc-stub { font-family: Arial, sans-serif; font-size: 14px; color: #8a8a8a; margin: 0; line-height: 1.5; }
.uc-calc-result {
    display: none; margin-top: 16px; padding: 14px 16px; border-radius: 10px;
    background: #f5f5f5; border: 0.5px solid #e0e0e0;
    font-family: Arial, sans-serif; font-size: 14px; line-height: 1.5; color: #1a1a1a;
}
.uc-calc-result.--visible { display: block; }
.uc-calc-result b { display: block; }
.uc-calc-result a { color: inherit; font-weight: 700; }
.uc-calc-error {
    display: none;
    color: #d00;
    font-family: Arial, sans-serif;
    font-size: 13px;
    margin-top: 10px;
}
.uc-calc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 36px;
}

/* Таб-бар прокручивается только по горизонтали. При overflow-x: auto
   браузер вычисляет overflow-y тоже в auto, а кнопки нарочно заходят
   на нижнюю рамку бара (margin-bottom -0.5px) — у бара появляется
   вертикальный ход в полпикселя. Колесо и трекпад над баром захватывал
   он, а не страница: содержимое бара сдвигалось вверх, верхняя полоса
   активной вкладки срезалась (замер 2026-10-08, план 2026-10-08-001).
   hidden — не clip: при прокручиваемой оси x clip всё равно станет hidden. */
#uc-gallery-custom .uc-calc-tabbar { overflow-y: hidden; }

/* Затухание у края прокручиваемого таб-бара: подсказывает, что за
   краем есть вкладки. Классы is-fit / is-mid / is-end и высоту бара
   (--uc-tabbar-h: под content-box она больше, чем в макете) ставит JS
   по прокрутке и размеру. */
#uc-gallery-custom .uc-calc-tabs::before,
#uc-gallery-custom .uc-calc-tabs::after {
    content: ''; position: absolute; top: 0; height: var(--uc-tabbar-h, 58px); width: 28px;
    pointer-events: none; z-index: 1; transition: opacity .2s;
}
#uc-gallery-custom .uc-calc-tabs::after { right: 0; background: linear-gradient(to right, rgba(250,250,250,0), #fafafa); }
#uc-gallery-custom .uc-calc-tabs::before { left: 0; background: linear-gradient(to left, rgba(250,250,250,0), #fafafa); opacity: 0; }
#uc-gallery-custom .uc-calc-tabs.is-end::after { opacity: 0; }
#uc-gallery-custom .uc-calc-tabs.is-mid::before,
#uc-gallery-custom .uc-calc-tabs.is-end::before { opacity: 1; }
#uc-gallery-custom .uc-calc-tabs.is-fit::before,
#uc-gallery-custom .uc-calc-tabs.is-fit::after { opacity: 0; }

@media (max-width: 640px) {
    .uc-calc-title { padding: 10px 0; margin-bottom: 20px; }
    .uc-calc-bridge-bar { height: 16px; }
    .uc-calc-bridge-text { font-size: 16px; }
    .uc-calc-tabs { margin-bottom: 24px; }
    .uc-calc-tabbar__filler { display: none; }
    /* Три вкладки в 390 px не делятся поровну — таб-бар прокручивается
       (макет uc-calc-lk-mockup.html), подписи в одну строку. */
    .uc-calc-method-btn { flex: 0 0 auto; min-width: 0; padding: 13px 14px; min-height: 58px; gap: 8px; }
    .uc-calc-method-btn--narrow { min-width: 0; }
    .uc-calc-method-btn:last-of-type { border-right: none; }
    .uc-calc-method-emoji { font-size: 22px; }
    .uc-calc-method-name { font-size: 14px; white-space: nowrap; }
    .uc-calc-method-desc { font-size: 11px; white-space: nowrap; }
    .uc-calc-tabpanel { padding: 16px 12px 18px; }
    .uc-calc-agr-item { font-size: 12px; margin-bottom: 24px; }
    .uc-calc-agr-check { width: 18px; height: 18px; }
    .uc-calc-phone-row { flex-direction: column; gap: 10px; }
    .uc-calc-input { font-size: 14px; padding: 11px 12px; }
    .uc-calc-phone-label { font-size: 11px; }
    .uc-calc-phone-section { margin-bottom: 0; }
    .uc-calc-phone-hint { font-size: 13px; margin-bottom: 14px; }
}
