/* css/cart-sidebar.css - 购物车侧边栏样式 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

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

.cart-sidebar-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 18px;
}

.cart-sidebar-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.cart-sidebar-close:hover {
    color: var(--accent-color);
}

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

.cart-sidebar-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.cart-sidebar-item-image {
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.cart-sidebar-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.4;
}

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

.cart-sidebar-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

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

.quantity-control-input {
    width: 40px;
    height: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

.remove-item {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s;
}

.remove-item:hover {
    color: var(--accent-color);
}

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

.cart-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

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

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

.total-amount {
    color: var(--accent-color);
    font-size: 18px;
}

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

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

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

/* 响应式设计 */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
}