/* Мультилендинг импортёра (Р-4 — PDL-607; план — ИТОГ PDL-603, раздел 4 «по макетам»): попап «Контакты» /
   «Выберите ближайшего дилера» — список шоурумов поверх карты. Подключается только у мультилендинга (site.html),
   обычный лендинг этот файл не грузит.

   Вид — эталонный макет dealer-popups-multilanding.html (вложение PDL-603) и его перенос в код U7 Ver_5
   (u7-contacts-V5-bez-klyucha.html, стили uc-sr-*, строки 280–575): компьютер — окно до 940 px, карта на всё окно,
   справа поверх неё панель списка 368 px; телефон (≤ 640 px) — попап на весь экран, карта сверху 38dvh (не меньше
   220 px), под ней поиск и список, кнопка «Развернуть карту» (68dvh). Основа окна (затемнение, шапка, крестик) —
   общие стили #uc-contacts-popup из site.css. Палитра — на корне попапа, как в U7. */

#uc-contacts-popup.--list {
    --ink-2: #4a4b4d;
    --ink-muted: #7a7b7d;
    --line-strong: #dcdad7;
    --surface-2: #f6f5f3;
    --surface-active: #faf9f7;
    --surface-selected: #fdf3f3;
    font-family: Arial, sans-serif;
}
#uc-contacts-popup.--list .uc-contacts-sheet { width: min(940px, 100%); height: auto; max-height: 100%; }
#uc-contacts-popup.--list .uc-contacts-title:focus { outline: none; }
#uc-contacts-popup.--list .uc-contacts-body {
    flex: none;
    height: 600px;
    height: min(600px, calc(100vh - 140px));
    min-height: 420px;
}

/* ---- Карта ---- */
.uc-sr-map { position: absolute; inset: 0; background: #f2f2f2; }
.uc-sr-map [class$="ground-pane"] { filter: grayscale(1); }
#uc-contacts-popup.--sr-error .uc-sr-map { visibility: hidden; }
.uc-sr-mapfail, .uc-sr-expand { display: none; }
#uc-contacts-popup.--map-failed .uc-sr-mapfail {
    display: block;
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 3;
    padding: 10px 14px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(17, 18, 20, 0.18);
    font-size: 14px;
    color: var(--ink-2);
}

/* ---- Панель списка ---- */
.uc-sr-panel {
    position: absolute;
    top: 24px;
    right: 24px;
    bottom: 76px;
    z-index: 4;
    width: 368px;
    max-width: calc(100% - 48px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(17, 18, 20, 0.22);
    overflow: hidden;
}

/* ---- Поиск ---- */
.uc-sr-search { flex: none; padding: 20px 24px 12px; }
#uc-contacts-popup.--sr-error .uc-sr-search { display: none; }
.uc-sr-searchbox { position: relative; display: flex; align-items: center; }
.uc-sr-searchicon { position: absolute; left: 13px; pointer-events: none; }
#uc-contacts-popup .uc-sr-input {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 40px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: #ffffff;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#uc-contacts-popup .uc-sr-input:focus { border-color: var(--ink); }
#uc-contacts-popup .uc-sr-input::placeholder { color: var(--ink-label); }
#uc-contacts-popup .uc-sr-input:disabled { background: var(--surface-2); }
.uc-sr-clear {
    display: none;
    position: absolute;
    right: 6px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-muted);
    font-size: 14px;
    cursor: pointer;
}
.uc-sr-clear:hover { background: #f4f2ef; }
.uc-sr-searchbox--filled .uc-sr-clear { display: flex; }

/* ---- Список ---- */
.uc-sr-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#uc-contacts-popup:not(.--sr-ready) .uc-sr-list { display: none; }
.uc-sr-ghead {
    display: flex;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}
.uc-sr-city { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.uc-sr-count { font-size: 12px; color: var(--ink-label); }
.uc-sr-item { border-top: 1px solid var(--line); background: #ffffff; }
.uc-sr-item:hover, .uc-sr-item--active { background: var(--surface-active); }
.uc-sr-item--selected, .uc-sr-item--selected:hover { background: var(--surface-selected); }
.uc-sr-item--hidden, .uc-sr-group--hidden { display: none; }
#uc-contacts-popup .uc-sr-head {
    display: flex;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 14px 24px;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}
#uc-contacts-popup .uc-sr-head:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.uc-sr-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #d3d1ce; }
.uc-sr-item--active .uc-sr-dot, .uc-sr-item--selected .uc-sr-dot { background: var(--accent); }
.uc-sr-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.uc-sr-tag {
    display: none;
    margin-bottom: 2px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}
.uc-sr-item--selected .uc-sr-tag { display: block; }
.uc-sr-name { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.uc-sr-addr { font-size: 14px; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere; }
.uc-sr-details { display: none; flex-direction: column; gap: 12px; padding: 0 24px 16px 46px; }
.uc-sr-item--active .uc-sr-details { display: flex; }
.uc-sr-status { font-size: 14px; line-height: 1.3; color: var(--ink-muted); }
.uc-sr-row { display: flex; flex-direction: column; gap: 3px; }
.uc-sr-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-label); }
.uc-sr-value { font-size: 14px; line-height: 1.4; color: var(--ink); white-space: pre-line; }
.uc-sr-nomap { font-size: 13px; color: var(--ink-label); }
#uc-contacts-popup .uc-sr-phone { font-size: 17px; font-weight: 700; color: var(--ink); text-decoration: none; }
#uc-contacts-popup .uc-sr-phone:hover { color: var(--accent); }
#uc-contacts-popup .uc-sr-choose {
    width: 100%;
    height: 46px;
    min-height: 44px;
    margin: 2px 0 0;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
#uc-contacts-popup .uc-sr-choose:hover { background: #b80f16; }
#uc-contacts-popup .uc-sr-choose:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- Состояния: ничего не найдено, загрузка, ошибка ---- */
.uc-sr-nomatch { display: none; flex-direction: column; gap: 6px; padding: 28px 24px; border-top: 1px solid var(--line); }
.uc-sr-nomatch--show { display: flex; }
.uc-sr-nomatch-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.uc-sr-nomatch-text { font-size: 14px; line-height: 1.4; color: var(--ink-muted); }
.uc-sr-loading, .uc-sr-error { display: none; }
#uc-contacts-popup.--sr-loading .uc-sr-loading { display: flex; flex-direction: column; gap: 14px; padding: 8px 24px 24px; }
.uc-sr-loading-text { font-size: 14px; color: var(--ink-muted); }
.uc-sr-bar { position: relative; height: 14px; border-radius: 6px; background: #efedea; overflow: hidden; }
.uc-sr-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: translateX(-100%);
    animation: uc-sr-shimmer 1.2s infinite;
}
.uc-sr-bar--short { width: 60%; }
@keyframes uc-sr-shimmer { to { transform: translateX(100%); } }
#uc-contacts-popup.--sr-error .uc-sr-error {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    padding: 28px 24px;
}
.uc-sr-error-text { font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--ink); }
#uc-contacts-popup .uc-sr-retry {
    height: 44px;
    padding: 0 22px;
    border: 1px solid var(--ink);
    border-radius: 10px;
    background: var(--ink);
    color: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
