/* Сторінка порівняння товарів - Start */

/* Заголовок сторінки - Start */
.compare-header {
    padding-top: 30px;
    padding-bottom: 30px;
}
.compare-header .page-title {
    text-align: left;
}
/* Заголовок сторінки - End */

/* Основний контейнер - Start */
.compare-content {
    padding-bottom: 100px;
    background: var(--white);
}
.compare-inner {
    display: flex;
    gap: var(--blocks-indent);
    align-items: flex-start;
}
/* Основний контейнер - End */

/* Бічна панель - Start */
.compare-sidebar {
	width: 300px;
	background: var(--white);
	border-radius: var(--border-radius-15);
	padding: 20px;
	position: sticky;
	top: calc(var(--header-height) + 30px);
    border: 1px solid var(--border);
}

.compare-sidebar .h4 {
    margin-bottom: 25px;
    font-size: 20px;
    line-height: 24px;
}

.categories-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 180px;
    overflow: auto;
    padding-right: 15px;
}

.category-item {
    display: flex;
}

.category-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-label input[type="radio"] {
    display: none;
}

.category-label input[type="radio"] + .category-name {
    position: relative;
    padding-left: 28px;
    color: var(--black);
    font-size: 16px;
    line-height: 20px;
    transition: all 0.3s ease;
}

