/* Shopping Cart Page Styles */
#cart {
    background: #f5f5f5;
    min-height: calc(100vh - 114px);
    padding: 40px 0;
}

.cart-container {
    width: 1200px;
    margin: 0 auto;
}

.cart-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
}

/* Tab Navigation */
.cart-tabs {
    display: flex;
    background: #fff;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-bottom: none;
}

.cart-tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    background: #f9f9f9;
    border-right: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.cart-tab:last-child {
    border-right: none;
}

.cart-tab.active {
    background: #fff;
    color: #333;
    font-weight: bold;
    border-bottom: 2px solid #fff;
    margin-bottom: -1px;
}

.cart-tab:hover:not(.active) {
    background: #f0f0f0;
}

.tab-count {
    color: #999;
}

.cart-tab.active .tab-count {
    color: #333;
}

/* Cart Content Layout */
.cart-content {
    display: flex;
    gap: 20px;
}

/* Left: Product List */
.cart-products {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 400px;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-cart p {
    font-size: 16px;
    color: #999;
    margin-bottom: 20px;
}

.continue-shopping-btn {
    padding: 12px 30px;
    background: #C9A86C;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.3s;
}

.continue-shopping-btn:hover {
    background: #b89958;
    color: #fff;
}

/* Login Prompt */
.login-prompt {
    padding: 60px 20px;
}

.login-prompt-icon {
    margin-bottom: 20px;
}

.login-btn {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: #fff;
    border-radius: 24px;
    font-size: 15px;
    text-decoration: none;
    margin-bottom: 15px;
    transition: opacity 0.3s;
}

.login-btn:hover {
    opacity: 0.9;
    color: #fff;
}

.register-link {
    display: block;
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

.register-link:hover {
    color: #C9A86C;
}

/* Cart Item */
.cart-item {
    display: flex;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    margin-right: 25px;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    background: #f5f5f5;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 16px;
    font-weight: normal;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.item-name a {
    color: #333;
    text-decoration: none;
}

.item-name a:hover {
    color: #C9A86C;
}

.item-code {
    font-size: 13px;
    color: #999;
    margin: 0 0 8px 0;
}

.item-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 12px 0;
    font-size: 13px;
}

.spec-label {
    color: #666;
    font-weight: 500;
}

.spec-value {
    color: #333;
    margin-left: 4px;
}

.item-size {
    font-size: 14px;
    color: #333;
    margin: 0 0 15px 0;
}

.item-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control label {
    font-size: 14px;
    color: #666;
}

.quantity-control select {
    padding: 8px 30px 8px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
    min-width: 80px;
}

.quantity-control select:focus {
    outline: none;
    border-color: #C9A86C;
}

.quantity-display {
    display: inline-block;
    padding: 8px 15px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.remove-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #eee;
    border-color: #ccc;
}

.remove-icon {
    font-size: 14px;
    color: #999;
}

.item-total {
    display: flex;
    align-items: center;
    margin-left: auto;
    text-align: right;
}

.item-total p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.total-price {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* Right: Summary Panel */
.cart-summary {
    width: 320px;
    flex-shrink: 0;
}

.summary-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-of-type {
    border-bottom: none;
}

.summary-label {
    font-size: 14px;
    color: #666;
}

.summary-value {
    font-size: 14px;
    color: #333;
    text-align: right;
}

.discount-value {
    color: #C9A86C;
}

.summary-value.points {
    color: #C9A86C;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-top: 10px;
    border-top: 2px solid #eee;
}

.total-label {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.total-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.points-earned {
    text-align: right;
    font-size: 13px;
    color: #999;
    margin-bottom: 25px;
}

.checkout-btn {
    width: 100%;
    padding: 18px;
    background: #C9A86C;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 15px;
}

.checkout-btn:hover {
    background: #b89958;
}

.checkout-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.checkout-btn.disabled:hover {
    background: #ccc;
}

.continue-link {
    display: block;
    text-align: center;
    font-size: 14px;
    color: #C9A86C;
    text-decoration: underline;
}

.continue-link:hover {
    color: #b89958;
}

/* Responsive */
@media (max-width: 1240px) {
    .cart-container {
        width: 95%;
        padding: 0 20px;
    }
}

@media (max-width: 900px) {
    .cart-content {
        flex-direction: column;
    }

    .cart-summary {
        width: 100%;
    }

    .summary-content {
        position: static;
    }
}

/* 手机端适配 */
@media (max-width: 768px) {
    #cart {
        padding: 15px 0;
        min-height: calc(100vh - 60px);
    }

    .cart-container {
        width: 100%;
        padding: 0 12px;
    }

    .cart-title {
        font-size: 20px;
        margin-bottom: 15px;
        padding-left: 5px;
    }

    /* Tab */
    .cart-tabs {
        border-radius: 8px 8px 0 0;
    }

    .cart-tab {
        padding: 12px 10px;
        font-size: 14px;
    }

    /* 商品列表 */
    .cart-products {
        border-radius: 0 0 8px 8px;
        min-height: 200px;
    }

    .empty-cart {
        padding: 40px 15px;
    }

    .empty-cart p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .continue-shopping-btn {
        padding: 10px 25px;
        font-size: 13px;
    }

    /* 登录提示 */
    .login-prompt {
        padding: 40px 15px;
    }

    .login-prompt-icon svg {
        width: 40px;
        height: 40px;
    }

    .login-btn {
        padding: 12px 35px;
        font-size: 14px;
    }

    .register-link {
        font-size: 12px;
    }

    /* 购物车商品项 */
    .cart-item {
        flex-wrap: wrap;
        padding: 15px;
        gap: 12px;
    }

    .item-image {
        width: 80px;
        height: 80px;
        margin-right: 12px;
    }

    .item-details {
        flex: 1;
        min-width: calc(100% - 100px);
    }

    .item-name {
        font-size: 14px;
        margin-bottom: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .item-code {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .item-options {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }

    .quantity-control {
        gap: 5px;
    }

    .quantity-control label {
        font-size: 12px;
    }

    .quantity-control select {
        padding: 6px 25px 6px 10px;
        font-size: 13px;
        min-width: 65px;
    }

    .remove-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .item-total {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed #eee;
        justify-content: flex-end;
    }

    .item-total p {
        font-size: 13px;
    }

    .total-price {
        font-size: 18px;
    }

    /* 结算面板 */
    .cart-summary {
        width: 100%;
        margin-top: 15px;
    }

    .summary-content {
        padding: 15px;
        border-radius: 8px;
    }

    .summary-row {
        padding: 10px 0;
    }

    .summary-label {
        font-size: 13px;
    }

    .summary-value {
        font-size: 13px;
    }

    .summary-total {
        padding: 15px 0;
        margin-top: 8px;
    }

    .total-label {
        font-size: 14px;
    }

    .total-value {
        font-size: 22px;
    }

    .points-earned {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .checkout-btn {
        padding: 14px;
        font-size: 15px;
        border-radius: 25px;
        margin-bottom: 12px;
    }

    .continue-link {
        font-size: 13px;
    }
}

/* 超小屏幕 */
@media (max-width: 375px) {
    .cart-container {
        padding: 0 10px;
    }

    .cart-title {
        font-size: 18px;
    }

    .cart-tab {
        padding: 10px 8px;
        font-size: 13px;
    }

    .cart-item {
        padding: 12px;
    }

    .item-image {
        width: 70px;
        height: 70px;
    }

    .item-name {
        font-size: 13px;
    }

    .total-price {
        font-size: 16px;
    }

    .total-value {
        font-size: 20px;
    }
}
