/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* 商品卡片样式 */
.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.delivery-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #28a745;
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 10;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f0f0f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    min-height: 20px;
    max-height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin: 0 0 8px 0;
    padding: 2px 0;
}

.stock, .sales {
    display: flex;
    align-items: center;
    line-height: 1;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: #dc3545;
    margin-right: 8px;
}

.original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.add-to-cart {
    width: 100%;
    margin-top: auto;
    border-radius: 4px;
    padding: 8px;
    font-weight: 600;
    font-size: 14px;
}

/* 商品详情页样式 */
.product-detail {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.detail-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-info h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.meta-item i {
    margin-right: 8px;
    color: #6c757d;
}

.detail-price {
    margin-bottom: 20px;
}

.detail-price .current-price {
    font-size: 32px;
}

.spec-selection {
    margin-bottom: 20px;
}

.spec-selection h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

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

.spec-option {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.spec-option.active {
    border-color: #0d6efd;
    background-color: #0d6efd;
    color: #fff;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.quantity-control h3 {
    font-size: 16px;
    margin-right: 15px;
    width: 80px;
}

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

.quantity-btn {
    width: 35px;
    height: 35px;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.quantity-value {
    width: 60px;
    height: 35px;
    border: none;
    text-align: center;
    font-size: 16px;
    outline: none;
}

.buy-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.buy-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0d6efd;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
}

/* 支付方式选择 */
.payment-methods {
    margin-top: 20px;
}

.payment-methods h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option.active {
    border-color: #0d6efd;
    background-color: #f0f4ff;
}

.payment-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.payment-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-icon img {
    max-width: 100%;
    max-height: 100%;
}

.payment-info h4 {
    font-size: 16px;
    margin: 0 0 5px 0;
}

.payment-info p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* 购物车样式 */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #fff;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-spec {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #dc3545;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.total-label {
    margin-right: 15px;
}

.total-amount {
    color: #dc3545;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .product-name {
        font-size: 14px;
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .detail-info h1 {
        font-size: 20px;
    }
    
    .detail-price .current-price {
        font-size: 24px;
    }
    
    .buy-buttons {
        flex-direction: column;
    }
    
    .buy-btn {
        min-width: auto;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-item-image {
        margin-bottom: 15px;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }
}