.category-label input[type="radio"] + .category-name:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.category-label input[type="radio"] + .category-name:after {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.category-label input[type="radio"]:checked + .category-name {
    color: var(--primary);
}

.category-label input[type="radio"]:checked + .category-name:before {
    border-color: var(--primary);
}

.category-label input[type="radio"]:checked + .category-name:after {
    opacity: 1;
}

.category-count {
    font-size: 14px;
    color: var(--gray);
    margin-left: auto;
}

.sidebar-actions {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.clear-all-btn {
    width: 100%;
    justify-content: center;
}

.clear-all-btn:hover {
    background: var(--primary-hover);
}
/* Бічна панель - End */

/* Основний контент - Start */
.compare-main {
    width: calc(100% - 300px - var(--blocks-indent));
    background: var(--white);
    border-radius: var(--border-radius-15);
}

/* Слайдер товарів - Start */
.compare-products-section {
    position: relative;
    margin-bottom: 0;
}

.compare-products-swiper,
.compare-characteristics-swiper {
    overflow: hidden;
}

.compare-products-swiper .swiper-slide,
.compare-characteristics-swiper .swiper-slide {
    width: calc((100% - var(--side-bar) - var(--blocks-indent-category)) / var(--products-in-col) - var(--products-indent-w) * (var(--products-in-col) - 1) / var(--products-in-col));
    box-sizing: border-box;
}

/* Позиционируем кнопку удаления */
.compare-product-slide {
    position: relative;
}

.compare-product-slide .product-card {
    height: 100%;
}

.compare-product-slide .product-remove {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 29px;
    height: 29px;
    padding: 0;
    background: var(--red);
    border: none;
    border-radius: var(--border-radius-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.compare-product-slide .product-remove:hover {
    background: var(--red-hover);
}

.compare-product-slide .product-remove img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
}

/* Скрываем кнопку "В корзину" на странице сравнения */
.compare-product-slide .product-card .product_type_simple,
.compare-product-slide .product-card .product_type_variable,
.compare-product-slide .product-card .add_to_cart_button {
    display: none !important;
}

/* Делаем кнопку сравнения активной */
.compare-product-slide .product-card .compare-btn {
    display: none !important;
}

/* Кнопки слайдера */
.compare-products-section .swiper-buttons {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: calc(100% + 20px) !important;
    left: -10px;
    justify-content: space-between;
    pointer-events: none;
    z-index: 3;
}

.compare-products-section.show-navigation .swiper-buttons {
    display: flex;
}

.compare-products-section .swiper-buttons > div {
    pointer-events: all;
}
/* Слайдер товарів - End */

/* Характеристики на всю ширину - Start */
.compare-characteristics-full {
    margin-top: 50px;
}

.compare-characteristics-full.show {
    display: block;
}

.compare-characteristics-full .h4 {
    margin-bottom: 25px;
    font-size: 20px;
    line-height: 24px;
}

.characteristics-table-wrapper {
    position: relative;
    overflow: hidden;
}

#characteristics-table {
    display: flex;
    flex-direction: column;
}

/* Стили для рядка характеристик */
.characteristic-row {
    display: flex;
    min-height: 45px;
    gap: var(--blocks-indent);
}

.characteristic-row:last-child {
    border-bottom: none;
}

.characteristic-label {
    position: sticky;
    left: 0;
    width: 300px;
    padding: 14px 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    font-size: 16px;
    z-index: 2;
}

.characteristic-values-container {
    width: calc(100% - 300px - var(--blocks-indent));
    overflow: hidden;
    position: relative;
}

.characteristic-values-wrapper {
	display: flex;
	width: max-content;
	gap: var(--blocks-indent);
	transition: transform 0.3s ease;
}

.characteristic-value {
    width: calc(
		(var(--full-width) - var(--blocks-indent) - 300px - var(--scroll-bar)) / 5 - (var(--blocks-indent) * 4 / 5) - 8px
		);

    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-align: center;
}
.characteristic-row:nth-child(odd) .characteristic-value {
	background: var(--light-gray);
	border-radius: 10px;
}
.characteristic-row:nth-child(odd) .characteristic-label {
	background: var(--light-gray);
	border-radius: 10px;
}
/* Характеристики на всю ширину - End */

/* Порожнє повідомлення */
.compare-empty-message {
    display: none;
    padding: 80px 20px;
    text-align: center;
}

.compare-empty-message.show {
    display: block;
}

.compare-empty-message .empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.compare-empty-message img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.compare-empty-message .h3 {
    margin-bottom: 10px;
    color: var(--black);
}

.compare-empty-message p {
    margin-bottom: 30px;
    color: var(--gray);
    line-height: 1.5;
}

/* Завантаження */
.compare-loading {
    display: none;
    padding: 80px 20px;
    text-align: center;
}

.compare-loading.show {
    display: block;
}

.compare-loading .loader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Адаптивні стилі */
@media (max-width: 1480px) {
    .compare-sidebar {
        flex: 0 0 240px;
        padding: 25px;
    }
    
    .compare-products-swiper .swiper-slide,
    .characteristic-value {
        width: calc((100% - var(--side-bar) - var(--blocks-indent-category)) / 4 - var(--products-indent-w) * 3 / 4);
    }
}

@media (max-width: 1279px) {
    .compare-page {
        padding-top: 20px;
        padding-bottom: 60px;
    }
    
    .compare-inner {
        flex-direction: column;
        gap: 20px;
    }
    
    .compare-sidebar {
        position: static;
        flex: none;
        width: 100%;
    }
    
    .compare-main {
        width: 100%;
    }
    
    .compare-characteristics {
        position: relative;
        left: auto;
        right: auto;
        width: 100%;
        margin-top: 30px;
    }
    
    .characteristic-label {
        flex: 0 0 150px;
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .compare-products-swiper .swiper-slide {
        width: calc((100% - var(--blocks-indent-category)) / 3 - var(--products-indent-w) * 2 / 3);
    }
    
    .compare-characteristics-full .characteristic-value {
        width: calc((100% - 150px - 20px) / 3 - var(--products-indent-w) * 2 / 3);
    }
}

@media (max-width: 1024px) {
    .compare-products-swiper .swiper-slide,
    .characteristic-value {
        width: calc((100% - var(--blocks-indent-category)) / 2 - var(--products-indent-w) / 2);
    }
}

@media (max-width: 768px) {
    .compare-sidebar {
        padding: 20px;
    }
    
    .compare-main {
        padding: 20px;
    }
    
    .characteristic-label {
        flex: 0 0 120px;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .compare-products-swiper .swiper-slide,
    .characteristic-value {
        width: calc(100vw - var(--container-indent) - 120px);
        min-width: 200px;
    }
    
    .characteristic-value {
        font-size: 14px;
        padding: 10px 15px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Сторінка порівняння товарів - End */