/* 商品详情页样式 */

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    margin: 20px 0;
}

/* 预览区域 */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-canvas {
    width: 100%;
    aspect-ratio: 1;
    background: #fafafa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.preview-product {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-product img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.custom-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.preview-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.tool-btn:hover {
    background: #fff0f5;
    border-color: #ff6b9d;
    color: #ff6b9d;
}

/* 商品信息区域 */
.info-section {
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
    line-height: 1.6;
}

.price-info {
    background: #fff0f5;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.current-price {
    font-size: 28px;
    color: #ff6b9d;
    font-weight: bold;
}

.wholesale-tip {
    font-size: 12px;
    color: #ff6b9d;
    margin-top: 8px;
    display: none;
}

/* 批发价格区域 */
.wholesale-section {
    background: #fffbe6;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #ffeeba;
}

.wholesale-section h4 {
    font-size: 14px;
    color: #856404;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wholesale-section h4::before {
    content: '📦';
}

.wholesale-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wholesale-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
    min-width: 120px;
}

.wholesale-item.active {
    border-color: #ff6b9d;
    background: #fff0f5;
}

.wholesale-range {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.wholesale-range strong {
    color: #333;
}

.wholesale-price {
    font-size: 16px;
    color: #ff6b9d;
    font-weight: bold;
}

/* 规格选择 */
.specs-section {
    margin-bottom: 20px;
}

.specs-section h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.spec-group {
    margin-bottom: 16px;
}

.spec-group h4 {
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}

.spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    font-size: 13px;
    min-width: 80px;
    position: relative;
}

.spec-option:hover {
    background: #fff0f5;
}

.spec-option input {
    display: none;
}

.spec-option:has(input:checked) {
    border-color: #ff6b9d;
    background: #fff0f5;
}

.spec-option img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.spec-option span:first-of-type {
    color: #333;
    margin-bottom: 4px;
}

.adjust-price {
    font-size: 12px;
    color: #ff6b9d;
    font-weight: 600;
}

/* 数量选择 */
.quantity-section {
    margin-bottom: 20px;
}

.quantity-section h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-control button {
    width: 40px;
    height: 40px;
    border: none;
    background: #fafafa;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: background 0.3s;
}

.quantity-control button:hover {
    background: #eee;
}

.quantity-control input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-add-cart {
    flex: 1;
    padding: 14px 20px;
    background: #fff;
    border: 2px solid #ff6b9d;
    color: #ff6b9d;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-cart:hover {
    background: #fff0f5;
}

.btn-buy-now {
    flex: 1;
    padding: 14px 20px;
    background: #ff6b9d;
    border: 2px solid #ff6b9d;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy-now:hover {
    background: #ff4d8a;
    border-color: #ff4d8a;
}

/* 定制说明 */
.product-tips {
    background: #fafafa;
    padding: 16px;
    border-radius: 10px;
}

.product-tips h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

.product-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-tips li {
    font-size: 12px;
    color: #999;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.product-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ff6b9d;
}

/* 文字编辑弹窗 */
#textModal .form-group {
    margin-bottom: 14px;
}

#textModal label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

#textModal input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

#textModal input[type="range"] {
    width: 100%;
    margin-top: 6px;
}

#textModal input[type="color"] {
    width: 60px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

#textSizeValue {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
    color: #666;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px;
    }
    
    .preview-canvas {
        aspect-ratio: 4/3;
    }
    
    .preview-tools {
        justify-content: center;
    }
    
    .tool-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .wholesale-item {
        min-width: 100px;
        padding: 8px 12px;
    }
    
    .wholesale-price {
        font-size: 14px;
    }
    
    .spec-option {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .spec-option img {
        width: 40px;
        height: 40px;
    }
    
    .quantity-control button {
        width: 36px;
        height: 36px;
    }
    
    .quantity-control input {
        width: 50px;
        height: 36px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-add-cart,
    .btn-buy-now {
        width: 100%;
    }
}

@media screen and (max-width: 375px) {
    .product-detail {
        padding: 12px;
    }
    
    .preview-tools {
        gap: 8px;
    }
    
    .tool-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .wholesale-item {
        min-width: 80px;
        padding: 6px 10px;
    }
    
    .spec-option {
        min-width: 60px;
        padding: 6px 10px;
    }
}