/* Prometey — современная страница сравнения */

#bx_catalog_compare_block {
    --compare-accent: #ed2f0b;
    --compare-accent-hover: #d92a09;
    --compare-text: #292929;
    --compare-muted: #777;
    --compare-border: #e5e5e5;
    --compare-soft-border: #eeeeee;
    --compare-background: #ffffff;
    --compare-row-alt: #fafafa;
    --compare-row-hover: #fff3ef;
    --compare-radius: 10px;
    --compare-name-column: 230px;
    --compare-product-column: minmax(250px, 1fr);

    box-sizing: border-box;
    padding: 0 0 70px;
    width: 100%;
}

#bx_catalog_compare_block *,
#bx_catalog_compare_block *::before,
#bx_catalog_compare_block *::after {
    box-sizing: border-box;
}

.compare-modern__container {
    width: 100%;
}

/* Разделы */

.compare-modern__sections {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.compare-modern__section-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--compare-border);
    border-radius: 7px;
    color: var(--compare-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    gap: 8px;
    min-height: 42px;
    padding: 9px 15px;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.compare-modern__section-button:hover {
    border-color: var(--compare-accent);
    color: var(--compare-accent);
}

.compare-modern__section-button.is-active {
    background: var(--compare-accent);
    border-color: var(--compare-accent);
    color: #fff;
}

.compare-modern__section-count {
    align-items: center;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 20px;
    display: inline-flex;
    font-size: 11px;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0 6px;
}

.compare-modern__section-button.is-active .compare-modern__section-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Верхняя панель */

.compare-modern__toolbar {
    align-items: center;
    background: var(--compare-background);
    border: 1px solid var(--compare-border);
    border-radius: var(--compare-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.035);
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    min-height: 62px;
    padding: 14px 18px;
}

.compare-modern__difference-switch {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    gap: 11px;
    margin: 0;
    user-select: none;
}

.compare-modern__difference-switch input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.compare-modern__switch-control {
    background: #d8d8d8;
    border-radius: 20px;
    height: 22px;
    position: relative;
    transition: background-color 0.2s ease;
    width: 40px;
}

.compare-modern__switch-control::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    content: "";
    height: 16px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.2s ease;
    width: 16px;
}

.compare-modern__difference-switch input:checked
    + .compare-modern__switch-control {
    background: var(--compare-accent);
}

.compare-modern__difference-switch input:checked
    + .compare-modern__switch-control::after {
    transform: translateX(18px);
}

.compare-modern__difference-switch input:focus-visible
    + .compare-modern__switch-control {
    outline: 2px solid rgba(237, 47, 11, 0.3);
    outline-offset: 3px;
}

.compare-modern__switch-label {
    color: var(--compare-text);
    font-size: 14px;
    font-weight: 500;
}

