/* 全局样式 */
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-card .product-image {
    width: 100%;
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #f0f0f0;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

/* 响应式图片高度 */
@media (max-width: 768px) {
    .product-card .product-image {
        min-height: 150px;
    }
}

@media (max-width: 576px) {
    .product-card .product-image {
        min-height: 120px;
    }
}

.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%;
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #f0f0f0;
}

.detail-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.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;
    }
}

/* 悬浮客服样式 */
.customer-service {
    position: fixed;
    right: 20px;
    bottom: 120px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.customer-service-btn {
    width: 60px;
    height: 60px;
    background-color: rgba(102, 205, 170, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    text-decoration: none;
    font-weight: 500;
    padding: 0;
    margin: 0;
    text-align: center;
}

.customer-service-btn i {
    font-size: 22px;
    margin: 0;
    padding: 0;
    line-height: 1;
    display: block;
}

.customer-service-btn span {
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1;
    display: block;
    letter-spacing: 0.5px;
}

.customer-service-btn:hover {
    background-color: rgba(72, 179, 144, 0.95);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 确保PC端面板默认隐藏 */
.customer-service-panel {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    margin-bottom: 10px;
    max-width: 250px;
    position: absolute;
    right: 0;
    bottom: 70px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
    display: none !important;
}

/* 只有点击按钮时才显示面板 */
.customer-service-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 1001;
    display: block !important;
}

.customer-service-qr {
    text-align: center;
    margin-bottom: -10px;
    cursor: pointer;
}

.customer-service-qr img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: transform 0.2s ease;
    margin: 0;
    display: block;
}

.customer-service-qr img:hover {
    transform: scale(1.05);
}

.customer-service-text {
    text-align: center;
    font-size: 15px;
    color: #333;
    line-height: 1.4;
    white-space: pre-wrap;
    margin: -15px 0 0 0;
    padding: 0;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .customer-service {
        right: 15px;
        bottom: 120px;
    }
    
    .customer-service-btn {
        width: 55px;
        height: 55px;
        font-size: 15px;
        gap: 0px;
    }
    
    .customer-service-btn i {
        font-size: 20px;
    }
    
    .customer-service-btn span {
        font-size: 15px;
    }
    
    .customer-service-panel {
        max-width: 220px;
        padding: 15px;
        bottom: 65px;
    }
    
    .customer-service-text {
        font-size: 14px;
    }
}
