/* Enhanced SKU Options Styles */

/* 显示价格差异信息，隐藏完整价格 */
.sku-card-price {
    display: none !important;
}

.sku-card-price-diff {
    display: block !important;
    font-size: 13px;
    font-weight: 600;
    margin: 6px 0 4px 0;
    padding: 0;
    text-align: center;
    line-height: 1.4;
}

/* 价格差异的正负显示 */
.sku-card-price-diff.positive,
.sku-card-price-diff:contains("+") {
    color: #dc3545 !important; /* 红色表示涨价 */
}

.sku-card-price-diff.negative,
.sku-card-price-diff:contains("-") {
    color: #28a745 !important; /* 绿色表示降价 */
}

/* 调整SKU卡片布局 */
.sku-card-details {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sku-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.3;
}

/* 确保元素按正确顺序显示 */
.sku-card-details .sku-card-name {
    order: 1;
}

.sku-card-details .sku-card-price-diff {
    order: 2;
}

.sku-card-details .sku-card-stock {
    order: 3;
    margin-top: 6px;
}

/* 改善SKU卡片选择效果 */
.sku-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sku-card:hover .sku-card-inner {
    border-color: #999 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.sku-card.selected .sku-card-inner,
.sku-card input[type="radio"]:checked + .sku-card-inner {
    border-color: #007bff !important;
    background: #f8f9ff !important;
    box-shadow: 0 4px 12px rgba(0,123,255,0.2) !important;
}

/* 选中标记样式 */
.sku-card-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    z-index: 10;
}

.sku-card-checkmark i {
    color: white;
    font-size: 14px;
}

.sku-card.selected .sku-card-checkmark,
.sku-card input[type="radio"]:checked + .sku-card-inner .sku-card-checkmark {
    opacity: 1;
    transform: scale(1);
}

/* 价格更新动画 */
#main-price, 
#main-price-special, 
#sku-current-price {
    transition: all 0.3s ease;
}

/* 主图更新效果 */
#elevate-zoom,
.elevate-zoom-preview img {
    transition: opacity 0.3s ease;
}

/* 缩略图高亮效果 */
.elevatezoom-gallery.active {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.3) !important;
}

/* 价格明细显示 - 位于Select Configuration下方 */
.price-breakdown {
    margin: 0;
    padding: 16px 24px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3d6 100%);
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
}

.price-breakdown-header {
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-breakdown-header::before {
    content: '\f155';
    font-family: 'FontAwesome';
    color: #ff9800;
    font-size: 16px;
}

.price-breakdown-base {
    color: #666;
    margin: 8px 0;
    font-size: 13px;
    padding: 6px 0;
}

.price-breakdown-item {
    color: #333;
    margin: 8px 0;
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #e8e8e8;
}

.price-breakdown-item:last-of-type {
    border-bottom: none;
}

.price-breakdown-total {
    font-weight: 700;
    color: #dc3545;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #ffd966;
    font-size: 18px;
    text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sku-card-checkmark {
        width: 20px;
        height: 20px;
        top: 6px;
        right: 6px;
    }
    
    .sku-card-checkmark i {
        font-size: 12px;
    }
    
    .price-breakdown {
        font-size: 13px;
        padding: 14px 20px;
    }
    
    .price-breakdown-header {
        font-size: 14px;
    }
    
    .price-breakdown-item {
        font-size: 13px;
    }
    
    .price-breakdown-total {
        font-size: 16px;
    }
}

/* 库存状态样式 */
.sku-card-stock.in-stock {
    color: #28a745;
    font-weight: 600;
}

.sku-card-stock.out-of-stock {
    color: #dc3545;
    font-weight: 600;
}

/* 禁用状态 */
.sku-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sku-card.disabled:hover .sku-card-inner {
    transform: none;
    box-shadow: none;
}

/* 加载状态 */
.price-loading {
    opacity: 0.6;
    position: relative;
}

.price-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 改善整体布局 */
.sku-cards-grid {
    gap: 15px;
}

.sku-card-inner {
    transition: all 0.3s ease;
    border-radius: 8px;
}

/* 确保选择状态清晰可见 */
.sku-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* 改善触摸设备体验 */
@media (hover: none) and (pointer: coarse) {
    .sku-card:hover .sku-card-inner {
        transform: none;
    }
    
    .sku-card:active .sku-card-inner {
        transform: scale(0.98);
    }
}

/* 价格明细显示 - 位于最后一个规格组下方 */
.price-breakdown {
    margin: 20px 0 0 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3d6 100%);
    border: 1px solid #ffd966;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.price-breakdown-header {
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-breakdown-header::before {
    content: '\f155';
    font-family: 'FontAwesome';
    color: #ff9800;
    font-size: 16px;
}

.price-breakdown-base {
    color: #666;
    margin: 8px 0;
    font-size: 13px;
    padding: 6px 0;
}

.price-breakdown-item {
    color: #333;
    margin: 8px 0;
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #e8e8e8;
}

.price-breakdown-item:last-of-type {
    border-bottom: none;
}

.price-breakdown-total {
    font-weight: 700;
    color: #dc3545;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #ffd966;
    font-size: 18px;
    text-align: right;
}

/* 库存状态样式 */
.sku-card-stock.in-stock {
    color: #28a745;
    font-weight: 600;
}

.sku-card-stock.out-of-stock {
    color: #dc3545;
    font-weight: 600;
}

/* 响应式设计 - 价格明细 */
@media (max-width: 768px) {
    .price-breakdown {
        font-size: 13px;
        padding: 14px 16px;
        margin: 15px 0 0 0;
    }
    
    .price-breakdown-header {
        font-size: 14px;
    }
    
    .price-breakdown-item {
        font-size: 13px;
    }
    
    .price-breakdown-total {
        font-size: 16px;
    }
}
