/* 购物车页面基础样式 */
.cart-page {
    min-height: 100vh;
    background: #f7f8fa;
    padding-bottom: 120px;
    max-width: 750px;
    margin: 0 auto;
    position: relative;
}

/* 顶部导航栏 */
.cart-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 750px;
    margin: 0 auto;
}

.cart-title {
    font-size: 17px;
    color: #333;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.cart-title .CartCount {
    font-size: 13px;
    color: #999;
    margin-left: 4px;
    font-weight: normal;
}

.cart-title .CartCount:before {
    content: '(';
}

.cart-title .CartCount:after {
    content: ')';
}

.edit-btn {
    font-size: 14px;
    color: #666;
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.edit-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.edit-btn i {
    font-size: 14px;
}

/* 购物车商品列表样式 */
.gwcbox_1 {
    padding: 12px;
    margin-top: 56px;
    display: grid;
    gap: 12px;
}

.gwc_list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    padding: 16px;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.gwc_list:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.gwc_list .gwccheck {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
    flex-shrink: 0;
    margin-top: 4px;
}

.gwc_list .gwccheck.on {
    background: #1492fb;
    border-color: #1492fb;
}

.gwc_list .gwccheck.on:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.gwc_list .gwc_img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    border: 1px solid rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.gwc_list .gwc_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gwc_list:hover .gwc_img img {
    transform: scale(1.05);
}

.gwc_list .gwc_info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.gwc_list .gwc_name {
    font-size: 16px;
    color: #333;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gwc_list .gwc_bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
}

.gwc_list .gwc_price {
    font-size: 18px;
    color: #ff4d4f;
    font-weight: 600;
}

.gwc_list .gwc_price:before {
    content: '¥';
    font-size: 14px;
    margin-right: 2px;
}

.gwc_list .gwc_num {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7f8fa;
    border-radius: 8px;
    padding: 6px;
}

.gwc_list .gwc_num .minus,
.gwc_list .gwc_num .plus {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gwc_list .gwc_num .minus:hover,
.gwc_list .gwc_num .plus:hover {
    background: #1492fb;
    color: #fff;
    border-color: #1492fb;
}

.gwc_list .gwc_num .minus:disabled {
    background: #f5f5f5;
    color: #ccc;
    border-color: #eee;
    cursor: not-allowed;
}

.gwc_list .gwc_num input {
    width: 44px;
    text-align: center;
    border: none;
    background: #fff;
    font-size: 14px;
    color: #333;
    padding: 0;
    height: 26px;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* 编辑模式样式 */
.gwc_list.edit-mode .gwc_num {
    opacity: 0.5;
    pointer-events: none;
}

.gwc_list.edit-mode .gwc_price {
    opacity: 0.5;
}

/* 底部结算栏 */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    max-width: 750px;
    margin: 0 auto;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.select-all .gwccheck {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
    flex-shrink: 0;
    cursor: pointer;
}

.select-all .gwccheck.on {
    background: #1492fb;
    border-color: #1492fb;
}

.select-all .gwccheck.on:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.total-price {
    font-size: 14px;
    color: #666;
}

.total-price .price {
    font-size: 18px;
    color: #ff4d4f;
    font-weight: 600;
    margin-left: 4px;
}

.total-price .price:before {
    content: '¥';
    font-size: 14px;
    margin-right: 1px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.delete-btn {
    background: #ff4d4f;
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 38px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    gap: 4px;
}

.delete-btn.show {
    display: flex;
}

.delete-btn:hover {
    background: #ff7875;
}

.delete-btn i {
    font-size: 14px;
}

.checkout-btn {
    background: #1492fb;
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 38px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkout-btn:hover {
    background: #0084f0;
    transform: translateY(-1px);
}

.checkout-btn:active {
    transform: translateY(0);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.checkout-btn .CartCount {
    font-size: 13px;
    opacity: 0.9;
}

.checkout-btn .CartCount:before {
    content: '(';
}

.checkout-btn .CartCount:after {
    content: ')';
}

/* 空购物车状态 */
.cart-null {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 50;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.empty-cart img {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-cart .title {
    font-size: 16px;
    color: #333;
    margin: 0 0 8px;
    font-weight: 500;
}

.empty-cart .desc {
    font-size: 14px;
    color: #999;
    margin: 0 0 20px;
}

.go-shopping {
    background: #1492fb;
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 38px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.go-shopping:hover {
    background: #0084f0;
    transform: translateY(-1px);
    color: #fff;
}

.go-shopping i {
    font-size: 14px;
}

/* 响应式适配 */
@media (max-width: 360px) {
    .cart-header {
        padding: 10px 12px;
    }
    
    .cart-title {
        font-size: 16px;
    }
    
    .edit-btn {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .gwcbox_1 {
        padding: 10px;
        gap: 10px;
    }
    
    .gwc_list {
        padding: 12px;
        gap: 12px;
    }
    
    .gwc_list .gwc_img {
        width: 80px;
        height: 80px;
    }
    
    .gwc_list .gwc_name {
        font-size: 14px;
    }
    
    .gwc_list .gwc_price {
        font-size: 16px;
    }
    
    .gwc_list .gwc_num {
        padding: 4px;
    }
    
    .gwc_list .gwc_num .minus,
    .gwc_list .gwc_num .plus {
        width: 24px;
        height: 24px;
    }
    
    .gwc_list .gwc_num input {
        width: 40px;
        height: 24px;
    }
    
    .cart-footer {
        padding: 10px 12px;
    }
    
    .total-price .price {
        font-size: 16px;
    }
    
    .checkout-btn {
        padding: 0 20px;
        height: 36px;
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.gwc_list {
    animation: fadeIn 0.4s ease;
}

.delete-btn.show {
    animation: slideIn 0.3s ease;
} 