Pakistan and Afghanistan have agreed to reopen the border within 48 hours after talks mediated by Qatar and Türkiye to reduce tensions and curb terrorism.