/* spot_compare.css — волна 9d переноса холста: сравнение объявлений (доска Compare, 04.10).
   Кнопка «Сравнить» на карточке и странице объявления, плавающая панель «Сравнить (N)», страница /compare.
   Цвета и размеры только из токенов spot_ui.css. Мобильный вид первичен: без hover-зависимостей, безопасные зоны, зона касания 44px. */

/* ---------- Кнопка «Сравнить» ---------- */
.spot-cmp-btn {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--spot-ink);
    font-family: var(--spot-font);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.spot-cmp-btn:focus-visible,
.spot-cmp-bar a:focus-visible,
.spot-cmp-bar button:focus-visible,
.spot-cmp-page a:focus-visible,
.spot-cmp-page button:focus-visible,
.spot-cmp-scroll:focus-visible {
    outline: 2px solid var(--spot-focus);
    outline-offset: 2px;
}

/* на карточке: сосед ссылки под сердцем, зона касания 44px, белый круг 32px */
.spot-card .spot-card__cmp,
.spot-list-card .spot-card__cmp {
    position: absolute;
    left: 2px;
    top: 42px;
    z-index: 3;
    width: var(--spot-control-h);
    height: var(--spot-control-h);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spot-card__cmp .spot-cmp-ico {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    padding: 6px;
    border-radius: 50%;
    background: var(--spot-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.spot-card__cmp[aria-pressed="true"] .spot-cmp-ico {
    background: var(--spot-inv);
    color: var(--spot-on-inv);
}

.spot-card__cmp:active .spot-cmp-ico {
    transform: scale(.92);
}

/* избранное на телефоне — карточка строкой: сердце вверху, «Сравнить» под ним */
.spot-fav-grid .item-grid.spot-card .spot-card__cmp {
    top: 46px;
    left: 4px;
}

/* с текстом (страница объявления) */
.spot-cmp-btn--txt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--spot-control-h);
    padding: 0 14px;
    border: 1px solid var(--spot-line);
    border-radius: var(--spot-radius);
    background: var(--spot-surface);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.spot-cmp-btn--txt .spot-cmp-ico {
    width: 18px;
    height: 18px;
}

.spot-cmp-btn--txt[aria-pressed="true"] {
    border-color: var(--spot-ink);
    background: var(--spot-inv);
    color: var(--spot-on-inv);
}

/* страница объявления на телефоне: отдельная строка под датой */
.spot-ad-mcmp {
    margin: 12px 0 0;
}

.spot-ad-mcmp .spot-cmp-btn--txt {
    width: 100%;
}

/* ---------- Плавающая панель ---------- */
.spot-cmp-bar {
    position: fixed;
    right: calc(12px + var(--spot-safe-left, 0px));
    left: calc(12px + var(--spot-safe-right, 0px));
    bottom: calc(var(--spot-nav-h, 62px) + var(--spot-safe-bottom, 0px) + 8px);
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 8px;
    border-radius: var(--spot-radius-l);
    background: var(--spot-surface);
    box-shadow: 0 4px 20px rgba(20, 22, 26, 0.18);
    font-family: var(--spot-font);
    color: var(--spot-ink);
}

.spot-cmp-bar[hidden] {
    display: none;
}

/* страница объявления: над панелью контактов */
.spot-cmp-bar--ad {
    bottom: calc(var(--spot-nav-h, 62px) + var(--spot-safe-bottom, 0px) + 72px);
}

.spot-cmp-bar__txt {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
}

.spot-cmp-bar__hint {
    display: block;
    font-weight: 500;
    color: var(--spot-mut);
    font-size: 12.5px;
}

.spot-cmp-bar__go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--spot-control-h);
    padding: 0 18px;
    border-radius: var(--spot-radius);
    background: var(--spot-red);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.spot-cmp-bar__go:hover,
.spot-cmp-bar__go:focus {
    color: #fff;
    text-decoration: none;
}

.spot-cmp-bar__go[aria-disabled="true"] {
    background: var(--spot-field);
    color: var(--spot-mut);
    pointer-events: none;
}

.spot-cmp-bar__clear {
    flex: 0 0 auto;
    width: var(--spot-control-h);
    height: var(--spot-control-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--spot-radius);
    background: var(--spot-field);
    color: var(--spot-ink-2);
    cursor: pointer;
}

.spot-cmp-toast {
    position: fixed;
    right: 50%;
    bottom: calc(var(--spot-nav-h, 62px) + var(--spot-safe-bottom, 0px) + 76px);
    z-index: 1041;
    box-sizing: border-box;
    max-width: min(420px, calc(100vw - 24px));
    transform: translateX(50%);
    padding: 12px 16px;
    border-radius: var(--spot-radius);
    background: var(--spot-inv);
    color: #fff;
    font-family: var(--spot-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 19px;
    text-align: center;
}

.spot-cmp-toast[hidden] {
    display: none;
}

@media (min-width: 992px) {
    .spot-cmp-bar,
    .spot-cmp-bar--ad {
        right: auto;
        left: 24px;
        bottom: 24px;
        width: 380px;
    }

    .spot-cmp-toast {
        bottom: 96px;
    }
}

/* ---------- Страница /compare ---------- */
.spot-cmp {
    padding-bottom: calc(40px + var(--spot-safe-bottom, 0px));
}

.spot-cmp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.spot-cmp-h1 {
    flex: 1 1 auto;
    min-width: 0;
}

.spot-cmp-add {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--spot-control-h);
    padding: 0 4px;
    color: var(--spot-red-fg);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.spot-cmp-add:hover,
.spot-cmp-add:focus {
    color: var(--spot-red-dark-fg);
    text-decoration: none;
}

.spot-cmp-ctl {
    margin: 0 0 12px;
}

.spot-cmp-sw {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: var(--spot-control-h);
    padding: 0 16px;
    border: 0;
    border-radius: var(--spot-radius);
    background: var(--spot-surface);
    color: var(--spot-ink);
    font-family: var(--spot-font);
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    cursor: pointer;
}

.spot-cmp-sw__k {
    position: relative;
    flex: 0 0 auto;
    width: 51px;
    height: 31px;
    border-radius: 16px;
    background: var(--spot-field-border);
    transition: background-color .15s ease;
}

.spot-cmp-sw__k::after {
    content: "";
    position: absolute;
    right: 2px;
    top: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform .15s ease;
}

.spot-cmp-sw[aria-checked="true"] .spot-cmp-sw__k {
    background: var(--spot-green);
}

.spot-cmp-sw[aria-checked="true"] .spot-cmp-sw__k::after {
    transform: translateX(-20px);
}

@media (prefers-reduced-motion: reduce) {
    .spot-cmp-sw__k,
    .spot-cmp-sw__k::after {
        transition: none;
    }
}

.spot-cmp-note {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: var(--spot-radius);
    background: var(--spot-surface);
    color: var(--spot-ink-2);
    font-size: 14px;
    line-height: 20px;
}

/* «Все характеристики совпадают» видно только при включённом «Только различия» */
.spot-cmp .spot-cmp-allsame {
    display: none;
    margin: 12px 0 0;
}

.spot-cmp[data-diff="1"] .spot-cmp-allsame {
    display: block;
}

/* таблица: единственная область с горизонтальной прокруткой на странице */
.spot-cmp-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--spot-radius-l);
    background: var(--spot-surface);
}

