.cart-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.cart-page {
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    min-height: 100vh;
    padding: 30px 0 60px;
}


/* 购物车容器 */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    position: relative;
}

/* 购物步骤指示器 - 改进版 */
.cart-steps-container {
    margin-bottom: 30px;
}

.cart-steps {
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin: 0 0 30px;
    list-style: none;
    position: relative;
    counter-reset: step-counter;
}

.cart-steps:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 15px;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.cart-step {
    position: relative;
    text-align: center;
    flex: 1;
    padding-top: 30px;
    color: #adb5bd;
    font-size: 16px;
    font-weight: 500;
    z-index: 2;
}

.cart-step:before {
    counter-increment: step-counter;
    content: counter(step-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.cart-step-active {
    color: #3e5f8a;
}

.cart-step-active:before {
    /*background: #28a745;*/
    background: #3e5f8a;
    color: white;
    /*box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.2);*/
    box-shadow: 0 0 0 4px rgba(62, 95, 138, 0.2);
}


/* 购物车提示框 - 现代化设计 */
.cart-alert {
    margin-bottom: 25px;
    background: #e7f5ff;
    border: 1px solid #d0ebff;
    border-radius: 8px;
    overflow: hidden;
}

.cart-alert-content {
    position: relative;
    padding: 16px 50px 16px 25px;
    color: #1864ab;
    line-height: 1.6;
    font-size: 14px;
}

.cart-alert-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cart-alert-close:hover {
    opacity: 1;
}

.cart-alert-close:before, 
.cart-alert-close:after {
    position: absolute;
    left: 10px;
    content: ' ';
    height: 16px;
    width: 2px;
    background-color: #1864ab;
}

.cart-alert-close:before {
    transform: rotate(45deg);
}

.cart-alert-close:after {
    transform: rotate(-45deg);
}

/* 购物车商品列表 - 对齐优化 */
.cart-products {
    margin-top: 20px;
}

.cart-products-wrapper {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* 购物车头部 - 精确对齐 */
.cart-header {
    display: flex;
    padding: 16px 25px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    font-weight: 600;
    color: #495057;
    border-radius: 8px 8px 0 0;
}

.cart-header-item {
    padding: 0 10px;
    flex-shrink: 0;
}

/* 商品项样式 - 与头部完美对齐 */
.cart-item-group {
    margin-top: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.cart-item-group:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cart-item-table {
    width: 100%;
}

.cart-item-row {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s ease;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-row:hover {
    background: #f8f9fa;
}

.cart-item-cell {
    display: flex;
    align-items: center;
    padding: 0 10px;
    flex-shrink: 0;
}

/* 精确设置每列的宽度，确保头部和商品项完美对齐 */
.cart-header-item:nth-child(1){
    width:6%;
}
.cart-header-item:nth-child(2){
    width:35%;
}
.cart-item-cell:nth-child(1) {
    width: 41%;
}

.cart-header-item:nth-child(3),
.cart-item-cell:nth-child(2) {
    padding: 0 10px 0 20px;
    width: 17%;
}

.cart-header-item:nth-child(4),
.cart-item-cell:nth-child(3) {
    width: 16%;
}

.cart-header-item:nth-child(5),
.cart-item-cell:nth-child(4) {
    width: 16%;

}

.cart-header-item:nth-child(6),
.cart-item-cell:nth-child(5) {
    width: 10%;

}


/* 商品信息 - 改进版 */
.cart-item-info {
    display: flex;
    align-items: center;
    /*flex: 1;*/
}

.cart-item-image {
    width: 90px;
    height: 90px;
    margin-right: 18px;
    border: 1px solid #f1f3f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.cart-item-image:hover img {
    transform: scale(1.05);
}

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

.cart-item-title {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #212529;
    font-size: 16px;
    line-height: 1.4;
}

.cart-item-title:hover {
    color: #007bff;
}

.cart-item-attributes {
    display: block;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
}

.cart-item-attribute {
    margin-right: 12px;
    display: inline-block;
}

/* 价格样式 */
.cart-item-price {
    font-weight: 600;
    color: #212529;
    font-size: 16px;
}


.cart-quantity-control {
    display: flex;
    align-items: center;
    height: 36px;
}

.cart-quantity-btn {
    width: 32px;
    height: 100%;
    border: 1px solid #ced4da;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f8f9fa;
    user-select: none;
    transition: all 0.2s ease;
    color: #495057;
}

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

.cart-quantity-input {
    width: 50px;
    height: 100%;
    border: 1px solid #ced4da;
    border-left: none;
    border-right: none;
    text-align: center;
    outline: none;
    font-size: 14px;
    color: #495057;
    -moz-appearance: textfield;
}

.cart-quantity-input::-webkit-outer-spin-button,
.cart-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 小计 - 更突出 */
.cart-item-subtotal {
    font-weight: 700;
    color: #dc3545;
    font-size: 16px;
}



.cart-item-remove {
    color: #6c757d;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.cart-item-remove:before {
    content: "×";
    margin-right: 4px;
    font-size: 18px;
}

.cart-item-remove:hover {
    color: #dc3545;
}

/* 结算区域*/
.cart-summary {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 20px 25px;
    margin-top: 30px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 8px 8px;
    z-index: 10;
}

.cart-summary.fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.cart-summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.cart-selected-count {
    color: #6c757d;
    font-size: 15px;
}

.cart-selected-number {
    color: #28a745;
    font-weight: 600;
    margin: 0 5px;
}

.cart-total {
    display: flex;
    align-items: center;
}

.cart-total-label {
    font-size: 16px;
    margin-right: 20px;
    color: #495057;
}

.cart-total-amount {
    color: #dc3545;
    font-size: 22px;
    font-weight: 700;
}

.cart-total-currency {
    font-size: 16px;
    font-weight: normal;
    margin-right: 4px;
}


/* 空购物车样式  */
.cart-empty-container {
    padding: 60px 0;
}

.cart-empty {
    text-align: center;
    padding: 40px 0;
}

.cart-empty-icon {
    font-size: 80px;
    color: #e9ecef;
    margin-bottom: 25px;
    display: inline-block;
    line-height: 1;
}

.cart-empty-message {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.cart-empty-link {
    display: inline-block;
    padding: 12px 36px;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 16px;
}

.cart-empty-link:hover {
    background: #0069d9;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* 响应式设计 - 更完善的适配 */
@media (max-width: 1199px) {
    .cart-container {
        margin: 20px 15px;
        padding: 20px;
    }
    
    .cart-summary-content {
        padding: 0 15px;
    }
}

@media (max-width: 991px) {
    .cart-header-item:nth-child(1),
    .cart-item-cell:nth-child(1) {
        width: 8%;
        min-width: 50px;
    }
    
    .cart-header-item:nth-child(2),
    .cart-item-cell:nth-child(2) {
        width: 32%;
        min-width: 200px;
    }
    
    .cart-header-item:nth-child(3),
    .cart-item-cell:nth-child(3) {
        width: 16%;
        min-width: 90px;
    }
    
    .cart-header-item:nth-child(4),
    .cart-item-cell:nth-child(4) {
        width: 16%;
        min-width: 100px;
    }
    
    .cart-header-item:nth-child(5),
    .cart-item-cell:nth-child(5) {
        width: 16%;
        min-width: 110px;
    }
    
    .cart-header-item:nth-child(6),
    .cart-item-cell:nth-child(6) {
        width: 12%;
        min-width: 80px;
    }
    
    .cart-header-item {
        font-size: 14px;
    }
    
    .cart-item-title {
        font-size: 15px;
    }
    
    .cart-item-attributes {
        font-size: 12px;
    }
    
    .cart-checkout-btn,
    .cart-empty-link {
        padding: 10px 24px;
    }
}

@media (max-width: 767px) {
    .cart-container {
        margin: 15px 10px;
        padding: 15px;
    }
    
    .cart-steps {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-steps:before {
        display: none;
    }
    
    .cart-step {
        padding: 10px 0 10px 35px;
        text-align: left;
        margin-bottom: 10px;
        position: relative;
    }
    
    .cart-step:before {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .cart-header {
        display: none;
    }
    
    .cart-item-row {
        flex-wrap: wrap;
        padding: 15px;
        position: relative;
    }
    
    .cart-item-cell {
        width: 100% !important;
        margin-bottom: 12px;
        justify-content: flex-start !important;
        padding: 0;
    }
    
    .cart-item-info {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .cart-item-checkbox {
        position: absolute;
        top: 15px;
        right: 15px;
        margin-right: 0;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    .cart-item-actions {
        position: absolute;
        top: 15px;
        right: 45px;
    }
    
    .cart-summary-content {
        flex-direction: column;
        text-align: center;
        padding: 0 10px;
    }
    
    .cart-total {
        margin: 15px 0;
    }
    
    .cart-checkout-btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .cart-empty-icon {
        font-size: 60px;
    }
    
    .cart-empty-message {
        font-size: 16px;
    }
    
    .cart-empty-link {
        width: 100%;
    }
}


.cart-item-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #3e5f8a; 
    border-radius: 3px; 
    margin-right: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    background: #f8f9fa; 
    position: relative;
}

.cart-item-checkbox-checked {
    background: #3e5f8a;
    border-color: #3e5f8a;
}

.cart-item-checkbox-checked:after {
    content: "";
    position: absolute;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* 结算按钮格 */
.cart-checkout-btn {
    display: inline-block;
    padding: 12px 36px;
    background: #e74c3c;
    color: #fff;
    border-radius: 3px; 
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 16px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Roboto Condensed', sans-serif;
    box-shadow: 0 2px 0 #c0392b;
    position: relative;
}

.cart-checkout-btn:hover {
    background: #c0392b;
    transform: translateY(1px);
    box-shadow: 0 1px 0 #c0392b;
}

.cart-checkout-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.cart-item-group {

    background: #f8f9fa;
}

.cart-item-row:hover {
    background: #eaecee; 
}

.cart-item-price {
    color: #3e5f8a; 
    font-weight: 700;
}

.cart-item-subtotal {
    color: #e74c3c;
}


/* 修正后的加减符号CSS */
.cart-quantity-control {
    display: flex;
    align-items: center;
    height: 36px;
}

.cart-quantity-btn {
    width: 32px;
    height: 100%;
    border: 1px solid #ced4da;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f8f9fa;
    user-select: none;
    transition: all 0.2s ease;
    color: #495057;
    position: relative;
}

/* 减号样式 */
.cart-quantity-decrease:before {
    content: "";
    display: block;
    width: 10px;
    height: 2px;
    background: currentColor;
}

/* 加号样式 */
.cart-quantity-increase:before {
    content: "";
    display: block;
    width: 10px;
    height: 2px;
    background: currentColor;
}

.cart-quantity-increase:after {
    content: "";
    display: block;
    width: 2px;
    height: 10px;
    background: currentColor;
    position: absolute;
}

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