The goal is to replace what you are expending. You want to match your water and sodium intake with your sweat output and eat enough carbohydrates to "fuel" your activities for the day. It's a fine balance and may seem way too technical for a simple hike. I agree, but since you are having some digestive issues, it may help to work on this balance. On average, I think we only voluntarily drink about half of what we are expending, so it helps to be conscious of the amount you drink.
I like to use Nuun for electrolyte replacement and sometimes use "Clif shot bloks" for a little boost of carbohydrates. There are better products than Clif, but they are cheaper and easier to pick up for me. These don't offer much in the terms of calories and are really just supplemental. If you don't have the appetite to eat much, it's still important to make sure you are getting enough water and electrolytes. For a short term hike, your body can use energy from stored fat to make up for the calorie deficit.
If there is a nutritionist on here, they could go into a lot more helpful detail.
Bottom line: water and electrolyte replacement