/* ==================== */
/* Кнопка сравнения в шапке */
/* ==================== */



.header-compare {
    position: relative;
    margin-left: 15px;
}

.compare-link {
    display: flex;
	margin-top: 3px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 37px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background-color: #fff;
    color: #555;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.compare-link:hover {
    border-color: #911519;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	text-decoration: none;
}

.compare-link:hover .fa-balance-scale {
    color: #911519;
}

.compare-link .fa-balance-scale {
    font-size: 18px;
    transition: color 0.3s ease;
}

.compare-link .compare-counter {
    position: absolute;
    top: -4px;
    right: -7px;
    background-color: #ab0f14;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
	padding-left: 6px;
	padding-top: 0px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
	font-size: 14px;
}

/* Адаптивность для кнопки в шапке */
@media (max-width: 961px) {
    .header-compare {
        margin-left: 10px;
    }
    
    .compare-link {
        width: 36px;
        height: 36px;
    }
    
    .compare-link .fa-balance-scale {
        font-size: 16px;
    }
    
    .compare-link .compare-counter {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}

/* ==================== */
/* Основные стили */
/* ==================== */
.cmp__container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

.cmp__title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

.cmp__empty {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #e0e3e8;
    border-radius: 8px;
    color: #6c757d;
    font-size: 16px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.03);
}

/* ==================== */
/* Таблица сравнения */
/* ==================== */
.cmp__table-wrapper {
    overflow-x: auto;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-radius: 8px;
    background: #fff;
}

.cmp__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.cmp__table-header {
    padding: 20px;
    text-align: center;
    vertical-align: top;
    background: #f8f9fa;
    border: 1px solid #e0e3e8;
    min-width: 250px;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
}

.cmp__table-header:first-child {
    position: relative;
    height: 450px; /* Соответствует высоте других заголовков */
    display: flex;
    flex-direction: column;
	font-size:20px;
}

.cmp__table-header:first-child .cmp__toggle-diff {
    margin-top: auto; /* Прижимает кнопку к низу */
    margin-bottom: 15px; /* Отступ от нижнего края */
    align-self: center; /* Центрирование по горизонтали */
    width: calc(100% - 40px); /* Ширина с учетом отступов */
    max-width: 450px; /* Максимальная ширина */
}



.cmp__property-row:nth-child(odd) {
    background-color: #f8f9fa;
}

.cmp__property-name {
    padding: 15px 20px;
    font-weight: 500;
    border: 1px solid #e0e3e8;
    white-space: nowrap;
    background: #f1f3f5;
    color: #2c3e50;
    font-size: 15px;
    width: 250px;
}

.cmp__property-value {
    padding: 15px 20px;
    border: 1px solid #e0e3e8;
    text-align: center;
    min-width: 250px;
    background: #fff;
    transition: background 0.2s;
}

.cmp__property-value:hover {
    background: #f5f7fa;
}

/* ==================== */
/* Карточка товара в таблице */
/* ==================== */
.cmp__product {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    height: 100%;
    box-sizing: border-box;
}

