.compare-page {
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 8px;
}

.compare-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
}

.compare-category {
    font-size: 1rem;
    font-weight: 500;
    color: #8a8f98;
}

.compare-controls {
    display: flex;
    align-items: center;
    gap: 18px;
}

.compare-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.compare-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.compare-clear {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compare-clear:hover {
    border-color: #bbb;
    color: #222;
}

/* Подсказка, когда в сравнении один товар */
.compare-hint {
    background: var(--primary-light-m);
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 16px;
}

/* Пустое состояние */
.compare-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.compare-empty p {
    margin-bottom: 8px;
}

.compare-empty-btn {
    display: inline-block;
    margin-top: 16px;
    background: var(--primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.compare-empty-btn:hover {
    background: var(--primary-h);
}

/* ===== ТАБЛИЦА СРАВНЕНИЯ ===== */
.compare-scroll {
    overflow-x: auto;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

.compare-table th,
.compare-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: top;
    font-size: 0.88rem;
    color: #333;
    font-weight: 400;
}

.compare-table tbody tr:last-child td {
    border-bottom: none;
}

/* Первая колонка: названия характеристик (липкая при горизонтальном скролле) */
.compare-attr-col {
    min-width: 170px;
    max-width: 220px;
    font-weight: 500;
    color: #555;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 1px 0 0 #f0f0f0;
}

/* Колонка товара */
.compare-product {
    min-width: 210px;
    max-width: 260px;
    position: relative;
}

.compare-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #f3f3f5;
    color: #777;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compare-remove:hover {
    background: #ffe3e3;
    color: #d33;
}

.compare-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding-right: 26px;
}

.compare-product-link img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    display: block;
    margin-bottom: 8px;
}

.compare-product-name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 500;
    color: #222;
    line-height: 1.35;
}

.compare-product-link:hover .compare-product-name {
    color: var(--primary-h);
}

.compare-product-price {
    margin: 8px 0;
}

.compare-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
}

.compare-price-old {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
    margin-right: 6px;
}

.compare-cart-btn {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.compare-cart-btn:hover {
    background: var(--primary-light-h);
}

.compare-cart-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.compare-out-of-stock {
    font-size: 0.85rem;
    color: #999;
}

/* Фильтр «Только различающиеся» */
.compare-table.only-diff tr.is-same {
    display: none;
}

/* ===== МОБИЛЬНЫЕ ===== */
@media (max-width: 768px) {
    .compare-page {
        padding: 115px 2px;
    }

    .compare-product {
        min-width: 135px;
    }
    .compare-attr-col {
        min-width: 120px;
    }

    .compare-product-link img {
        width: 70px;
        height: 70px;
    }
    .compare-attr-col { max-width: 140px;}
    .compare-table th, .compare-table td { padding: 10px 5px; }

}
@media (max-width: 420px) {

}