/* 购物车侧边栏样式 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px var(--shadow-color);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: stretch;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

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

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-info h3 {
    margin: 0 0 5px;
    color: var(--primary-color);
    font-size: 1rem;
}

.cart-item-info .price {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    height: 36px;
}

.quantity-btn {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    border-radius: 4px;
    padding: 0;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: var(--border-color);
}

.quantity-controls input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.remove-btn {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: white;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.total-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.cart-actions button {
    flex: 1;
    padding: 10px;
}

#clearCart {
    background-color: #ff4d4d;
}

#clearCart:hover {
    background-color: #ff3333;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-cart i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 15px;
}