/* Стили для групп опций */
.product-options {
    margin: 20px 0;
}

/* Контейнер цен */
.product-card-price-container {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.price-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.product-card-total-price {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Группы опций */
.option-group {
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.option-group.collapsed {
    padding: 15px 20px;
    background: #f0f0f0;
}

.option-group.collapsed .option-items {
    display: none;
}

.option-group.collapsed .option-group-description {
    display: none;
}

/* Заголовок группы с чекбоксом */
.option-group-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding-top: 2px;
}

.option-group.collapsed .option-group-header {
    margin-bottom: 0;
}

/* Кастомный чекбокс для группы */
.option-group-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
    margin-top: 1px; /* Небольшая корректировка для выравнивания с текстом */
}

.option-group-checkbox {
    display: none;
}

.option-group-checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #007bff;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: -1px; /* Поднимаем чекбокс чуть выше для лучшего выравнивания */
}

.option-group-checkbox:checked + .option-group-checkbox-custom {
    background: #007bff;
    border-color: #007bff;
}

.option-group-checkbox:checked + .option-group-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.option-group-checkbox-custom:hover {
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.option-group-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.option-group-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.option-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-item {
    position: relative;
}

.option-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-item-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.option-item-content:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.option-radio:checked + .option-item-content {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.option-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.no-image {
    color: #6c757d;
    font-size: 12px;
    text-align: center;
}

.option-item-info {
    flex: 1;
    min-width: 0;
}

.option-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.option-item-name a {
    color: #007bff;
    text-decoration: none;
}

.option-item-name a:hover {
    text-decoration: underline;
}

.option-item-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.option-item-description a {
    color: #007bff;
}

.option-item-pricing {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.option-price {
    font-weight: 500;
    color: #333;
    min-width: 100px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    background: #f8f9fa;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.qty-btn:hover {
    background: #e9ecef;
    color: #333;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    border: none;
    width: 50px;
    height: 32px;
    text-align: center;
    font-size: 14px;
    background: white;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    outline: none;
}

.qty-input:focus {
    background: #f8f9fa;
}

/* Удаляем стрелки у input[type="number"] */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

.option-total {
    font-weight: 600;
    color: #28a745;
    min-width: 100px;
    text-align: right;
}

/* Адаптивность */
@media (max-width: 768px) {
    .option-item-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .option-item-image {
        align-self: flex-start;
        width: 60px;
        height: 60px;
    }
    
    .option-item-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .option-total {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .option-group {
        padding: 15px;
    }
    
    .option-item-content {
        padding: 12px;
    }
    
    .option-item-image {
        width: 50px;
        height: 50px;
    }
}

/* Стили для недоступных опций */
.option-unavailable {
    opacity: 0.5;
    pointer-events: none;
}

.option-unavailable .option-item-content {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #6c757d !important;
}

.option-unavailable .option-item-image img {
    filter: grayscale(100%);
    opacity: 0.7;
}

.option-unavailable .option-item-name {
    color: #6c757d !important;
}

.option-unavailable .option-price {
    color: #6c757d !important;
}

.option-unavailable-status {
    margin-top: 8px;
}

.unavailable-text {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
    background-color: #f8d7da;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    display: inline-block;
}

/* Отключаем радиокнопки для недоступных опций */
.option-unavailable .option-radio {
    pointer-events: none;
    opacity: 0.5;
}

.option-unavailable .option-radio:disabled {
    cursor: not-allowed;
}

/* Акцентная кнопка "Добавить в корзину" */
.add-to-cart-accent {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 48px !important;
}

.add-to-cart-accent:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4) !important;
}

.add-to-cart-accent:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3) !important;
}

.add-to-cart-accent:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
}

/* Контейнер для цен и действий в одной строке */
.product-card-price-and-actions {
    display: flex !important;
    gap: 60px !important;
    align-items: flex-start !important;
    margin: 20px 0 !important;
    flex-wrap: nowrap !important;
}

.product-card-price-container {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Блок действий (наличие + кнопка) справа от цен - выровнен к правой границе */
.product-card-actions {
    flex: 0 0 250px !important;
    width: 250px !important;
    padding: 16px !important;
    background-color: #f8f9fa !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
    align-self: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

.product-card-actions .product-card-stock {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.product-card-actions .product-card-stock--out {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #dc3545;
}

.product-card-actions .add-to-cart-accent {
    width: 100%;
    margin-top: 8px;
}

/* Мобильная адаптация для блока цен и действий */
@media (max-width: 768px) {
    .product-card-price-and-actions {
        flex-direction: column;
        gap: 20px;
    }
    
    .product-card-actions {
        min-width: auto;
    }
}

/* Блок преимуществ под фотографией */
.product-card-benefits {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.benefits-title {
    text-align: center;
    margin-bottom: 20px;
    color: #495057;
    font-size: 16px;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefit-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: #495057;
    font-size: 14px;
}

.benefit-icon {
    margin-right: 10px;
    color: #28a745;
    flex-shrink: 0;
}

.benefit-item span {
    font-weight: 500;
}

/* Превьюшки изображений товара */
.product-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-item:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.thumbnail-item.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.thumbnail-item:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Мобильная адаптация превьюшек */
@media (max-width: 768px) {
    .product-thumbnails {
        justify-content: center;
        gap: 6px;
    }
    
    .thumbnail-item {
        width: 50px;
        height: 50px;
    }
}

/* Копируем стили .product-card-price для .product-card-total-price */
.product-card-total-price {
    font-style: normal;
    font-weight: 700;
    text-transform: none;
    margin-bottom: 24px;
    font-size: 20px;
}

.product-card-total-price del {
    color: inherit;
    opacity: 0.4;
    display: inline-block;
}

.product-card-total-price ins {
    text-decoration: none;
    margin-right: 4px;
    display: inline-block;
}

.product-card-total-price .product-card-price-symbol {
    font-size: 14px !important;
    margin-left: 2px;
}

.product-card-total-price .total-price-amount {
    color: #007bff;
    font-size: 18px !important;
}