/* 购物车页面样式 */
.cart-page {
    padding: 2rem 0;
    min-height: 60vh;
}

.page-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.cart-select-all {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cart-select-all label {
    font-weight: 500;
    color: #2c3e50;
}

.cart-item {
    display: grid;
    grid-template-columns: 40px 120px 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 1rem;
    background: white;
}

.item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.item-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

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

.item-details h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.item-details p {
    color: #6c757d;
    margin-bottom: 0.3rem;
}

.item-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #007bff;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    width: 35px;
    height: 35px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-input {
    width: 50px;
    height: 35px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.remove-item:hover {
    background: #f8d7da;
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.empty-cart-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.cart-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.cart-empty p {
    color: #6c757d;
    margin-bottom: 2rem;
}

.cart-summary {
    position: sticky;
    top: 100px;
}

.summary-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.summary-card h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.summary-row.discount {
    color: #28a745;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    border-top: 2px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
}

.coupon-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.coupon-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.coupon-input {
    display: flex;
    gap: 0.5rem;
}

.coupon-input input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.checkout-btn {
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    font-size: 1.1rem;
}

.payment-methods {
    text-align: center;
}

.payment-methods p {
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.5rem;
    color: #6c757d;
}

.recommended-products {
    margin-top: 4rem;
    padding: 3rem 0;
    background: #f8f9fa;
}

/* 结账页面样式 */
.checkout-progress {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    position: relative;
}

.step.completed,
.step.active {
    color: #007bff;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step.active .step-number {
    background: #007bff;
    color: white;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 100%;
    width: 2rem;
    height: 2px;
    background: #e9ecef;
    z-index: -1;
}

.step.completed:not(:last-child)::after {
    background: #28a745;
}

.checkout-page {
    padding: 2rem 0;
}

.checkout-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.form-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.delivery-options,
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delivery-option,
.payment-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delivery-option:hover,
.payment-option:hover {
    border-color: #007bff;
}

.delivery-option input:checked + .option-content,
.payment-option input:checked + .option-content {
    color: #007bff;
}

.option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-left: 1rem;
}

.option-info h4 {
    margin-bottom: 0.3rem;
}

.option-info p {
    color: #6c757d;
    font-size: 0.9rem;
}

.option-price {
    font-weight: bold;
    color: #2c3e50;
}

.card-details {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.order-summary {
    position: sticky;
    top: 100px;
}

.order-items {
    margin-bottom: 2rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

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

.order-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.item-info p {
    font-size: 0.8rem;
    color: #6c757d;
}

.item-total {
    font-weight: bold;
    color: #007bff;
}

.summary-calculations {
    margin-bottom: 2rem;
}

.checkout-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.checkout-actions .btn-secondary,
.checkout-actions .btn-primary {
    flex: 1;
    text-align: center;
}

.security-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #28a745;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }

    .item-price,
    .quantity-controls,
    .remove-item {
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 1rem;
    }

    .quantity-controls {
        justify-self: center;
    }

    .remove-item {
        justify-self: end;
    }

    .checkout-content {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .progress-steps {
        gap: 1rem;
    }

    .step span {
        font-size: 0.8rem;
    }

    .checkout-actions {
        flex-direction: column;
    }

    .security-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* 购物车勾选功能样式 */
.cart-item.selected {
    border-color: #007bff;
    background-color: #f8fbff;
}

.cart-item-checkbox:checked ~ .item-info {
    opacity: 1;
}

.cart-item-checkbox:not(:checked) ~ .item-info {
    opacity: 0.6;
}

/* 选中状态动画 */
.cart-item {
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* 移动端勾选框样式调整 */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 30px 80px 1fr;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .item-price, .item-quantity, .item-total {
        font-size: 0.9rem;
    }
    
    .item-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* 订单摘要选中商品列表样式 */
.order-items-summary {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.order-items-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.order-item-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.order-item-summary:last-child {
    border-bottom: none;
}

.item-name {
    font-size: 0.9rem;
    color: #495057;
    flex: 1;
}

.item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #007bff;
}

.order-totals {
    margin-top: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.total-line:last-child {
    border-bottom: none;
}

.total-line.discount {
    color: #28a745;
    font-weight: 600;
}

.total-line.final-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    border-top: 2px solid #dee2e6;
    margin-top: 0.5rem;
    padding-top: 0.8rem;
}

/* 选中商品摘要区域 */
.selected-items-summary {
    background: #f8fbff;
    border: 1px solid #d1ecf1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.selected-items-summary h4 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: #0c5460;
}

.selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.selected-item-name {
    color: #495057;
}

.selected-item-price {
    color: #007bff;
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .order-items-summary {
        padding: 0.8rem;
    }
    
    .order-item-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .selected-items-summary {
        padding: 0.8rem;
    }
    
    .selected-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}