/* Общие стили для опций товара */
.terpentino-product-options {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.terpentino-product-options h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
}

/* Стили для выбора цвета */
.product-color-selection {
    margin-bottom: 15px;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    overflow: hidden;
}

.color-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-swatch .rgb-color-swatch {
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.color-swatch .color-name-fallback {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

.color-swatch.selected {
    border-color: #0073aa; /* Цвет выделения */
}

/* Стили для количества литров */
.product-quantity-selection {
    margin-bottom: 15px;
}

.quantity-selector,
.quantity-control { /* Объединяем стили для выбора количества */
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-selector button,
.quantity-control .qty-btn { /* Объединяем стили кнопок */
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.1em;
    line-height: 1;
    display: flex; /* Для центрирования иконки */
    align-items: center;
    justify-content: center;
}

.quantity-selector input[type="number"],
.quantity-control input[type="number"] { /* Объединяем стили инпута */
    width: 60px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    height: 30px;
    box-sizing: border-box;
}

/* Стили для цены и кнопки добавления в корзину */
.product-price-and-add-to-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.product-price-and-add-to-cart .price {
    font-size: 1.8em; /* Увеличим размер цены */
    font-weight: bold;
    color: #c96f0d; /* Цвет акцента */
}

.terpentino-add-to-cart {
    background-color: #c96f0d;
    color: white;
    padding: 12px 25px; /* Немного увеличим padding */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    text-decoration: none; /* Убираем подчеркивание у ссылки */
    display: inline-flex; /* Для центрирования иконки */
    align-items: center;
    gap: 8px; /* Пространство между текстом и иконкой */
}

.terpentino-add-to-cart:hover {
    background-color: #c9302c;
    color: white; /* Сохраняем цвет текста при наведении */
}

/* Кнопка "Назад к товарам" и "Оформить заказ" */
.btn-primary.btn-large {
    background-color: #5cb85c; /* Зеленый цвет для кнопок действия */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary.btn-large:hover {
    background-color: #4cae4c;
    color: white;
}

.btn-primary.btn-large i {
    margin-left: 5px;
}
.btn-primary.btn-large span {
    margin-right: 5px;
}
.btn-primary.btn-large .fa-arrow-left { margin-right: 5px; margin-left: 0;}
.btn-primary.btn-large .fa-arrow-right { margin-left: 5px; margin-right: 0;}


/* Стили для корзины */
.terpentino-cart-page { /* Этот контейнер, возможно, не используется, если вы используете шорткод */
    margin-top: 30px;
}

.terpentino-cart-container { /* Контейнер, который используется в шорткоде */
    margin-top: 30px;
}

.terpentino-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.terpentino-cart-table th,
.terpentino-cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.terpentino-cart-table th {
    background-color: #f9f9f9;
    font-weight: bold;
    text-transform: uppercase; /* Заголовки в верхнем регистре */
    font-size: 0.9em;
}

.terpentino-cart-table td {
    vertical-align: middle;
}

.terpentino-cart-table .cart-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.terpentino-cart-table .cart-item-info img {
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.terpentino-cart-table .cart-item-options {
    list-style: none;
    padding-left: 0;
    margin: 5px 0 0 0;
    font-size: 0.9em;
    color: #666;
}

.terpentino-cart-table .cart-item-options li {
    margin-bottom: 3px;
}

.terpentino-cart-table .remove-item-btn { /* Изменен селектор */
    color: #d9534f; /* Цвет иконки удаления */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em; /* Размер иконки */
}

.terpentino-cart-table .remove-item-btn:hover {
    color: #c9302c;
}

.terpentino-cart-summary {
    text-align: right;
    margin-top: 20px;
    border-top: 2px solid #ddd;
    padding-top: 15px;
}

.terpentino-cart-summary h3 {
    font-size: 1.6em;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.terpentino-cart-summary .total-price { /* Изменен селектор */
    font-weight: bold;
    color: #d9534f;
    font-size: 1.8em; /* Размер итоговой цены */
}

/* Сообщение о пустой корзине */
.empty-cart-message {
    text-align: center;
    padding: 50px 20px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-top: 30px;
}

.empty-cart-message .empty-cart-icon {
    font-size: 5em;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-cart-message h2 {
    font-size: 2em;
    color: #555;
    margin-bottom: 15px;
}

.empty-cart-message p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Стили для элементов управления изображениями (в админке) */
.terpentino-category-image-wrapper img,
.terpentino-value-image-wrapper-edit img,
#terpentino-object-image-wrapper img {
    max-width: 100px;
    height: auto;
    display: block;
    margin-top: 5px;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Стили для полей формы (в админке) */
.field-group {
    margin-bottom: 15px; /* Увеличим отступ */
}
.field-group label {
    display: block;
    margin-bottom: 8px; /* Увеличим отступ */
    font-weight: bold;
    color: #333;
}
.field-group input[type="text"],
.field-group input[type="number"],
.field-group textarea,
.field-group select { /* Добавили textarea и select */
    width: 100%;
    padding: 10px; /* Увеличим padding */
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em; /* Установим базовый размер шрифта */
}
.field-group textarea {
    min-height: 100px; /* Минимальная высота для textarea */
    resize: vertical; /* Разрешаем вертикальное изменение размера */
}

.attribute-value-item {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    background-color: #fdfdfd;
}
.attribute-value-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
}
.attribute-value-item .remove-attribute-value {
    margin-top: 10px;
    color: #d9534f;
    border: none;
    background: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1em;
}
.attribute-value-item .remove-attribute-value:hover {
    color: #c9302c;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .terpentino-cart-table thead {
        display: none; /* Скрываем заголовки на маленьких экранах */
    }
    .terpentino-cart-table,
    .terpentino-cart-table tbody,
    .terpentino-cart-table tr,
    .terpentino-cart-table td {
        display: block;
        width: 100%;
    }
    .terpentino-cart-table tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 4px;
        padding: 15px;
    }
    .terpentino-cart-table td {
        text-align: right;
        padding-left: 50%; /* Создаем место для "лейбла" */
        position: relative;
        border-bottom: none; /* Убираем нижнюю границу у ячеек */
    }
    .terpentino-cart-table td::before {
        content: attr(data-label); /* Используем data-label из HTML */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #333;
    }
    .terpentino-cart-table td.product-col {
        text-align: left; /* Особый случай для первой колонки */
    }
    .terpentino-cart-table td.product-col::before {
        content: "Товар"; /* Свой лейбл */
    }
    .terpentino-cart-table td.price-col::before { content: "Цена за ед."; }
    .terpentino-cart-table td.quantity-col::before { content: "Количество"; }
    .terpentino-cart-table td.total-col::before { content: "Сумма"; }
    .terpentino-cart-table td.remove-col { /* Пустая ячейка для кнопки удаления */
        text-align: right;
        padding-left: 10px;
        padding-top: 10px;
    }
    .terpentino-cart-table td.remove-col::before {
        content: ""; /* Нет лейбла для кнопки удаления */
    }
    .terpentino-cart-table .cart-item-info {
        flex-direction: column; /* Изображение и текст товара друг под другом */
        align-items: flex-start;
    }
    .terpentino-cart-table .cart-item-info img {
        margin-bottom: 10px;
    }
    .terpentino-cart-summary {
        text-align: center; /* Центрируем сводку на мобильных */
    }
    .terpentino-cart-summary h3 {
        justify-content: center;
    }
    .terpentino-add-to-cart,
    .btn-primary.btn-large {
        width: 100%; /* Кнопки на всю ширину */
        justify-content: center;
    }
}