#uc-contacts-popup .uc-sr-retry:disabled { opacity: 0.5; cursor: default; }
.uc-sr-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .uc-sr-bar::after { animation: none; }
    #uc-contacts-popup.--list .uc-sr-map { transition: none; }
}

/* ---- Телефон (≤ 640 px): карта сверху, список под ней (макет, строки 125–152; U7 V5, 530–575) ---- */
@media (max-width: 640px) {
    #uc-contacts-popup.--list .uc-contacts-sheet { height: 100%; max-height: none; }
    #uc-contacts-popup.--list .uc-contacts-head { padding: 14px 12px 14px 18px; }
    #uc-contacts-popup.--list .uc-contacts-close { width: 44px; height: 44px; }
    #uc-contacts-popup.--list .uc-contacts-body { display: flex; flex-direction: column; flex: 1; height: auto; min-height: 0; }
    #uc-contacts-popup.--list .uc-sr-map {
        position: relative;
        inset: auto;
        flex: none;
        height: 300px;
        height: 38dvh;
        min-height: 220px;
        transition: height 0.25s ease;
    }
    #uc-contacts-popup.--list.--map-expanded .uc-sr-map { height: 560px; height: 68dvh; }
    #uc-contacts-popup.--list .uc-sr-panel {
        position: static;
        flex: 1;
        min-height: 0;
        width: auto;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
    }
    #uc-contacts-popup.--list.--sr-ready .uc-sr-expand {
        display: flex;
        position: absolute;
        right: 12px;
        top: 244px;
        top: calc(max(38dvh, 220px) - 56px);
        z-index: 5;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(17, 18, 20, 0.22);
        cursor: pointer;
    }
    #uc-contacts-popup.--list.--map-expanded .uc-sr-expand { top: calc(68dvh - 56px); }
    .uc-sr-expand-off { display: none; }
    #uc-contacts-popup.--map-expanded .uc-sr-expand-on { display: none; }
    #uc-contacts-popup.--map-expanded .uc-sr-expand-off { display: block; }
    #uc-contacts-popup.--map-failed .uc-sr-mapfail { top: 12px; left: 12px; }
    .uc-sr-search { padding: 14px 18px 12px; }
    #uc-contacts-popup .uc-sr-head { padding-left: 18px; padding-right: 18px; }
    .uc-sr-ghead, .uc-sr-nomatch { padding-left: 18px; padding-right: 18px; }
    .uc-sr-details { padding: 0 18px 16px 40px; }
}

/* ---- Шаг 2: «Далее» без выбранного дилера (screen-3, раздел 4.3 п. 4) ----
   Кнопка — тем же приёмом, что у вкладки ЛК (gallery.css: uc-quiz-btn-next--inactive, aria-disabled); подсказка —
   строкой слева от кнопки, а на телефоне — над кнопками. */
#uc-gallery-custom .uc-calc-dealer-tip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    color: #8a8a8a;
}
#uc-gallery-custom .uc-calc-dealer-tip[hidden] { display: none; }
#uc-gallery-custom .uc-calc-dealer-tip svg { flex: none; }
@media (max-width: 640px) {
    #uc-gallery-custom .uc-calc-nav { flex-wrap: wrap; }
    #uc-gallery-custom .uc-calc-dealer-tip { order: -1; flex-basis: 100%; justify-content: flex-end; font-size: 13px; }
}