.spot-cmp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: var(--spot-surface);
    color: var(--spot-ink);
    font-size: 14px;
    line-height: 19px;
}

.spot-cmp-table > thead > tr > th,
.spot-cmp-table > thead > tr > td,
.spot-cmp-table td,
.spot-cmp-table tbody th[scope="row"] {
    box-sizing: border-box;
}

/* первая колонка — подписи строк, липкая при горизонтальной прокрутке */
.spot-cmp-table .spot-cmp-corner,
.spot-cmp-table tbody th[scope="row"],
.spot-cmp-table tfoot th[scope="row"] {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 92px;
    min-width: 92px;
    background: var(--spot-surface);
}

.spot-cmp-table tbody th[scope="row"] {
    padding: 14px 16px 14px 8px;
    border-top: 1px solid var(--spot-line);
    color: var(--spot-mut);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    text-align: right;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.spot-cmp-table td,
.spot-cmp-table thead th.spot-cmp-ad {
    min-width: 124px;
    width: 124px;
    padding-right: 8px;
    padding-left: 8px;
    vertical-align: top;
    text-align: right;
}

.spot-cmp-table td {
    padding-top: 14px;
    padding-bottom: 14px;
    border-top: 1px solid var(--spot-line);
    overflow-wrap: break-word;
}

.spot-cmp-table td:last-child,
.spot-cmp-table thead th.spot-cmp-ad:last-child {
    padding-left: 16px;
}

/* 1–2 объявления занимают всю ширину, больше — прокрутка */
.spot-cmp-table[data-n="1"] td,
.spot-cmp-table[data-n="1"] thead th.spot-cmp-ad,
.spot-cmp-table[data-n="2"] td,
.spot-cmp-table[data-n="2"] thead th.spot-cmp-ad {
    width: auto;
}

.spot-cmp-table[data-n="3"],
.spot-cmp-table[data-n="4"] {
    width: max-content;
    min-width: 100%;
}

/* шапка таблицы: фото, название, цена */
.spot-cmp-table thead th.spot-cmp-ad {
    padding-top: 12px;
    padding-bottom: 12px;
    font-weight: 400;
}

.spot-cmp-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    margin-bottom: 8px;
    border-radius: var(--spot-radius);
    overflow: hidden;
    background: var(--spot-field);
}

.spot-cmp-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spot-cmp-photo__no {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--spot-mut);
}

.spot-cmp-x {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--spot-control-h);
    height: var(--spot-control-h);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
}

.spot-cmp-x .spot-cmp-ico {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 50%;
    background: rgba(27, 29, 33, 0.72);
}

.spot-cmp-x:hover,
.spot-cmp-x:focus {
    color: #fff;
    text-decoration: none;
}

