/*
 Theme Name: Hello Elementor Child
 Theme URI: https://example.com/hello-elementor-child/
 Description: A custom child theme for Hello Elementor.
 Author: Your Name
 Author URI: https://yourwebsite.com
 Template: hello-elementor
 Version: 1.0.0
 Text Domain: hello-elementor-child
*/
/* Добавляйте свои кастомные CSS-стили сюда */

/* CSS Плавающей ПАНЕЛИ сравнения */
#compare-panel-container {
    position: fixed;
    bottom: 0px;
    /*центрирование*/
    left: 50%;
    transform: translateX(-50%) translateY(110%); /* Центрирование и скрытие снизу */
    
    width: 350px;
    height: 90px;
    background-color: #333;
    border: 1px solid grey;
    border-radius: 10px 10px 0px 0px;
    padding: 20px;
    box-sizing: border-box;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease-in-out;
}

#compare-panel-container.active {
    /* Панель появляется, двигаясь вверх */
    transform: translateX(-50%) translateY(0); 
}

/* --- Стили для счетчика и кнопок --- */
.compare-bar-msg {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
}

#compare-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    /*отступ снизу кнопок */
    margin-bottom: 15px; 
}

/* Стили для кнопок */
#compare-bar a {
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #b22222;
    background-color: transparent;
    border: none;
    padding: 0;
    transition: color 0.3s;
}

#compare-bar a:hover {
    color: #a51d1d;
}

/* --- Адаптация для мобильных устройств --- */
@media (max-width: 768px) {
    #compare-panel-container {
        width: 90%;
        height: auto;
		border-radius: 10px 10px 10px 10px;
        padding: 10px;
        left: 50%;
        bottom: 10px;
        transform: translateX(-50%) translateY(130%);
    }
    #compare-panel-container.active {
         transform: translateX(-50%) translateY(0);
    }
    .compare-bar-msg {
        font-size: 14px;
        margin-bottom: 15px;
    }
    #compare-bar {
        gap: 10px;
        margin-bottom: 0;
    }
}

// --- КНОПКА "Добавить в сравнение и Убрать" на карточках колонок

/* Базовые стили для кнопки "Порівняти" */
.compare-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #b22222;
}

/* Стили для иконки внутри кнопки */
.compare-button img {
    width: 12px;
    height: 12px;
    margin: 0 3px;
}

/* Стили для кнопки "Прибрати з порівняння" */
.compare-button.compare-button-added {
    color: #b22222; /* Цвет остается тем же */
}

/* Скрываем иконку, когда товар добавлен */
.compare-button.compare-button-added img {
    display: none;
}

/* --- ОБЩИЕ СТИЛИ ТАБЛИЦЫ СРАВНЕНИЯ (ВСЕ и старые тоже)--- */

/* Контейнер таблицы */
#comparison-table-container {
    overflow-x: auto;
    position: relative;
    background-color: #fff; /* Фон всей таблицы делаем белым */
}

/* Сама таблица (только тело) */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

// - ЛИПКИЕ ЭЛЕМЕНТЫ таблицы сравнения

/* --- Стили для sticky-шапки таблицы --- */
#compare-speakers-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    border-top: 1px solid transparent; /* Убираем верхнюю рамку */
}

#compare-speakers-header .product-header {
    flex: 1; /* Колонки одинаковой ширины */
    padding: 10px;
    text-align: center;
    border-right: 1px solid #a3a2a2; /* Правый разделитель колонок 1px */
}

#compare-speakers-header .product-header:last-child {
    border-right: none;
}

/* --- Стили для sticky-подвала таблицы --- */
#compare-speakers-footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background-color: #fff;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    display: flex;
}

#compare-speakers-footer .compare-speaker {
    flex: 1; /* Колонки одинаковой ширины */
    padding: 10px;
    text-align: center;
    border-right: 1px solid #a3a2a2; /* Правый разделитель колонок 1px */
}

#compare-speakers-footer .compare-speaker:last-child {
    border-right: none;
}

/* --- Стили для тела таблицы --- */
.comparison-table tbody td {
    padding: 10px;
    border: none; /* Убираем все рамки */
    border-right: 1px solid #a3a2a2; /* Правый разделитель колонок 1px */
    vertical-align: top;
    text-align: left; /* Выравнивание по левому краю */
}

.comparison-table tbody td:last-child {
    border-right: none;
}

/* Выравнивание свотчей по левому краю */
.comparison-table .product-card__swatches {
    display: flex;
    flex-wrap: wrap;
	justify-content: flex-start;
    gap: 5px; /* Отступ между квадратиками */
}

/* Стили для самих свотчей */
.product-card__swatches .swatch {
    width: 25px; /* Размер квадратика */
    height: 25px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.product-card__swatches .image-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Стили для разделителя полей --- */
.comparison-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #a3a2a2; /* Нижний разделитель ячеек */
}

/* --- Стили для содержимого таблицы --- */

/* Шрифт Названий полей */
.feature-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: #FC851E;
    margin-bottom: 5px;
    display: block;
    text-align: left;
}

/* Шрифт Значений полей */
.comparison-table tbody td {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: #404040;
}

/* Убираем "точки" у полей-повторителей */
.comparison-table tbody ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* --- Стили для полей-повторителей --- */
.comparison-table tbody td ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.comparison-table tbody td ul li {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 300 !important;
    color: #404040 !important;
    margin-bottom: 20px !important; /* Отступ между блоками "Название+Значение" */
}

