            // Validate quantity if present
                    if (quantityInput) {
                        const quantity = parseInt(quantityInput.value);
                        if (!quantity || quantity < 1 || quantity > 100) {
                            alert('Please enter a valid quantity (1-100)');
                            return;
                        }
                    }
                    
                    // Change button text to show saving
                    const originalText = s