.spot-cmp-title {
    display: block;
    color: var(--spot-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.spot-cmp-title:hover,
.spot-cmp-title:focus {
    color: var(--spot-ink);
    text-decoration: underline;
}

.spot-cmp-title--off {
    color: var(--spot-ink-2);
}

.spot-cmp-hint {
    display: block;
    margin-top: 4px;
    color: var(--spot-mut);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 17px;
}

.spot-cmp-hprice {
    display: block;
    margin-top: 6px;
}

.spot-cmp-hprice b {
    display: block;
    font-size: 16px;
    font-weight: 800;
    line-height: 20px;
}

.spot-cmp-hprice span {
    display: block;
    color: var(--spot-mut);
    font-size: 12.5px;
    line-height: 17px;
}

/* разделы */
.spot-cmp-sech th {
    position: static;
    padding: 18px 16px 6px;
    background: var(--spot-surface);
    color: var(--spot-ink-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .6px;
    text-align: right;
    text-transform: uppercase;
}

.spot-cmp-sech th span {
    position: sticky;
    right: 16px;
}

.spot-cmp-v {
    display: block;
    font-weight: 700;
}

.spot-cmp-v--price {
    font-size: 15px;
    font-weight: 800;
}

.spot-cmp-v2 {
    display: block;
    color: var(--spot-mut);
    font-size: 12.5px;
}

.spot-cmp-nd,
.spot-cmp-no,
.spot-cmp-off {
    color: var(--spot-mut);
    font-weight: 500;
}

.spot-cmp-yes {
    display: inline-flex;
    color: var(--spot-green-fg);
}

/* выделение по данным: подпись + значок, не только цвет */
.spot-cmp-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 2px 6px 2px 8px;
    border-radius: 10px;
    background: var(--spot-green-soft);
    color: var(--spot-green-fg);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 16px;
}

.spot-cmp-chip .spot-cmp-ico {
    flex: 0 0 auto;
}

.spot-cmp-table tfoot th,
.spot-cmp-table tfoot td {
    padding-top: 12px;
    padding-bottom: 16px;
    border-top: 1px solid var(--spot-line);
}

.spot-cmp-open {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--spot-control-h);
    padding: 0 8px;
    border: 1px solid var(--spot-line);
    border-radius: var(--spot-radius);
    color: var(--spot-ink);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.spot-cmp-open:hover,
.spot-cmp-open:focus {
    color: var(--spot-ink);
    text-decoration: none;
}

/* «Только различия»: строки и разделы без различий скрыты */
.spot-cmp[data-diff="1"] .spot-cmp-same,
.spot-cmp[data-diff="1"] .spot-cmp-sec-same {
    display: none;
}

/* пустое состояние */
.spot-cmp-empty {
    margin: 8px 0 0;
    padding: 40px 24px;
    border-radius: var(--spot-radius-l);
    background: var(--spot-surface);
    text-align: center;
}

.spot-cmp-empty__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--spot-red-soft);
    color: var(--spot-red-fg);
}

.spot-cmp-empty__t {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 800;
    line-height: 22px;
}

.spot-cmp-empty__s {
    margin: 0 auto 20px;
    max-width: 420px;
    color: var(--spot-ink-2);
    font-size: 14px;
    line-height: 20px;
}

.spot-cmp-empty__go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--spot-control-h-l);
    padding: 0 28px;
    border-radius: var(--spot-radius);
    background: var(--spot-red);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}

.spot-cmp-empty__go:hover,
.spot-cmp-empty__go:focus {
    color: #fff;
    text-decoration: none;
}

/* десктоп: таблица в карточке, колонки поровну */
@media (min-width: 992px) {
    .spot-cmp-scroll {
        margin: 0;
        border-radius: var(--spot-radius-l);
    }

    .spot-cmp-table {
        font-size: 15px;
    }

    .spot-cmp-table .spot-cmp-corner,
    .spot-cmp-table tbody th[scope="row"],
    .spot-cmp-table tfoot th[scope="row"] {
        width: 200px;
        min-width: 200px;
    }

    .spot-cmp-table tbody th[scope="row"] {
        padding: 16px 24px 16px 12px;
        font-size: 14px;
        line-height: 19px;
    }

    .spot-cmp-table td,
    .spot-cmp-table thead th.spot-cmp-ad {
        min-width: 200px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .spot-cmp-table td {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .spot-cmp-table td:last-child,
    .spot-cmp-table thead th.spot-cmp-ad:last-child {
        padding-left: 24px;
    }

    .spot-cmp-table thead th.spot-cmp-ad {
        padding-top: 20px;
    }

    .spot-cmp-sech th {
        padding: 22px 24px 8px;
    }

    .spot-cmp-sech th span {
        right: 24px;
    }

    .spot-cmp-ctl {
        max-width: 360px;
    }

    .spot-cmp-photo {
        aspect-ratio: 16 / 10;
    }

    .spot-cmp-title {
        font-size: 15px;
        line-height: 20px;
    }

    .spot-cmp-hprice b {
        font-size: 18px;
        line-height: 22px;
    }
}