.comparison-table tbody td ul li strong {
    display: inline !important;
    font-weight: 700 !important;
    color: #404040 !important; /* Цвет названий, как в примере */
    text-transform: none !important;
}

.comparison-table tbody td ul li br {
    display: block !important;
    content: '' !important;
    margin-top: 1px !important; /* Убираем лишний отступ от переноса строки */
}

/* Стили для ячейки "Комплектація" */
.comparison-table tbody td p {
    margin-bottom: 5px; /* Отступ между пунктами */
    font-size: 12px;
    font-weight: 300;
}

/* Стили для изображений, названий товаров и кнопок */
.product-image img {
    max-width: 100px;
    height: auto;
    margin-bottom: 5px;
}

.product-title a {
    font-weight: bold;
    text-decoration: none;
    color: #333;
    display: block;
}

.action-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cp-price {
    font-weight: bold;
    margin-bottom: 5px;
}

.button_square {
	color: #b22222
    background-color: #FFFFFF;
    font-family: "Montserrat", Sans-serif;
    font-size: 11px;
    font-weight: 300;
}

/* --- Кнопка "Убрать из сравнения" (крестик) --- */
.product-header {
    position: relative;
}

.remove-speaker {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    background-color: #f9f9f9;
    border-radius: 50%;
    padding: 2px;
    line-height: 1;
    z-index: 15;
    transition: background-color 0.3s, opacity 0.3s;
}

.remove-speaker svg {
    width: 16px;
    height: 16px;
    color: #999;
    transition: color 0.3s;
}

.remove-speaker:hover {
    background-color: #e2e2e2;
}

.remove-speaker:hover svg {
    color: #333;
}

/* --- Стили для поля с аксессуарами (подставками) --- */
.accessory-item {
    position: relative;
    display: block; /* Чтобы каждый аксессуар был на новой строке */
    margin-bottom: 10px;
}

.accessory-link {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    position: relative;
    display: inline-block; /* Чтобы hover работал только на ссылку */
}

/* Скрываем превью по умолчанию */
.accessory-preview {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    background: #fff;
    padding: 5px;
    width: 150px;
    height: auto;
}

/* Показываем превью при наведении на ссылку */
.accessory-link:hover .accessory-preview {
    display: block;
}

/// - КНОПКА ЗАКРЫТИЯ СТРАНИЦЫ СРАВНЕНИЯ
.entry-content {
    position: relative;
}

.close-comparison-page {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 100;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.close-comparison-page:hover {
    opacity: 1;
}

/// - Размещене кватратиков-свотчей на карточке товара *НЕ трогать!*** ///
/// * Фикс для свотчей на карточках товаров
 * Этот код переопределяет любые конфликтующие стили,
 * заставляя свотчи отображаться горизонтально.
 */

/* Делаем родительский элемент flexbox-контейнером */
.elementor-shortcode {
    display: flex !important;
    justify-content: flex-end !important;
}

/* Настраиваем сам контейнер свотчей внутри */
.product-card__swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    margin-top: 0 !important;
}

.elementor-widget-shortcode .product-card__swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 3px !important;
}

.elementor-widget-shortcode .product-card__swatches .product-card__swatch {
    /* Удаляем display: block, который ломает верстку */
    display: inline-block !important; 
    box-sizing: content-box !important; /* Отменяем box-sizing: border-box */
}

.product-card__swatch {
    box-sizing: content-box !important;
}

.product-card__swatch {
    width: 18px;
    height: 18px;
    border-radius: 0; /* Делает квадратными */
    background-size: cover;
    background-position: center;
    border: 1px solid #cccccc; /* Серая обводка толщиной 1px */
    cursor: default;
    box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

body.hello-elementor-child .elementor-widget-shortcode .product-card__swatch {
    box-sizing: content-box !important;
}

==========================

/// - Дополнительные стили для таблицы сравнения

/* --- Новые стили для "липкой" шапки при вертикальной прокрутке --- */
#compare-speakers-header.is-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background-color: #fff;
    z-index: 100;
}

/* Эффект уменьшения */
#compare-speakers-header.is-sticky-header .product-header {
    padding: 5px 10px;
    font-size: 0.9em;
}

/* --- Новые стили для "липкого" подвала при вертикальной прокрутке --- */
#compare-speakers-footer.is-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    background-color: #fff;
    z-index: 100;
}

/* --- Стили для липкой копии шапки --- */
#compare-speakers-header-clone {
    display: none;
    position: fixed;
    top: 0;
    z-index: 101; /* Убедимся, что она поверх всего */
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-bottom: 1px solid #a3a2a2; /* Разделитель между шапкой и контентом */
}

#compare-speakers-header-clone th {
    border-right: 1px solid #a3a2a2; /* Разделители между колонками */
}

/* Эффект уменьшения картинки и перемещения заголовка при прокрутке */
#compare-speakers-header-clone .product-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px; /* Увеличил отступы */
}

#compare-speakers-header-clone .product-image img {
    max-width: 60px; /* Увеличил размер картинки */
    height: auto;
    margin-right: 10px;
    margin-bottom: 0;
}

#compare-speakers-header-clone .product-title a {
    font-size: 11px; /* Уменьшил шрифт названия товара */
    line-height: 1.2;
}