.compare-modern__clear {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--compare-muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    gap: 8px;
    letter-spacing: 0.03em;
    padding: 9px 11px;
    text-transform: uppercase;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.compare-modern__clear:hover {
    background: #fff1ed;
    color: var(--compare-accent);
}

.compare-modern__clear .svg {
    height: 13px;
    width: 13px;
order: 2;
}

.compare-modern__remove-product .svg {
top: 1px;
left: 1px;
}

.compare-modern__clear:hover svg path {
    fill: var(--compare-accent);
}

/* Контейнер сравнения */

.compare-modern__section {
    display: none;
}

.compare-modern__section.is-active {
    display: block;
}

.compare-modern__scroll {
    border: 1px solid var(--compare-border);
    border-radius: var(--compare-radius);
    box-shadow: 0 7px 26px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: #cfcfcf transparent;
    scrollbar-width: thin;
}

.compare-modern__scroll::-webkit-scrollbar {
    height: 9px;
}

.compare-modern__scroll::-webkit-scrollbar-thumb {
    background: #cfcfcf;
    border: 2px solid #fff;
    border-radius: 10px;
}

.compare-modern__scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* Сетка */

.compare-modern__grid {
    background: var(--compare-background);
    display: grid;
    grid-template-columns:
        var(--compare-name-column)
        repeat(var(--compare-items), var(--compare-product-column));
    min-width: calc(
        var(--compare-name-column)
        + (var(--compare-items) * 250px)
    );
}

/* Левый верхний угол */

.compare-modern__corner {
    align-items: center;
    background: #fafafa;
    border-bottom: 1px solid var(--compare-border);
    border-right: 1px solid var(--compare-border);
    color: var(--compare-muted);
    display: flex;
    font-size: 12px;
    font-weight: 600;
    left: 0;
    min-height: 365px;
    padding: 22px;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 5;
}

/* Карточка товара */

.compare-modern__product {
    background: #fff;
    border-bottom: 1px solid var(--compare-border);
    border-right: 1px solid var(--compare-border);
    display: flex;
    flex-direction: column;
    min-height: 365px;
    padding: 22px;
    position: relative;
}

.compare-modern__product:last-of-type {
    border-right: 0;
}

.compare-modern__remove-product {
    align-items: center;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 12px;
    top: 12px;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
    width: 30px;
    z-index: 2;
}

.compare-modern__remove-product:hover {
    background: #fff1ed;
    border-color: var(--compare-accent);
}

.compare-modern__remove-product .svg {
    height: 11px;
    width: 11px;
}

.compare-modern__remove-product:hover svg path {
    fill: var(--compare-accent);
}

.compare-modern__product-image {
    align-items: center;
    display: flex;
    height: 235px;
    justify-content: center;
    margin-bottom: 18px;
    overflow: hidden;
    width: 100%;
}

.compare-modern__product-image img {
    display: block;
    height: 100%;
    max-height: 235px;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
    width: 100%;
}

.compare-modern__product-image:hover img {
    transform: scale(1.025);
}

.compare-modern__product-content {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.compare-modern__product-name {
    color: var(--compare-text);
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    min-height: 44px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.compare-modern__product-name:hover {
    color: var(--compare-accent);
}

.compare-modern__product-price {
    color: var(--compare-text);
    font-size: 18px;
    font-weight: 700;
    margin-top: 14px;
}

/* Характеристики */

.compare-modern__property-name,
.compare-modern__property-value {
    align-items: center;
    border-bottom: 1px solid var(--compare-soft-border);
    display: flex;
    line-height: 1.45;
    min-height: 58px;
    padding: 13px 18px;
    transition: background-color 0.15s ease;
}

.compare-modern__property-name {
    background: #fafafa;
    border-right: 1px solid var(--compare-border);
    color: var(--compare-text);
    font-size: 13px;
    font-weight: 600;
    left: 0;
    position: sticky;
    z-index: 4;
}

.compare-modern__property-value {
    background: #fff;
    border-right: 1px solid var(--compare-soft-border);
    color: #505050;
    font-size: 13px;
    word-break: break-word;
}

.compare-modern__property-name.is-hovered,
.compare-modern__property-value.is-hovered {
    background: var(--compare-row-hover);
}

.compare-modern__grid > *:nth-last-child(-n + calc(var(--compare-items) + 1)) {
    border-bottom: 0;
}

/* Пустой результат */

.compare-modern__empty-title {
    background: #fafafa;
    border-right: 1px solid var(--compare-border);
    color: var(--compare-text);
    font-size: 13px;
    font-weight: 600;
    left: 0;
    min-height: 70px;
    padding: 22px;
    position: sticky;
    z-index: 4;
}

.compare-modern__empty {
    align-items: center;
    color: var(--compare-muted);
    display: flex;
    font-size: 14px;
    min-height: 70px;
    padding: 22px;
}

/* Планшеты */

@media (max-width: 991px) {
    #bx_catalog_compare_block {
        --compare-name-column: 200px;
        --compare-product-column: minmax(230px, 1fr);
    }

    .compare-modern__grid {
        min-width: calc(
            var(--compare-name-column)
            + (var(--compare-items) * 230px)
        );
    }

    .compare-modern__corner,
    .compare-modern__product {
        min-height: 330px;
    }

    .compare-modern__product-image {
        height: 205px;
    }

    .compare-modern__product-image img {
        max-height: 205px;
    }
}

/* Мобильные */

@media (max-width: 767px) {
    #bx_catalog_compare_block {
        --compare-name-column: 150px;
        --compare-product-column: 210px;

        padding-bottom: 40px;
    }

    .compare-modern__toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .compare-modern__clear {
        margin-left: -8px;
    }

    .compare-modern__grid {
        min-width: calc(
            var(--compare-name-column)
            + (var(--compare-items) * 210px)
        );
    }

    .compare-modern__corner,
    .compare-modern__product {
        min-height: 292px;
    }

    .compare-modern__corner {
        align-items: flex-end;
        font-size: 10px;
        padding: 14px 12px;
    }

    .compare-modern__product {
        padding: 15px 12px;
    }

    .compare-modern__remove-product {
        height: 27px;
        right: 8px;
        top: 8px;
        width: 27px;
    }

    .compare-modern__product-image {
        height: 165px;
        margin-bottom: 14px;
    }

    .compare-modern__product-image img {
        max-height: 165px;
    }

    .compare-modern__product-name {
        font-size: 12px;
        min-height: 52px;
    }

    .compare-modern__product-price {
        font-size: 15px;
        margin-top: 9px;
    }

    .compare-modern__property-name,
    .compare-modern__property-value {
        font-size: 11px;
        min-height: 60px;
        padding: 10px 11px;
    }
}