.cmp__product-image {
    margin-bottom: 20px;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.cmp__product-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cmp__product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.cmp__product-title {
    font-size: 16px;
    margin: 0 0 20px 0;
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.cmp__product-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.cmp__product-title a:hover {
    color: #0066cc;
    text-decoration: none;
}

/* ==================== */
/* Кнопки управления */
/* ==================== */
.cmp__remove-btn {
    background: #911519;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 15px;
}

.cmp__remove-btn:hover {
    background: #721217;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cmp__remove-btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.cmp__controls {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    gap: 15px;
}

.cmp__control-btn {
    background: #911519;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmp__control-btn:hover {
    background: #721217;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cmp__control-btn i {
    font-size: 16px;
}

/* ==================== */
/* Кнопка сравнения */
/* ==================== */
.compare-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

/* Иконка весов (по умолчанию) */
.compare-btn .fa-balance-scale {
    font-size: 18px;
    color: #555;
    transition: all 0.3s ease;
}

/* Иконка галочки (скрыта по умолчанию) */
.compare-btn .fa-check {
    position: absolute;
    font-size: 14px;
    color: white;
    display: none;
}

/* Состояние наведения */
.compare-btn:hover {
    border-color: #911519;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.compare-btn:hover .fa-balance-scale {
    color: #911519;
}

/* Активное состояние */
.compare-btn.active {
    border-color: #911519;
    background-color: #911519;
}

.compare-btn.active .fa-balance-scale {
	    color: #fff;
}

.compare-btn.active .fa-check {
    display: block;
}

/* Счетчик товаров */
.compare-btn .compare-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #911519;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.compare-btn.active .compare-counter {
    display: flex;
    background-color: white;
    color: #911519;
    border: 1px solid #911519;
}

.compare-btn.loading .fa-balance-scale {
    animation: fa-spin 1s infinite linear;
}

.compare-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.compare-btn:active {
    transform: translateY(0) !important;
}

/* ==================== */
/* Уведомления */
/* ==================== */
.compare-notification {
    position: fixed;
    bottom: 170px;
    right: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    padding: 15px 20px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.compare-notification__link {
    margin-left: 15px;
    color: #721217!important;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    border-bottom: 1px dashed #721217;
    transition: all 0.2s;
}

.compare-notification__link:hover {
    color: #721217;
    border-bottom-color: transparent;
}

.compare-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.compare-notification__inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compare-notification i {
    font-size: 20px;
}

.compare-notification.success i {
    color: #4CAF50;
}

.compare-notification.error i {
    color: #F44336;
}

.compare-notification a {
    margin-left: 15px;
    color: #2196F3;
    text-decoration: none;
}

.fa-spinner {
    margin-right: 5px;
    animation: fa-spin 2s infinite linear;
}

/* ==================== */
/* Анимации */
/* ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cmp__item {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

/* ==================== */
/* Адаптивность */
/* ==================== */
@media (max-width: 992px) {
    .cmp__table-header,
    .cmp__property-name,
    .cmp__property-value {
        min-width: 200px;
        width: 200px;
    }
    
    .cmp__product-image {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 768px) {
	
    .header-compare {
        margin-left: 10px;
    }
    
    .compare-link {
		margin-top: 7px;
		margin-right: 10px;
        width: 25px;
        height: 25px;
		color: black;
    }
    
    .compare-link .fa-balance-scale {
        font-size: 13px;
    }
    
    .compare-link .compare-counter {
        width: 16px;
        height: 16px;
        font-size: 10px;
		color: black;
		background-color: white;
		border: solid 1px #ab0f14;
		    padding-left: 4px;
    }
	
    .cmp__container {
        padding: 15px;
    }
    
    .cmp__table-header,
    .cmp__property-name,
    .cmp__property-value {
        min-width: 180px;
        width: 180px;
        padding: 12px 15px;
    }
    
    .cmp__product-image {
        width: 120px;
        height: 120px;
    }
    
    .cmp__remove-btn {
        padding: 8px 15px;
    }
    
    .compare-btn {
        width: 36px;
        height: 36px;
    }
    
    .compare-btn .fa-balance-scale {
        font-size: 16px;
    }
    
    .compare-btn .fa-check {
        font-size: 12px;
    }
    
    .compare-btn .compare-counter {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}

@media (max-width: 576px) {
	
	
    .cmp__title {
        font-size: 24px;
    }
    
    .cmp__table-header {
        height: auto;
        min-height: 400px;
    }
}


/* ==================== */
/* Стили для кнопки "Показать только отличающиеся" */
/* ==================== */
.cmp__controls-row {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e3e8;
}

.cmp__controls-cell {
    padding: 15px 20px;
    vertical-align: middle;
    background-color: #f1f3f5;
    border-right: 1px solid #e0e3e8;
    width: 250px;
}

.cmp__toggle-diff {
    display: inline-block;
    padding: 10px 20px;
    background-color: #911519;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.cmp__toggle-diff:hover {
    background-color: #721217;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cmp__toggle-diff.active {
    background-color: #721217;
}

.cmp__toggle-diff.active:hover {
    background-color: #721217;
}

.cmp__empty-cell {
    background-color: #f8f9fa;
    border-right: 1px solid #e0e3e8;
}

/* Адаптивность */
@media (max-width: 992px) {
    .cmp__table-header:first-child {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .cmp__table-header:first-child {
        height: 380px;
    }
    
    .cmp__table-header:first-child .cmp__toggle-diff {
        width: calc(100% - 30px);
        margin-bottom: 15px;
    }
}

/* Адаптивность для кнопки */
@media (max-width: 992px) {
    .cmp__controls-cell {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .cmp__controls-cell {
        width: 180px;
        padding: 12px 15px;
    }
    
    .cmp__toggle-diff {
        padding: 8px 15px;
        font-size: 13px;
    }
}

:root {
    --header-compare-right: 210px;
    --header-compare-top: 4px;
}

@media (max-width: 960px) {
    :root {
        --header-compare-right: 210px;
        --header-compare-top: 54px;
    }
	
@media (max-width: 767px) {
    :root {
        --header-compare-right: 115px;
        --header-compare-top: 4px;
    }
}

